var TRbignumber=function(e){return function(n){"use strict";var t,r=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,u=" not a boolean or binary digit",s="rounding mode",f="number type has more than 15 significant digits",c="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",l=1e14,a=14,h=9007199254740991,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,d=1e9;function m(e){var n=0|e;return e>0||e===n?n:n-1}function w(e){for(var n,t,r=1,i=e.length,o=e[0]+"";rc^t?1:-1;for(s=(f=i.length)<(c=o.length)?f:c,u=0;uo[u]^t?1:-1;return f==c?0:f>c^t?1:-1}function y(e,n,t){return(e=x(e))>=n&&e<=t}function b(e){return"[object Array]"==Object.prototype.toString.call(e)}function N(e,n,t){for(var r,i,o=[0],u=0,s=e.length;ut-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}function O(e,n){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(n<0?"e":"e+")+n}function S(e,n){var t,r;if(n<0){for(r="0.";++n;r+="0");e=r+e}else if(++n>(t=e.length)){for(r="0",n-=t;--n;r+="0");e+=r}else n15&&Q(D,f,e),s=!1):p.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1,g=W(g,10,n,p.s)}else{if(e instanceof J)return p.s=e.s,p.e=e.e,p.c=(e=e.c)?e.slice():e,void(D=0);if((s="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(i=0,u=e;u>=10;u/=10,i++);return p.e=i,p.c=[e],void(D=0)}g=e+""}else{if(!r.test(g=e+""))return R(p,g,s);p.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1}}for((i=g.indexOf("."))>-1&&(g=g.replace(".","")),(u=g.search(/e/i))>0?(i<0&&(i=u),i+=+g.slice(u+1),g=g.substring(0,u)):i<0&&(i=g.length),u=0;48===g.charCodeAt(u);u++);for(l=g.length;48===g.charCodeAt(--l););if(g=g.slice(u,l+1))if(l=g.length,s&&q&&l>15&&(e>h||e!==o(e))&&Q(D,f,p.s*e),(i=i-u-1)>P)p.c=p.e=null;else if(i=0&&(s=V,V=0,e=e.replace(".",""),l=(h=new J(r)).pow(e.length-g),V=s,h.c=N(S(w(l.c),l.e),10,n),h.e=h.c.length),u=s=(a=N(e,r,n)).length;0==a[--s];a.pop());if(!a[0])return"0";if(g<0?--u:(l.c=a,l.e=u,l.s=i,a=(l=t(l,h,p,d,n)).c,f=l.r,u=l.e),g=a[o=u+p+1],s=n/2,f=f||o<0||null!=a[o+1],f=d<4?(null!=g||f)&&(0==d||d==(l.s<0?3:2)):g>s||g==s&&(4==d||f||6==d&&1&a[o-1]||d==(l.s<0?8:7)),o<1||!a[0])e=f?S("1",-p):"0";else{if(a.length=o,f)for(--n;++a[--o]>n;)a[o]=0,o||(++u,a=[1].concat(a));for(s=a.length;!a[--s];);for(g=0,e="";g<=s;e+=c.charAt(a[g++]));e=S(e,u)}return e}function X(e,n,t,r){var i,o,u,f,c;if(t=null!=t&&$(t,0,8,r,s)?0|t:U,!e.c)return e.toString();if(i=e.c[0],u=e.e,null==n)c=w(e.c),c=19==r||24==r&&u<=L?O(c,u):S(c,u);else if(o=(e=ee(new J(e),n,t)).e,f=(c=w(e.c)).length,19==r||24==r&&(n<=o||o<=L)){for(;ff){if(--n>0)for(c+=".";n--;c+="0");}else if((n+=o-f)>0)for(o+1==f&&(c+=".");n--;c+="0");return e.s<0&&i?"-"+c:c}function Y(e,n){var t,r,i=0;for(b(e[0])&&(e=e[0]),t=new J(e[0]);++it||e!=x(e))&&Q(r,(i||"decimal places")+(et?" out of range":" not an integer"),e),!0}function K(e,n,t){for(var r=1,i=n.length;!n[--i];n.pop());for(i=n[0];i>=10;i/=10,r++);return(t=r+t*a-1)>P?e.c=e.e=null:t=10;c/=10,u++);if((s=n-u)<0)s+=a,f=n,d=(h=m[p=0])/w[u-f-1]%10|0;else if((p=i((s+1)/a))>=m.length){if(!r)break e;for(;m.length<=p;m.push(0));h=d=0,u=1,f=(s%=a)-a+1}else{for(h=c=m[p],u=1;c>=10;c/=10,u++);d=(f=(s%=a)-a+u)<0?0:h/w[u-f-1]%10|0}if(r=r||n<0||null!=m[p+1]||(f<0?h:h%w[u-f-1]),r=t<4?(d||r)&&(0==t||t==(e.s<0?3:2)):d>5||5==d&&(4==t||r||6==t&&(s>0?f>0?h/w[u-f]:0:m[p-1])%10&1||t==(e.s<0?8:7)),n<1||!m[0])return m.length=0,r?(n-=e.e+1,m[0]=w[(a-n%a)%a],e.e=-n||0):m[0]=e.e=0,e;if(0==s?(m.length=p,c=1,p--):(m.length=p+1,c=w[a-s],m[p]=f>0?o(h/w[u-f]%w[f])*c:0),r)for(;;){if(0==p){for(s=1,f=m[0];f>=10;f/=10,s++);for(f=m[0]+=c,c=1;f>=10;f/=10,c++);s!=c&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=c,m[p]!=l)break;m[p--]=0,c=1}for(s=m.length;0===m[--s];m.pop());}e.e>P?e.c=e.e=null:e.et)return null!=(e=i[t++])};return s(n="DECIMAL_PLACES")&&$(e,0,d,2,n)&&(C=0|e),r[n]=C,s(n="ROUNDING_MODE")&&$(e,0,8,2,n)&&(U=0|e),r[n]=U,s(n="EXPONENTIAL_AT")&&(b(e)?$(e[0],-d,0,2,n)&&$(e[1],0,d,2,n)&&(L=0|e[0],k=0|e[1]):$(e,-d,d,2,n)&&(L=-(k=0|(e<0?-e:e)))),r[n]=[L,k],s(n="RANGE")&&(b(e)?$(e[0],-d,-1,2,n)&&$(e[1],1,d,2,n)&&(M=0|e[0],P=0|e[1]):$(e,-d,d,2,n)&&(0|e?M=-(P=0|(e<0?-e:e)):q&&Q(2,n+" cannot be zero",e))),r[n]=[M,P],s(n="ERRORS")&&(e===!!e||1===e||0===e?(D=0,$=(q=!!e)?Z:y):q&&Q(2,n+u,e)),r[n]=q,s(n="CRYPTO")&&(!0===e||!1===e||1===e||0===e?e?!(e="undefined"==typeof crypto)&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?G=!0:q?Q(2,"crypto unavailable",e?void 0:crypto):G=!1:G=!1:q&&Q(2,n+u,e)),r[n]=G,s(n="MODULO_MODE")&&$(e,0,9,2,n)&&(z=0|e),r[n]=z,s(n="POW_PRECISION")&&$(e,0,d,2,n)&&(V=0|e),r[n]=V,s(n="FORMAT")&&("object"==typeof e?H=e:q&&Q(2,n+" not an object",e)),r[n]=H,r},J.max=function(){return Y(arguments,I.lt)},J.min=function(){return Y(arguments,I.gt)},J.random=(A=9007199254740992*Math.random()&2097151?function(){return o(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var n,t,r,u,s,f=0,c=[],l=new J(T);if(e=null!=e&&$(e,0,d,14)?0|e:C,u=i(e/a),G)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(u*=2));f>>11))>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),n[f]=t[0],n[f+1]=t[1]):(c.push(s%1e14),f+=2);f=u/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(u*=7);f=9e15?crypto.randomBytes(7).copy(n,f):(c.push(s%1e14),f+=7);f=u/7}else G=!1,q&&Q(14,"crypto unavailable",crypto);if(!G)for(;f=10;s/=10,f++);fr?1:-1;else for(i=o=0;in[i]?1:-1;break}return o}function t(e,n,t,r){for(var i=0;t--;)e[t]-=i,i=e[t]1;e.splice(0,1));}return function(r,i,u,s,f){var c,h,g,p,d,w,v,y,b,N,O,S,x,R,A,E,j,_=r.s==i.s?1:-1,F=r.c,B=i.c;if(!(F&&F[0]&&B&&B[0]))return new J(r.s&&i.s&&(F?!B||F[0]!=B[0]:B)?F&&0==F[0]||!B?0*_:_/0:NaN);for(b=(y=new J(_)).c=[],_=u+(h=r.e-i.e)+1,f||(f=l,h=m(r.e/a)-m(i.e/a),_=_/a|0),g=0;B[g]==(F[g]||0);g++);if(B[g]>(F[g]||0)&&h--,_<0)b.push(1),p=!0;else{for(R=F.length,E=B.length,g=0,_+=2,(d=o(f/(B[0]+1)))>1&&(B=e(B,d,f),F=e(F,d,f),E=B.length,R=F.length),x=E,O=(N=F.slice(0,E)).length;O=f/2&&A++;do{if(d=0,(c=n(B,N,E,O))<0){if(S=N[0],E!=O&&(S=S*f+(N[1]||0)),(d=o(S/A))>1)for(d>=f&&(d=f-1),v=(w=e(B,d,f)).length,O=N.length;1==n(w,N,v,O);)d--,t(w,E=10;_/=10,g++);ee(y,u+(y.e=g+h*a-1)+1,s,p)}else y.e=h,y.r=+p;return y}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,j=/^([^.]+)\.$/,_=/^\.([^.]+)$/,F=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g,R=function(e,n,t,r){var i,o=t?n:n.replace(B,"");if(F.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!t&&(o=o.replace(E,function(e,n,t){return i="x"==(t=t.toLowerCase())?16:"b"==t?2:8,r&&r!=i?e:n}),r&&(i=r,o=o.replace(j,"$1").replace(_,"0.$1")),n!=o))return new J(o,i);q&&Q(D,"not a"+(r?" base "+r:"")+" number",n),e.s=null}e.c=e.e=null,D=0},I.absoluteValue=I.abs=function(){var e=new J(this);return e.s<0&&(e.s=1),e},I.ceil=function(){return ee(new J(this),this.e+1,2)},I.comparedTo=I.cmp=function(e,n){return D=1,v(this,new J(e,n))},I.decimalPlaces=I.dp=function(){var e,n,t=this.c;if(!t)return null;if(e=((n=t.length-1)-m(this.e/a))*a,n=t[n])for(;n%10==0;n/=10,e--);return e<0&&(e=0),e},I.dividedBy=I.div=function(e,n){return D=3,t(this,new J(e,n),C,U)},I.dividedToIntegerBy=I.divToInt=function(e,n){return D=4,t(this,new J(e,n),0,1)},I.equals=I.eq=function(e,n){return D=5,0===v(this,new J(e,n))},I.floor=function(){return ee(new J(this),this.e+1,3)},I.greaterThan=I.gt=function(e,n){return D=6,v(this,new J(e,n))>0},I.greaterThanOrEqualTo=I.gte=function(e,n){return D=7,1===(n=v(this,new J(e,n)))||0===n},I.isFinite=function(){return!!this.c},I.isInteger=I.isInt=function(){return!!this.c&&m(this.e/a)>this.c.length-2},I.isNaN=function(){return!this.s},I.isNegative=I.isNeg=function(){return this.s<0},I.isZero=function(){return!!this.c&&0==this.c[0]},I.lessThan=I.lt=function(e,n){return D=8,v(this,new J(e,n))<0},I.lessThanOrEqualTo=I.lte=function(e,n){return D=9,-1===(n=v(this,new J(e,n)))||0===n},I.minus=I.sub=function(e,n){var t,r,i,o,u=this,s=u.s;if(D=10,n=(e=new J(e,n)).s,!s||!n)return new J(NaN);if(s!=n)return e.s=-n,u.plus(e);var f=u.e/a,c=e.e/a,h=u.c,g=e.c;if(!f||!c){if(!h||!g)return h?(e.s=-n,e):new J(g?u:NaN);if(!h[0]||!g[0])return g[0]?(e.s=-n,e):new J(h[0]?u:3==U?-0:0)}if(f=m(f),c=m(c),h=h.slice(),s=f-c){for((o=s<0)?(s=-s,i=h):(c=f,i=g),i.reverse(),n=s;n--;i.push(0));i.reverse()}else for(r=(o=(s=h.length)<(n=g.length))?s:n,s=n=0;n0)for(;n--;h[t++]=0);for(n=l-1;r>s;){if(h[--r]0?(u=o,t=f):(i=-i,t=s),t.reverse();i--;t.push(0));t.reverse()}for((i=s.length)-(n=f.length)<0&&(t=f,f=s,s=t,n=i),i=0;n;)i=(s[--n]=s[n]+f[n]+i)/l|0,s[n]=l===s[n]?0:s[n]%l;return i&&(s=[i].concat(s),++u),K(e,s,u)},I.precision=I.sd=function(e){var n,t,r=this,i=r.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(q&&Q(13,"argument"+u,e),e!=!!e&&(e=null)),!i)return null;if(n=(t=i.length-1)*a+1,t=i[t]){for(;t%10==0;t/=10,n--);for(t=i[0];t>=10;t/=10,n++);}return e&&r.e+1>n&&(n=r.e+1),n},I.round=function(e,n){var t=new J(this);return(null==e||$(e,0,d,15))&&ee(t,~~e+this.e+1,null!=n&&$(n,0,8,15,s)?0|n:U),t},I.shift=function(e){var n=this;return $(e,-h,h,16,"argument")?n.times("1e"+x(e)):new J(n.c&&n.c[0]&&(e<-h||e>h)?n.s*(e<0?0:1/0):n)},I.squareRoot=I.sqrt=function(){var e,n,r,i,o,u=this,s=u.c,f=u.s,c=u.e,l=C+4,a=new J("0.5");if(1!==f||!s||!s[0])return new J(!f||f<0&&(!s||s[0])?NaN:s?u:1/0);if(0==(f=Math.sqrt(+u))||f==1/0?(((n=w(s)).length+c)%2==0&&(n+="0"),f=Math.sqrt(n),c=m((c+1)/2)-(c<0||c%2),r=new J(n=f==1/0?"1e"+c:(n=f.toExponential()).slice(0,n.indexOf("e")+1)+c)):r=new J(f+""),r.c[0])for((f=(c=r.e)+l)<3&&(f=0);;)if(o=r,r=a.times(o.plus(t(u,o,l,1))),w(o.c).slice(0,f)===(n=w(r.c)).slice(0,f)){if(r.e=0;){for(t=0,d=S[i]%b,w=S[i]/b|0,o=i+(u=f);o>i;)t=((c=d*(c=O[--u]%b)+(s=w*c+(h=O[u]/b|0)*d)%b*b+v[o]+t)/y|0)+(s/b|0)+w*h,v[o--]=c%y;v[o]=t}return t?++r:v.splice(0,1),K(e,v,r)},I.toDigits=function(e,n){var t=new J(this);return e=null!=e&&$(e,1,d,18,"precision")?0|e:null,n=null!=n&&$(n,0,8,18,s)?0|n:U,e?ee(t,e,n):t},I.toExponential=function(e,n){return X(this,null!=e&&$(e,0,d,19)?1+~~e:null,n,19)},I.toFixed=function(e,n){return X(this,null!=e&&$(e,0,d,20)?~~e+this.e+1:null,n,20)},I.toFormat=function(e,n){var t=X(this,null!=e&&$(e,0,d,21)?~~e+this.e+1:null,n,21);if(this.c){var r,i=t.split("."),o=+H.groupSize,u=+H.secondaryGroupSize,s=H.groupSeparator,f=i[0],c=i[1],l=this.s<0,a=l?f.slice(1):f,h=a.length;if(u&&(r=o,o=u,u=r,h-=r),o>0&&h>0){for(r=h%o||o,f=a.substr(0,r);r0&&(f+=s+a.slice(r)),l&&(f="-"+f)}t=c?f+H.decimalSeparator+((u=+H.fractionGroupSize)?c.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+H.fractionGroupSeparator):c):f}return t},I.toFraction=function(e){var n,r,i,o,u,s,f,c,l,h=q,p=this,d=p.c,m=new J(T),v=r=new J(T),y=f=new J(T);if(null!=e&&(q=!1,s=new J(e),q=h,(h=s.isInt())&&!s.lt(T)||(q&&Q(22,"max denominator "+(h?"out of range":"not an integer"),e),e=!h&&s.c&&ee(s,s.e+1,1).gte(T)?s:null)),!d)return p.toString();for(l=w(d),o=m.e=l.length-p.e-1,m.c[0]=g[(u=o%a)<0?a+u:u],e=!e||s.cmp(m)>0?o>0?m:v:s,u=P,P=1/0,s=new J(l),f.c[0]=0;c=t(s,m,0,1),1!=(i=r.plus(c.times(y))).cmp(e);)r=y,y=i,v=f.plus(c.times(i=v)),f=i,m=s.minus(c.times(i=m)),s=i;return i=t(e.minus(r),y,0,1),f=f.plus(i.times(v)),r=r.plus(i.times(y)),f.s=v.s=p.s,n=t(v,y,o*=2,U).minus(p).abs().cmp(t(f,r,o,U).minus(p).abs())<1?[v.toString(),y.toString()]:[f.toString(),r.toString()],P=u,n},I.toNumber=function(){return+this},I.toPower=I.pow=function(e,n){var t,r,u,s=o(e<0?-e:+e),f=this;if(null!=n&&(D=23,n=new J(n)),!$(e,-h,h,23,"exponent")&&(!isFinite(e)||s>h&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return t=Math.pow(+f,e),new J(n?t%n:t);for(n?e>1&&f.gt(T)&&f.isInt()&&n.gt(T)&&n.isInt()?f=f.mod(n):(u=n,n=null):V&&(t=i(V/a+2)),r=new J(T);;){if(s%2){if(!(r=r.times(f)).c)break;t?r.c.length>t&&(r.c.length=t):n&&(r=r.mod(n))}if(!(s=o(s/2)))break;f=f.times(f),t?f.c&&f.c.length>t&&(f.c.length=t):n&&(f=f.mod(n))}return n?r:(e<0&&(r=T.div(r)),u?r.mod(u):t?ee(r,V,U):r)},I.toPrecision=function(e,n){return X(this,null!=e&&$(e,1,d,24,"precision")?0|e:null,n,24)},I.toString=function(e){var n,t=this,r=t.s,i=t.e;return null===i?r?(n="Infinity",r<0&&(n="-"+n)):n="NaN":(n=w(t.c),n=null!=e&&$(e,2,64,25,"base")?W(S(n,i),0|e,10,r):i<=L||i>=k?O(n,i):S(n,i),r<0&&t.c[0]&&(n="-"+n)),n},I.truncated=I.trunc=function(){return ee(new J(this),this.e+1,1)},I.valueOf=I.toJSON=function(){var e,n=this,t=n.e;return null===t?n.toString():(e=w(n.c),e=t<=L||t>=k?O(e,t):S(e,t),n.s<0?"-"+e:e)},I.isBigNumber=!0,null!=n&&J.config(n),J}()).default=t.BigNumber=t,"function"==typeof define&&define.amd?define(function(){return t}):void 0!==e&&e.exports?e.exports=t:(n||(n="undefined"!=typeof self?self:Function("return this")()),n.BigNumber=t)}(this),e.exports}({exports:{}}),TRstringify=function(e){var n={};return function(){"use strict";var e,t,r,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function u(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,function(e){var n=o[e];return"string"==typeof n?n:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}"function"!=typeof n.stringify&&(n.stringify=function(n,i,o){var s;if(e="",t="","number"==typeof o)for(s=0;s="0"&&r<="9";)t+=r,f();if("."===r)for(t+=".";f()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,f(),"-"!==r&&"+"!==r||(t+=r,f());r>="0"&&r<="9";)t+=r,f();if(e=+t,isFinite(e))return t.length>15?!0===n.storeAsString?t:new BigNumber(t):e;s("Bad number")},l=function(){var e,n,t,i="";if('"'===r)for(;f();){if('"'===r)return f(),i;if("\\"===r)if(f(),"u"===r){for(t=0,n=0;n<4&&(e=parseInt(f(),16),isFinite(e));n+=1)t=16*t+e;i+=String.fromCharCode(t)}else{if("string"!=typeof u[r])break;i+=u[r]}else i+=r}s("Bad string")},a=function(){for(;r&&r<=" ";)f()};return o=function(){switch(a(),r){case"{":return function(){var e,t={};if("{"===r){if(f("{"),a(),"}"===r)return f("}"),t;for(;r;){if(e=l(),a(),f(":"),!0===n.strict&&Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=o(),a(),"}"===r)return f("}"),t;f(","),a()}}s("Bad object")}();case"[":return function(){var e=[];if("["===r){if(f("["),a(),"]"===r)return f("]"),e;for(;r;){if(e.push(o()),a(),"]"===r)return f("]"),e;f(","),a()}}s("Bad array")}();case'"':return l();case"-":return c();default:return r>="0"&&r<="9"?c():function(){switch(r){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}s("Unexpected '"+r+"'")}()}},function(e,n){var u;return i=e+"",t=0,r=" ",u=o(),a(),r&&s("Syntax error"),"function"==typeof n?function e(t,r){var i,o=t[r];return o&&"object"==typeof o&&Object.keys(o).forEach(function(n){void 0!==(i=e(o,n))?o[n]=i:delete o[n]}),n.call(t,r,o)}({"":u},""):u}},e.exports}({exports:{}});var BigNumber=TRbignumber,json_stringify=TRstringify,json_parse=TRparse; let Jb=function(e){return{parse:json_parse(e),stringify:json_stringify}}; JSON.parse = json_parse(); JSON.stringify = json_stringify; JSON.BigNumber = BigNumber;