lyb-js 1.1.7 → 1.1.9

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.
@@ -24,5 +24,5 @@ export var libJsNumberUnit = function (num, units, point) {
24
24
  return [formattedValue, unit, formattedValue + unit];
25
25
  }
26
26
  }
27
- return [decimalValue.toFixed(point), ""];
27
+ return [decimalValue.toFixed(point), "", decimalValue.toFixed(point)];
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-js",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "自用JS方法库",
5
5
  "license": "ISC",
6
6
  "type": "module",
package/umd/lyb.js CHANGED
@@ -5,4 +5,4 @@ ${o.label}:`,o.value]);console.log(`%c${s()}-${e}`,`color: #fff;background: ${
5
5
  * https://github.com/MikeMcl/decimal.js
6
6
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
7
7
  * MIT Licence
8
- */var fe=9e15,ie=1e9,_e="0123456789abcdef",$e="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Me="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Oe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-fe,maxE:fe,crypto:!1},Je,te,_=!0,be="[DecimalError] ",re=be+"Invalid argument: ",Re=be+"Precision limit exceeded",qe=be+"crypto unavailable",Ue="[object Decimal]",W=Math.floor,Y=Math.pow,bt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Nt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,St=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Be=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,K=1e7,k=7,Dt=9007199254740991,Et=$e.length-1,Te=Me.length-1,d={toStringTag:Ue};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),S(e)},d.ceil=function(){return S(new this.constructor(this),this.e+1,2)},d.clampedTo=d.clamp=function(e,t){var n,i=this,s=i.constructor;if(e=new s(e),t=new s(t),!e.s||!t.s)return new s(NaN);if(e.gt(t))throw Error(re+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new s(i)},d.comparedTo=d.cmp=function(e){var t,n,i,s,r=this,o=r.d,u=(e=new r.constructor(e)).d,a=r.s,c=e.s;if(!o||!u)return!a||!c?NaN:a!==c?a:o===u?0:!o^a<0?1:-1;if(!o[0]||!u[0])return o[0]?a:u[0]?-c:0;if(a!==c)return a;if(r.e!==e.e)return r.e>e.e^a<0?1:-1;for(i=o.length,s=u.length,t=0,n=i<s?i:s;t<n;++t)if(o[t]!==u[t])return o[t]>u[t]^a<0?1:-1;return i===s?0:i>s^a<0?1:-1},d.cosine=d.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+k,i.rounding=1,n=kt(i,Ve(i,n)),i.precision=e,i.rounding=t,S(te==2||te==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},d.cubeRoot=d.cbrt=function(){var e,t,n,i,s,r,o,u,a,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(_=!1,r=f.s*Y(f.s*f,1/3),!r||Math.abs(r)==1/0?(n=j(f.d),e=f.e,(r=(e-n.length+1)%3)&&(n+=r==1||r==-2?"0":"00"),r=Y(n,1/3),e=W((e+1)/3)-(e%3==(e<0?-1:2)),r==1/0?n="5e"+e:(n=r.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new l(n),i.s=f.s):i=new l(r.toString()),o=(e=l.precision)+3;;)if(u=i,a=u.times(u).times(u),c=a.plus(f),i=P(c.plus(f).times(u),c.plus(a),o+2,1),j(u.d).slice(0,o)===(n=j(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!s&&n=="4999"){if(!s&&(S(u,e+1,0),u.times(u).times(u).eq(f))){i=u;break}o+=4,s=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(S(i,e+1,1),t=!i.times(i).times(i).eq(f));break}return _=!0,S(i,e,l.rounding,t)},d.decimalPlaces=d.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-W(this.e/k))*k,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},d.dividedBy=d.div=function(e){return P(this,new this.constructor(e))},d.dividedToIntegerBy=d.divToInt=function(e){var t=this,n=t.constructor;return S(P(t,new n(e),0,1,1),n.precision,n.rounding)},d.equals=d.eq=function(e){return this.cmp(e)===0},d.floor=function(){return S(new this.constructor(this),this.e+1,3)},d.greaterThan=d.gt=function(e){return this.cmp(e)>0},d.greaterThanOrEqualTo=d.gte=function(e){var t=this.cmp(e);return t==1||t===0},d.hyperbolicCosine=d.cosh=function(){var e,t,n,i,s,r=this,o=r.constructor,u=new o(1);if(!r.isFinite())return new o(r.s?1/0:NaN);if(r.isZero())return u;n=o.precision,i=o.rounding,o.precision=n+Math.max(r.e,r.sd())+4,o.rounding=1,s=r.d.length,s<32?(e=Math.ceil(s/3),t=(1/Ee(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),r=le(o,1,r.times(t),new o(1),!0);for(var a,c=e,f=new o(8);c--;)a=r.times(r),r=u.minus(a.times(f.minus(a.times(f))));return S(r,o.precision=n,o.rounding=i,!0)},d.hyperbolicSine=d.sinh=function(){var e,t,n,i,s=this,r=s.constructor;if(!s.isFinite()||s.isZero())return new r(s);if(t=r.precision,n=r.rounding,r.precision=t+Math.max(s.e,s.sd())+4,r.rounding=1,i=s.d.length,i<3)s=le(r,2,s,s,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,s=s.times(1/Ee(5,e)),s=le(r,2,s,s,!0);for(var o,u=new r(5),a=new r(16),c=new r(20);e--;)o=s.times(s),s=s.times(u.plus(o.times(a.times(o).plus(c))))}return r.precision=t,r.rounding=n,S(s,t,n,!0)},d.hyperbolicTangent=d.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,P(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},d.inverseCosine=d.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),s=n.precision,r=n.rounding;return i!==-1?i===0?t.isNeg()?Q(n,s,r):new n(0):new n(NaN):t.isZero()?Q(n,s+4,r).times(.5):(n.precision=s+6,n.rounding=1,t=t.asin(),e=Q(n,s+4,r).times(.5),n.precision=s,n.rounding=r,e.minus(t))},d.inverseHyperbolicCosine=d.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,_=!1,n=n.times(n).minus(1).sqrt().plus(n),_=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},d.inverseHyperbolicSine=d.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,_=!1,n=n.times(n).plus(1).sqrt().plus(n),_=!0,i.precision=e,i.rounding=t,n.ln())},d.inverseHyperbolicTangent=d.atanh=function(){var e,t,n,i,s=this,r=s.constructor;return s.isFinite()?s.e>=0?new r(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(e=r.precision,t=r.rounding,i=s.sd(),Math.max(i,e)<2*-s.e-1?S(new r(s),e,t,!0):(r.precision=n=i-s.e,s=P(s.plus(1),new r(1).minus(s),n+e,1),r.precision=e+4,r.rounding=1,s=s.ln(),r.precision=e,r.rounding=t,s.times(.5))):new r(NaN)},d.inverseSine=d.asin=function(){var e,t,n,i,s=this,r=s.constructor;return s.isZero()?new r(s):(t=s.abs().cmp(1),n=r.precision,i=r.rounding,t!==-1?t===0?(e=Q(r,n+4,i).times(.5),e.s=s.s,e):new r(NaN):(r.precision=n+6,r.rounding=1,s=s.div(new r(1).minus(s.times(s)).sqrt().plus(1)).atan(),r.precision=n,r.rounding=i,s.times(2)))},d.inverseTangent=d.atan=function(){var e,t,n,i,s,r,o,u,a,c=this,f=c.constructor,l=f.precision,h=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=Te)return o=Q(f,l+4,h).times(.25),o.s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=Te)return o=Q(f,l+4,h).times(.5),o.s=c.s,o}for(f.precision=u=l+10,f.rounding=1,n=Math.min(28,u/k+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(u/k),i=1,a=c.times(c),o=new f(c),s=c;e!==-1;)if(s=s.times(a),r=o.minus(s.div(i+=2)),s=s.times(a),o=r.plus(s.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===r.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),_=!0,S(o,f.precision=l,f.rounding=h,!0)},d.isFinite=function(){return!!this.d},d.isInteger=d.isInt=function(){return!!this.d&&W(this.e/k)>this.d.length-2},d.isNaN=function(){return!this.s},d.isNegative=d.isNeg=function(){return this.s<0},d.isPositive=d.isPos=function(){return this.s>0},d.isZero=function(){return!!this.d&&this.d[0]===0},d.lessThan=d.lt=function(e){return this.cmp(e)<0},d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1},d.logarithm=d.log=function(e){var t,n,i,s,r,o,u,a,c=this,f=c.constructor,l=f.precision,h=f.rounding,p=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new f(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)r=!0;else{for(s=n[0];s%10===0;)s/=10;r=s!==1}if(_=!1,u=l+p,o=oe(c,u),i=t?De(f,u+10):oe(e,u),a=P(o,i,u,1),de(a.d,s=l,h))do if(u+=10,o=oe(c,u),i=t?De(f,u+10):oe(e,u),a=P(o,i,u,1),!r){+j(a.d).slice(s+1,s+15)+1==1e14&&(a=S(a,l+1,0));break}while(de(a.d,s+=10,h));return _=!0,S(a,l,h)},d.minus=d.sub=function(e){var t,n,i,s,r,o,u,a,c,f,l,h,p=this,w=p.constructor;if(e=new w(e),!p.d||!e.d)return!p.s||!e.s?e=new w(NaN):p.d?e.s=-e.s:e=new w(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,h=e.d,u=w.precision,a=w.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else if(c[0])e=new w(p);else return new w(a===3?-0:0);return _?S(e,u,a):e}if(n=W(e.e/k),f=W(p.e/k),c=c.slice(),r=f-n,r){for(l=r<0,l?(t=c,r=-r,o=h.length):(t=h,n=f,o=c.length),i=Math.max(Math.ceil(u/k),o)+2,r>i&&(r=i,t.length=1),t.reverse(),i=r;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=h.length,l=i<o,l&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){l=c[i]<h[i];break}r=0}for(l&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>r;){if(c[--i]<h[i]){for(s=i;s&&c[--s]===0;)c[s]=K-1;--c[s],c[i]+=K}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=Se(c,n),_?S(e,u,a):e):new w(a===3?-0:0)},d.modulo=d.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?S(new i(n),i.precision,i.rounding):(_=!1,i.modulo==9?(t=P(n,e.abs(),0,3,1),t.s*=e.s):t=P(n,e,0,i.modulo,1),t=t.times(e),_=!0,n.minus(t))},d.naturalExponential=d.exp=function(){return ye(this)},d.naturalLogarithm=d.ln=function(){return oe(this)},d.negated=d.neg=function(){var e=new this.constructor(this);return e.s=-e.s,S(e)},d.plus=d.add=function(e){var t,n,i,s,r,o,u,a,c,f,l=this,h=l.constructor;if(e=new h(e),!l.d||!e.d)return!l.s||!e.s?e=new h(NaN):l.d||(e=new h(e.d||l.s===e.s?l:NaN)),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,u=h.precision,a=h.rounding,!c[0]||!f[0])return f[0]||(e=new h(l)),_?S(e,u,a):e;if(r=W(l.e/k),i=W(e.e/k),c=c.slice(),s=r-i,s){for(s<0?(n=c,s=-s,o=f.length):(n=f,i=r,o=c.length),r=Math.ceil(u/k),o=r>o?r+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=c.length,s=f.length,o-s<0&&(s=o,n=f,f=c,c=n),t=0;s;)t=(c[--s]=c[s]+f[s]+t)/K|0,c[s]%=K;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=Se(c,i),_?S(e,u,a):e},d.precision=d.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(re+e);return n.d?(t=He(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},d.round=function(){var e=this,t=e.constructor;return S(new t(e),e.e+1,t.rounding)},d.sine=d.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+k,i.rounding=1,n=Ot(i,Ve(i,n)),i.precision=e,i.rounding=t,S(te>2?n.neg():n,e,t,!0)):new i(NaN)},d.squareRoot=d.sqrt=function(){var e,t,n,i,s,r,o=this,u=o.d,a=o.e,c=o.s,f=o.constructor;if(c!==1||!u||!u[0])return new f(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);for(_=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=j(u),(t.length+a)%2==0&&(t+="0"),c=Math.sqrt(t),a=W((a+1)/2)-(a<0||a%2),c==1/0?t="5e"+a:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),i=new f(t)):i=new f(c.toString()),n=(a=f.precision)+3;;)if(r=i,i=r.plus(P(o,r,n+2,1)).times(.5),j(r.d).slice(0,n)===(t=j(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!s&&t=="4999"){if(!s&&(S(r,a+1,0),r.times(r).eq(o))){i=r;break}n+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(S(i,a+1,1),e=!i.times(i).eq(o));break}return _=!0,S(i,a,f.rounding,e)},d.tangent=d.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=P(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,S(te==2||te==4?n.neg():n,e,t,!0)):new i(NaN)},d.times=d.mul=function(e){var t,n,i,s,r,o,u,a,c,f=this,l=f.constructor,h=f.d,p=(e=new l(e)).d;if(e.s*=f.s,!h||!h[0]||!p||!p[0])return new l(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:!h||!p?e.s/0:e.s*0);for(n=W(f.e/k)+W(e.e/k),a=h.length,c=p.length,a<c&&(r=h,h=p,p=r,o=a,a=c,c=o),r=[],o=a+c,i=o;i--;)r.push(0);for(i=c;--i>=0;){for(t=0,s=a+i;s>i;)u=r[s]+p[i]*h[s-i-1]+t,r[s--]=u%K|0,t=u/K|0;r[s]=(r[s]+t)%K|0}for(;!r[--o];)r.pop();return t?++n:r.shift(),e.d=r,e.e=Se(r,n),_?S(e,l.precision,l.rounding):e},d.toBinary=function(e,t){return Ie(this,2,e,t)},d.toDecimalPlaces=d.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(z(e,0,ie),t===void 0?t=i.rounding:z(t,0,8),S(n,e+n.e+1,t))},d.toExponential=function(e,t){var n,i=this,s=i.constructor;return e===void 0?n=ee(i,!0):(z(e,0,ie),t===void 0?t=s.rounding:z(t,0,8),i=S(new s(i),e+1,t),n=ee(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},d.toFixed=function(e,t){var n,i,s=this,r=s.constructor;return e===void 0?n=ee(s):(z(e,0,ie),t===void 0?t=r.rounding:z(t,0,8),i=S(new r(s),e+s.e+1,t),n=ee(i,!1,e+i.e+1)),s.isNeg()&&!s.isZero()?"-"+n:n},d.toFraction=function(e){var t,n,i,s,r,o,u,a,c,f,l,h,p=this,w=p.d,M=p.constructor;if(!w)return new M(p);if(c=n=new M(1),i=a=new M(0),t=new M(i),r=t.e=He(w)-p.e-1,o=r%k,t.d[0]=Y(10,o<0?k+o:o),e==null)e=r>0?t:c;else{if(u=new M(e),!u.isInt()||u.lt(c))throw Error(re+u);e=u.gt(t)?r>0?t:c:u}for(_=!1,u=new M(j(w)),f=M.precision,M.precision=r=w.length*k*2;l=P(u,t,0,1,1),s=n.plus(l.times(i)),s.cmp(e)!=1;)n=i,i=s,s=c,c=a.plus(l.times(s)),a=s,s=t,t=u.minus(l.times(s)),u=s;return s=P(e.minus(n),i,0,1,1),a=a.plus(s.times(c)),n=n.plus(s.times(i)),a.s=c.s=p.s,h=P(c,i,r,1).minus(p).abs().cmp(P(a,n,r,1).minus(p).abs())<1?[c,i]:[a,n],M.precision=f,_=!0,h},d.toHexadecimal=d.toHex=function(e,t){return Ie(this,16,e,t)},d.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:z(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(_=!1,n=P(n,e,0,t,1).times(e),_=!0,S(n)):(e.s=n.s,n=e),n},d.toNumber=function(){return+this},d.toOctal=function(e,t){return Ie(this,8,e,t)},d.toPower=d.pow=function(e){var t,n,i,s,r,o,u=this,a=u.constructor,c=+(e=new a(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new a(Y(+u,c));if(u=new a(u),u.eq(1))return u;if(i=a.precision,r=a.rounding,e.eq(1))return S(u,i,r);if(t=W(e.e/k),t>=e.d.length-1&&(n=c<0?-c:c)<=Dt)return s=Ye(a,u,n,i),e.s<0?new a(1).div(s):S(s,i,r);if(o=u.s,o<0){if(t<e.d.length-1)return new a(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return n=Y(+u,c),t=n==0||!isFinite(n)?W(c*(Math.log("0."+j(u.d))/Math.LN10+u.e+1)):new a(n+"").e,t>a.maxE+1||t<a.minE-1?new a(t>0?o/0:0):(_=!1,a.rounding=u.s=1,n=Math.min(12,(t+"").length),s=ye(e.times(oe(u,i+n)),i),s.d&&(s=S(s,i+5,1),de(s.d,i,r)&&(t=i+10,s=S(ye(e.times(oe(u,t+n)),t),t+5,1),+j(s.d).slice(i+1,i+15)+1==1e14&&(s=S(s,i+1,0)))),s.s=o,_=!0,a.rounding=r,S(s,i,r))},d.toPrecision=function(e,t){var n,i=this,s=i.constructor;return e===void 0?n=ee(i,i.e<=s.toExpNeg||i.e>=s.toExpPos):(z(e,1,ie),t===void 0?t=s.rounding:z(t,0,8),i=S(new s(i),e,t),n=ee(i,e<=i.e||i.e<=s.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},d.toSignificantDigits=d.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(z(e,1,ie),t===void 0?t=i.rounding:z(t,0,8)),S(new i(n),e,t)},d.toString=function(){var e=this,t=e.constructor,n=ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},d.truncated=d.trunc=function(){return S(new this.constructor(this),this.e+1,1)},d.valueOf=d.toJSON=function(){var e=this,t=e.constructor,n=ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function j(e){var t,n,i,s=e.length-1,r="",o=e[0];if(s>0){for(r+=o,t=1;t<s;t++)i=e[t]+"",n=k-i.length,n&&(r+=se(n)),r+=i;o=e[t],i=o+"",n=k-i.length,n&&(r+=se(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return r+o}function z(e,t,n){if(e!==~~e||e<t||e>n)throw Error(re+e)}function de(e,t,n,i){var s,r,o,u;for(r=e[0];r>=10;r/=10)--t;return--t<0?(t+=k,s=0):(s=Math.ceil((t+1)/k),t%=k),r=Y(10,k-t),u=e[s]%r|0,i==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):o=(n<4&&u+1==r||n>3&&u+1==r/2)&&(e[s+1]/r/100|0)==Y(10,t-2)-1||(u==r/2||u==0)&&(e[s+1]/r/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(i||n<4)&&u==9999||!i&&n>3&&u==4999):o=((i||n<4)&&u+1==r||!i&&n>3&&u+1==r/2)&&(e[s+1]/r/1e3|0)==Y(10,t-3)-1,o}function Ne(e,t,n){for(var i,s=[0],r,o=0,u=e.length;o<u;){for(r=s.length;r--;)s[r]*=t;for(s[0]+=_e.indexOf(e.charAt(o++)),i=0;i<s.length;i++)s[i]>n-1&&(s[i+1]===void 0&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}function kt(e,t){var n,i,s;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),s=(1/Ee(4,n)).toString()):(n=16,s="2.3283064365386962890625e-10"),e.precision+=n,t=le(e,1,t.times(s),new e(1));for(var r=n;r--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var P=function(){function e(i,s,r){var o,u=0,a=i.length;for(i=i.slice();a--;)o=i[a]*s+u,i[a]=o%r|0,u=o/r|0;return u&&i.unshift(u),i}function t(i,s,r,o){var u,a;if(r!=o)a=r>o?1:-1;else for(u=a=0;u<r;u++)if(i[u]!=s[u]){a=i[u]>s[u]?1:-1;break}return a}function n(i,s,r,o){for(var u=0;r--;)i[r]-=u,u=i[r]<s[r]?1:0,i[r]=u*o+i[r]-s[r];for(;!i[0]&&i.length>1;)i.shift()}return function(i,s,r,o,u,a){var c,f,l,h,p,w,M,F,A,H,O,q,x,T,E,v,L,y,b,R,U=i.constructor,N=i.s==s.s?1:-1,g=i.d,m=s.d;if(!g||!g[0]||!m||!m[0])return new U(!i.s||!s.s||(g?m&&g[0]==m[0]:!m)?NaN:g&&g[0]==0||!m?N*0:N/0);for(a?(p=1,f=i.e-s.e):(a=K,p=k,f=W(i.e/p)-W(s.e/p)),b=m.length,L=g.length,A=new U(N),H=A.d=[],l=0;m[l]==(g[l]||0);l++);if(m[l]>(g[l]||0)&&f--,r==null?(T=r=U.precision,o=U.rounding):u?T=r+(i.e-s.e)+1:T=r,T<0)H.push(1),w=!0;else{if(T=T/p+2|0,l=0,b==1){for(h=0,m=m[0],T++;(l<L||h)&&T--;l++)E=h*a+(g[l]||0),H[l]=E/m|0,h=E%m|0;w=h||l<L}else{for(h=a/(m[0]+1)|0,h>1&&(m=e(m,h,a),g=e(g,h,a),b=m.length,L=g.length),v=b,O=g.slice(0,b),q=O.length;q<b;)O[q++]=0;R=m.slice(),R.unshift(0),y=m[0],m[1]>=a/2&&++y;do h=0,c=t(m,O,b,q),c<0?(x=O[0],b!=q&&(x=x*a+(O[1]||0)),h=x/y|0,h>1?(h>=a&&(h=a-1),M=e(m,h,a),F=M.length,q=O.length,c=t(M,O,F,q),c==1&&(h--,n(M,b<F?R:m,F,a))):(h==0&&(c=h=1),M=m.slice()),F=M.length,F<q&&M.unshift(0),n(O,M,q,a),c==-1&&(q=O.length,c=t(m,O,b,q),c<1&&(h++,n(O,b<q?R:m,q,a))),q=O.length):c===0&&(h++,O=[0]),H[l++]=h,c&&O[0]?O[q++]=g[v]||0:(O=[g[v]],q=1);while((v++<L||O[0]!==void 0)&&T--);w=O[0]!==void 0}H[0]||H.shift()}if(p==1)A.e=f,Je=w;else{for(l=1,h=H[0];h>=10;h/=10)l++;A.e=l+f*p-1,S(A,u?r+A.e+1:r,o,w)}return A}}();function S(e,t,n,i){var s,r,o,u,a,c,f,l,h,p=e.constructor;e:if(t!=null){if(l=e.d,!l)return e;for(s=1,u=l[0];u>=10;u/=10)s++;if(r=t-s,r<0)r+=k,o=t,f=l[h=0],a=f/Y(10,s-o-1)%10|0;else if(h=Math.ceil((r+1)/k),u=l.length,h>=u)if(i){for(;u++<=h;)l.push(0);f=a=0,s=1,r%=k,o=r-k+1}else break e;else{for(f=u=l[h],s=1;u>=10;u/=10)s++;r%=k,o=r-k+s,a=o<0?0:f/Y(10,s-o-1)%10|0}if(i=i||t<0||l[h+1]!==void 0||(o<0?f:f%Y(10,s-o-1)),c=n<4?(a||i)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||i||n==6&&(r>0?o>0?f/Y(10,s-o):0:l[h-1])%10&1||n==(e.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=e.e+1,l[0]=Y(10,(k-t%k)%k),e.e=-t||0):l[0]=e.e=0,e;if(r==0?(l.length=h,u=1,h--):(l.length=h+1,u=Y(10,k-r),l[h]=o>0?(f/Y(10,s-o)%Y(10,o)|0)*u:0),c)for(;;)if(h==0){for(r=1,o=l[0];o>=10;o/=10)r++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;r!=u&&(e.e++,l[0]==K&&(l[0]=1));break}else{if(l[h]+=u,l[h]!=K)break;l[h--]=0,u=1}for(r=l.length;l[--r]===0;)l.pop()}return _&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function ee(e,t,n){if(!e.isFinite())return We(e);var i,s=e.e,r=j(e.d),o=r.length;return t?(n&&(i=n-o)>0?r=r.charAt(0)+"."+r.slice(1)+se(i):o>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(e.e<0?"e":"e+")+e.e):s<0?(r="0."+se(-s-1)+r,n&&(i=n-o)>0&&(r+=se(i))):s>=o?(r+=se(s+1-o),n&&(i=n-s-1)>0&&(r=r+"."+se(i))):((i=s+1)<o&&(r=r.slice(0,i)+"."+r.slice(i)),n&&(i=n-o)>0&&(s+1===o&&(r+="."),r+=se(i))),r}function Se(e,t){var n=e[0];for(t*=k;n>=10;n/=10)t++;return t}function De(e,t,n){if(t>Et)throw _=!0,n&&(e.precision=n),Error(Re);return S(new e($e),t,1,!0)}function Q(e,t,n){if(t>Te)throw Error(Re);return S(new e(Me),t,n,!0)}function He(e){var t=e.length-1,n=t*k+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function se(e){for(var t="";e--;)t+="0";return t}function Ye(e,t,n,i){var s,r=new e(1),o=Math.ceil(i/k+4);for(_=!1;;){if(n%2&&(r=r.times(t),ze(r.d,o)&&(s=!0)),n=W(n/2),n===0){n=r.d.length-1,s&&r.d[n]===0&&++r.d[n];break}t=t.times(t),ze(t.d,o)}return _=!0,r}function Ze(e){return e.d[e.d.length-1]&1}function je(e,t,n){for(var i,s=new e(t[0]),r=0;++r<t.length;)if(i=new e(t[r]),i.s)s[n](i)&&(s=i);else{s=i;break}return s}function ye(e,t){var n,i,s,r,o,u,a,c=0,f=0,l=0,h=e.constructor,p=h.rounding,w=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(_=!1,a=w):a=t,u=new h(.03125);e.e>-2;)e=e.times(u),l+=5;for(i=Math.log(Y(2,l))/Math.LN10*2+5|0,a+=i,n=r=o=new h(1),h.precision=a;;){if(r=S(r.times(e),a,1),n=n.times(++f),u=o.plus(P(r,n,a,1)),j(u.d).slice(0,a)===j(o.d).slice(0,a)){for(s=l;s--;)o=S(o.times(o),a,1);if(t==null)if(c<3&&de(o.d,a-i,p,c))h.precision=a+=10,n=r=u=new h(1),f=0,c++;else return S(o,h.precision=w,p,_=!0);else return h.precision=w,o}o=u}}function oe(e,t){var n,i,s,r,o,u,a,c,f,l,h,p=1,w=10,M=e,F=M.d,A=M.constructor,H=A.rounding,O=A.precision;if(M.s<0||!F||!F[0]||!M.e&&F[0]==1&&F.length==1)return new A(F&&!F[0]?-1/0:M.s!=1?NaN:F?0:M);if(t==null?(_=!1,f=O):f=t,A.precision=f+=w,n=j(F),i=n.charAt(0),Math.abs(r=M.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)M=M.times(e),n=j(M.d),i=n.charAt(0),p++;r=M.e,i>1?(M=new A("0."+n),r++):M=new A(i+"."+n.slice(1))}else return c=De(A,f+2,O).times(r+""),M=oe(new A(i+"."+n.slice(1)),f-w).plus(c),A.precision=O,t==null?S(M,O,H,_=!0):M;for(l=M,a=o=M=P(M.minus(1),M.plus(1),f,1),h=S(M.times(M),f,1),s=3;;){if(o=S(o.times(h),f,1),c=a.plus(P(o,new A(s),f,1)),j(c.d).slice(0,f)===j(a.d).slice(0,f))if(a=a.times(2),r!==0&&(a=a.plus(De(A,f+2,O).times(r+""))),a=P(a,new A(p),f,1),t==null)if(de(a.d,f-w,H,u))A.precision=f+=w,c=o=M=P(l.minus(1),l.plus(1),f,1),h=S(M.times(M),f,1),s=u=1;else return S(a,A.precision=O,H,_=!0);else return A.precision=O,a;a=c,s+=2}}function We(e){return String(e.s*e.s/0)}function Ce(e,t){var n,i,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(s=t.length;t.charCodeAt(s-1)===48;--s);if(t=t.slice(i,s),t){if(s-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%k,n<0&&(i+=k),i<s){for(i&&e.d.push(+t.slice(0,i)),s-=k;i<s;)e.d.push(+t.slice(i,i+=k));t=t.slice(i),i=k-t.length}else i-=s;for(;i--;)t+="0";e.d.push(+t),_&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function _t(e,t){var n,i,s,r,o,u,a,c,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Be.test(t))return Ce(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Nt.test(t))n=16,t=t.toLowerCase();else if(bt.test(t))n=2;else if(St.test(t))n=8;else throw Error(re+t);for(r=t.search(/p/i),r>0?(a=+t.slice(r+1),t=t.substring(2,r)):t=t.slice(2),r=t.indexOf("."),o=r>=0,i=e.constructor,o&&(t=t.replace(".",""),u=t.length,r=u-r,s=Ye(i,new i(n),r,r*2)),c=Ne(t,n,K),f=c.length-1,r=f;c[r]===0;--r)c.pop();return r<0?new i(e.s*0):(e.e=Se(c,f),e.d=c,_=!1,o&&(e=P(e,s,u*4)),a&&(e=e.times(Math.abs(a)<54?Y(2,a):ne.pow(2,a))),_=!0,e)}function Ot(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:le(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/Ee(5,n)),t=le(e,2,t,t);for(var s,r=new e(5),o=new e(16),u=new e(20);n--;)s=t.times(t),t=t.times(r.plus(s.times(o.times(s).minus(u))));return t}function le(e,t,n,i,s){var r,o,u,a,c=e.precision,f=Math.ceil(c/k);for(_=!1,a=n.times(n),u=new e(i);;){if(o=P(u.times(a),new e(t++*t++),c,1),u=s?i.plus(o):i.minus(o),i=P(o.times(a),new e(t++*t++),c,1),o=u.plus(i),o.d[f]!==void 0){for(r=f;o.d[r]===u.d[r]&&r--;);if(r==-1)break}r=u,u=i,i=o,o=r}return _=!0,o.d.length=f+1,o}function Ee(e,t){for(var n=e;--t;)n*=e;return n}function Ve(e,t){var n,i=t.s<0,s=Q(e,e.precision,1),r=s.times(.5);if(t=t.abs(),t.lte(r))return te=i?4:1,t;if(n=t.divToInt(s),n.isZero())te=i?3:2;else{if(t=t.minus(n.times(s)),t.lte(r))return te=Ze(n)?i?2:3:i?4:1,t;te=Ze(n)?i?1:4:i?3:2}return t.minus(s).abs()}function Ie(e,t,n,i){var s,r,o,u,a,c,f,l,h,p=e.constructor,w=n!==void 0;if(w?(z(n,1,ie),i===void 0?i=p.rounding:z(i,0,8)):(n=p.precision,i=p.rounding),!e.isFinite())f=We(e);else{for(f=ee(e),o=f.indexOf("."),w?(s=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):s=t,o>=0&&(f=f.replace(".",""),h=new p(1),h.e=f.length-o,h.d=Ne(ee(h),10,s),h.e=h.d.length),l=Ne(f,10,s),r=a=l.length;l[--a]==0;)l.pop();if(!l[0])f=w?"0p+0":"0";else{if(o<0?r--:(e=new p(e),e.d=l,e.e=r,e=P(e,h,n,i,0,s),l=e.d,r=e.e,c=Je),o=l[n],u=s/2,c=c||l[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>u||o===u&&(i===4||c||i===6&&l[n-1]&1||i===(e.s<0?8:7)),l.length=n,c)for(;++l[--n]>s-1;)l[n]=0,n||(++r,l.unshift(1));for(a=l.length;!l[a-1];--a);for(o=0,f="";o<a;o++)f+=_e.charAt(l[o]);if(w){if(a>1)if(t==16||t==8){for(o=t==16?4:3,--a;a%o;a++)f+="0";for(l=Ne(f,s,t),a=l.length;!l[a-1];--a);for(o=1,f="1.";o<a;o++)f+=_e.charAt(l[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)f="0"+f;f="0."+f}else if(++r>a)for(r-=a;r--;)f+="0";else r<a&&(f=f.slice(0,r)+"."+f.slice(r))}f=(t==16?"0x":t==2?"0b":t==8?"0o":"")+f}return e.s<0?"-"+f:f}function ze(e,t){if(e.length>t)return e.length=t,!0}function Tt(e){return new this(e).abs()}function yt(e){return new this(e).acos()}function Ct(e){return new this(e).acosh()}function It(e,t){return new this(e).plus(t)}function At(e){return new this(e).asin()}function Lt(e){return new this(e).asinh()}function Ft(e){return new this(e).atan()}function Pt(e){return new this(e).atanh()}function Jt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,s=this.rounding,r=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Q(this,r,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Q(this,i,s):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Q(this,r,1).times(.5),n.s=e.s):t.s<0?(this.precision=r,this.rounding=1,n=this.atan(P(e,t,r,1)),t=Q(this,r,1),this.precision=i,this.rounding=s,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(P(e,t,r,1)),n}function Rt(e){return new this(e).cbrt()}function qt(e){return S(e=new this(e),e.e+1,2)}function Ut(e,t,n){return new this(e).clamp(t,n)}function Bt(e){if(!e||typeof e!="object")throw Error(be+"Object expected");var t,n,i,s=e.defaults===!0,r=["precision",1,ie,"rounding",0,8,"toExpNeg",-fe,0,"toExpPos",0,fe,"maxE",0,fe,"minE",-fe,0,"modulo",0,9];for(t=0;t<r.length;t+=3)if(n=r[t],s&&(this[n]=Oe[n]),(i=e[n])!==void 0)if(W(i)===i&&i>=r[t+1]&&i<=r[t+2])this[n]=i;else throw Error(re+n+": "+i);if(n="crypto",s&&(this[n]=Oe[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(qe);else this[n]=!1;else throw Error(re+n+": "+i);return this}function Ht(e){return new this(e).cos()}function Yt(e){return new this(e).cosh()}function Ge(e){var t,n,i;function s(r){var o,u,a,c=this;if(!(c instanceof s))return new s(r);if(c.constructor=s,xe(r)){c.s=r.s,_?!r.d||r.e>s.maxE?(c.e=NaN,c.d=null):r.e<s.minE?(c.e=0,c.d=[0]):(c.e=r.e,c.d=r.d.slice()):(c.e=r.e,c.d=r.d?r.d.slice():r.d);return}if(a=typeof r,a==="number"){if(r===0){c.s=1/r<0?-1:1,c.e=0,c.d=[0];return}if(r<0?(r=-r,c.s=-1):c.s=1,r===~~r&&r<1e7){for(o=0,u=r;u>=10;u/=10)o++;_?o>s.maxE?(c.e=NaN,c.d=null):o<s.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[r]):(c.e=o,c.d=[r]);return}else if(r*0!==0){r||(c.s=NaN),c.e=NaN,c.d=null;return}return Ce(c,r.toString())}else if(a!=="string")throw Error(re+r);return(u=r.charCodeAt(0))===45?(r=r.slice(1),c.s=-1):(u===43&&(r=r.slice(1)),c.s=1),Be.test(r)?Ce(c,r):_t(c,r)}if(s.prototype=d,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=Bt,s.clone=Ge,s.isDecimal=xe,s.abs=Tt,s.acos=yt,s.acosh=Ct,s.add=It,s.asin=At,s.asinh=Lt,s.atan=Ft,s.atanh=Pt,s.atan2=Jt,s.cbrt=Rt,s.ceil=qt,s.clamp=Ut,s.cos=Ht,s.cosh=Yt,s.div=Zt,s.exp=jt,s.floor=Wt,s.hypot=Vt,s.ln=zt,s.log=Gt,s.log10=Xt,s.log2=xt,s.max=Kt,s.min=Qt,s.mod=en,s.mul=tn,s.pow=nn,s.random=rn,s.round=sn,s.sign=on,s.sin=un,s.sinh=cn,s.sqrt=an,s.sub=fn,s.sum=ln,s.tan=hn,s.tanh=dn,s.trunc=mn,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return s.config(e),s}function Zt(e,t){return new this(e).div(t)}function jt(e){return new this(e).exp()}function Wt(e){return S(e=new this(e),e.e+1,3)}function Vt(){var e,t,n=new this(0);for(_=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return _=!0,new this(1/0);n=t}return _=!0,n.sqrt()}function xe(e){return e instanceof ne||e&&e.toStringTag===Ue||!1}function zt(e){return new this(e).ln()}function Gt(e,t){return new this(e).log(t)}function xt(e){return new this(e).log(2)}function Xt(e){return new this(e).log(10)}function Kt(){return je(this,arguments,"lt")}function Qt(){return je(this,arguments,"gt")}function en(e,t){return new this(e).mod(t)}function tn(e,t){return new this(e).mul(t)}function nn(e,t){return new this(e).pow(t)}function rn(e){var t,n,i,s,r=0,o=new this(1),u=[];if(e===void 0?e=this.precision:z(e,1,ie),i=Math.ceil(e/k),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));r<i;)s=t[r],s>=429e7?t[r]=crypto.getRandomValues(new Uint32Array(1))[0]:u[r++]=s%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);r<i;)s=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+((t[r+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(t,r):(u.push(s%1e7),r+=4);r=i/4}else throw Error(qe);else for(;r<i;)u[r++]=Math.random()*1e7|0;for(i=u[--r],e%=k,i&&e&&(s=Y(10,k-e),u[r]=(i/s|0)*s);u[r]===0;r--)u.pop();if(r<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=k)u.shift();for(i=1,s=u[0];s>=10;s/=10)i++;i<k&&(n-=k-i)}return o.e=n,o.d=u,o}function sn(e){return S(e=new this(e),e.e+1,this.rounding)}function on(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function un(e){return new this(e).sin()}function cn(e){return new this(e).sinh()}function an(e){return new this(e).sqrt()}function fn(e,t){return new this(e).sub(t)}function ln(){var e=0,t=arguments,n=new this(t[e]);for(_=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return _=!0,S(n,this.precision,this.rounding)}function hn(e){return new this(e).tan()}function dn(e){return new this(e).tanh()}function mn(e){return S(e=new this(e),e.e+1,1)}d[Symbol.for("nodejs.util.inspect.custom")]=d.toString,d[Symbol.toStringTag]="Decimal";var ne=d.constructor=Ge(Oe);$e=new ne($e),Me=new ne(Me);const pn=(e,t,n=2)=>{const i=new ne(e),s=Object.entries(t).sort(([,r],[,o])=>o-r);for(const[r,o]of s){const u=new ne(o);if(i.greaterThanOrEqualTo(u)){const a=i.dividedBy(u).toFixed(n);return[a,r,a+r]}}return[i.toFixed(n),""]},gn=(e,t=2)=>{e=e.replace(/\s+/g,"");const n={"+":1,"-":1,"*":2,"/":2},i=u=>new ne(u),s=u=>["+","-","*","/"].includes(u),r=u=>/[0-9.]/.test(u),o=u=>{const a=[],c=[];let f=0;for(;f<u.length;){const h=u[f];if(r(h)){let p="";for(;f<u.length&&r(u[f]);)p+=u[f],f++;a.push(i(p))}else if(h==="(")c.push(h),f++;else if(h===")"){for(;c.length>0&&c[c.length-1]!=="(";)a.push(c.pop());c.pop(),f++}else if(s(h)){for(;c.length>0&&n[c[c.length-1]]>=n[h];)a.push(c.pop());c.push(h),f++}else throw new Error(`无效字符: ${h}`)}for(;c.length>0;)a.push(c.pop());const l=[];for(let h of a)if(typeof h=="string"){const p=l.pop(),w=l.pop();switch(h){case"+":l.push(w.add(p));break;case"-":l.push(w.sub(p));break;case"*":l.push(w.mul(p));break;case"/":if(p.eq(0))throw new Error("除数不能为零");l.push(w.div(p));break}}else l.push(h);return l.pop()};try{const u=o(e);return Number(u.toFixed(t))}catch(u){throw new Error("表达式计算失败:"+u.message)}},wn=(e,t)=>{if(t==="rad")return e*(Math.PI/180);if(t==="deg")return e*(180/Math.PI);throw new Error("请使用正确类型")},vn=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;let r=Math.atan2(i,n)*(180/Math.PI);return r=-r+90,r<0&&(r+=360),r},$n=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},Mn=(e,t,n,i=2)=>{const r={"+":(o,u)=>o.add(u),"-":(o,u)=>o.sub(u),"*":(o,u)=>o.mul(u),"/":(o,u)=>{if(u.eq(0))throw new Error("除数不能为0");return o.div(u)}}[n](new ne(e),new ne(t));return Number(r.toFixed(i))},bn=(e,t)=>t.reduce((n,i)=>{const{key:s,verify:r,msg:o,name:u}=i,a=e[s];return a===""||a===void 0||a===null?n.push({key:s,msg:"必填项",name:u}):(typeof r=="function"?!r(a):!r.test(a))&&n.push({key:s,msg:o,name:u}),n},[]),Nn=({promiseFn:e,maxRetries:t=3,retryDelay:n=2e3,params:i=void 0})=>new Promise((s,r)=>{let o=0;const u=()=>{e(i).then(a=>{s(a)}).catch(a=>{if(o++,o>=t){r(a);return}setTimeout(u,n)})};u()}),Sn=e=>Math.random()*100<e,Dn=(e,t,n=0)=>parseFloat((Math.random()*(t-e)+e).toFixed(n)),En=(e=1)=>{const t=Math.floor(Math.random()*256),n=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return`rgba(${t}, ${n}, ${i}, ${e})`},kn=(e,t,n)=>{const i=Array.from({length:t-e+1},(s,r)=>r+e);for(let s=i.length-1;s>0;s--){const r=Math.floor(Math.random()*(s+1));[i[s],i[r]]=[i[r],i[s]]}return i.slice(0,n)},_n=(e,t)=>{const n=ve(e).startOf(t),i=ve().startOf(t);return n.isSame(i)?0:n.isBefore(i)?1:-1},On=e=>{const t=[{unit:"年",milliseconds:31536e6},{unit:"月",milliseconds:2592e6},{unit:"周",milliseconds:6048e5},{unit:"天",milliseconds:864e5},{unit:"小时",milliseconds:36e5},{unit:"分钟",milliseconds:6e4}],i=Date.now()-e;for(const{unit:s,milliseconds:r}of t)if(i>=r)return`${Math.floor(i/r)} ${s}前`;return"刚刚"},Tn=(e={})=>{const{midnight:t="午夜好",morning:n="早上好",forenoon:i="上午好",noon:s="中午好",afternoon:r="下午好",evening:o="晚上好"}=e,u=new Date().getHours();return u<4?t:u<10?n:u<12?i:u<14?s:u<18?r:o};class yn{constructor(t,n){this._isDown=!1,this._currentIndex=0,this._numsLength=0,this._onChange=n,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}const Cn=Object.freeze(Object.defineProperty({__proto__:null,Base:{libJsGetDataType:ge,libJsPromiseTimeout:Xe},Browser:{libJsColorConsole:Ke,libJsIsMobile:Qe,libJsIsPad:et,libJsPathParams:tt,libJsSetTitleIcon:nt,libJsTagTitleTip:it,libJsObjToUrlParams:rt},Data:{libJsChunkArray:st,libJsDeepJSONParse:we,libJsGroupArrayByKey:ot,libJsMatchEmail:ut,libJsShuffleArray:ct,libJsStepArray:at,libReverseArrayFromIndex:ft},File:{libJsDownloadImageLink:lt,libJsImageOptimizer:ht,libJsSaveJson:dt},Formatter:{libJsFormatterByte:vt,libJsMaskPhoneNumber:$t,libJsNumComma:Mt,libJsNumberUnit:pn,libJsSecondsFormatterChinese:wt},Math:{libJsCalculateExpression:gn,libJsConvertAngle:wn,libJsCoordsAngle:vn,libJsCoordsDistance:$n,libJsDecimal:Mn},Misc:{libJsRegFormValidate:bn,libJsRetryRequest:Nn,libNumerStepper:yn},Random:{libJsProbabilityResult:Sn,libJsRandom:Dn,libJsRandomColor:En,libJsUniqueRandomNumbers:kn},Time:{libJsSameTimeCheck:_n,libJsTimeAgo:On,libJsTimeGreeting:Tn}},Symbol.toStringTag,{value:"Module"}));window.LibJs=Cn});
8
+ */var fe=9e15,ie=1e9,_e="0123456789abcdef",$e="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Me="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Oe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-fe,maxE:fe,crypto:!1},Je,te,_=!0,be="[DecimalError] ",re=be+"Invalid argument: ",Re=be+"Precision limit exceeded",qe=be+"crypto unavailable",Ue="[object Decimal]",W=Math.floor,Y=Math.pow,bt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Nt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,St=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Be=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,K=1e7,k=7,Dt=9007199254740991,Et=$e.length-1,Te=Me.length-1,d={toStringTag:Ue};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),S(e)},d.ceil=function(){return S(new this.constructor(this),this.e+1,2)},d.clampedTo=d.clamp=function(e,t){var n,i=this,s=i.constructor;if(e=new s(e),t=new s(t),!e.s||!t.s)return new s(NaN);if(e.gt(t))throw Error(re+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new s(i)},d.comparedTo=d.cmp=function(e){var t,n,i,s,r=this,o=r.d,u=(e=new r.constructor(e)).d,a=r.s,c=e.s;if(!o||!u)return!a||!c?NaN:a!==c?a:o===u?0:!o^a<0?1:-1;if(!o[0]||!u[0])return o[0]?a:u[0]?-c:0;if(a!==c)return a;if(r.e!==e.e)return r.e>e.e^a<0?1:-1;for(i=o.length,s=u.length,t=0,n=i<s?i:s;t<n;++t)if(o[t]!==u[t])return o[t]>u[t]^a<0?1:-1;return i===s?0:i>s^a<0?1:-1},d.cosine=d.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+k,i.rounding=1,n=kt(i,Ve(i,n)),i.precision=e,i.rounding=t,S(te==2||te==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},d.cubeRoot=d.cbrt=function(){var e,t,n,i,s,r,o,u,a,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(_=!1,r=f.s*Y(f.s*f,1/3),!r||Math.abs(r)==1/0?(n=j(f.d),e=f.e,(r=(e-n.length+1)%3)&&(n+=r==1||r==-2?"0":"00"),r=Y(n,1/3),e=W((e+1)/3)-(e%3==(e<0?-1:2)),r==1/0?n="5e"+e:(n=r.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new l(n),i.s=f.s):i=new l(r.toString()),o=(e=l.precision)+3;;)if(u=i,a=u.times(u).times(u),c=a.plus(f),i=P(c.plus(f).times(u),c.plus(a),o+2,1),j(u.d).slice(0,o)===(n=j(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!s&&n=="4999"){if(!s&&(S(u,e+1,0),u.times(u).times(u).eq(f))){i=u;break}o+=4,s=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(S(i,e+1,1),t=!i.times(i).times(i).eq(f));break}return _=!0,S(i,e,l.rounding,t)},d.decimalPlaces=d.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-W(this.e/k))*k,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},d.dividedBy=d.div=function(e){return P(this,new this.constructor(e))},d.dividedToIntegerBy=d.divToInt=function(e){var t=this,n=t.constructor;return S(P(t,new n(e),0,1,1),n.precision,n.rounding)},d.equals=d.eq=function(e){return this.cmp(e)===0},d.floor=function(){return S(new this.constructor(this),this.e+1,3)},d.greaterThan=d.gt=function(e){return this.cmp(e)>0},d.greaterThanOrEqualTo=d.gte=function(e){var t=this.cmp(e);return t==1||t===0},d.hyperbolicCosine=d.cosh=function(){var e,t,n,i,s,r=this,o=r.constructor,u=new o(1);if(!r.isFinite())return new o(r.s?1/0:NaN);if(r.isZero())return u;n=o.precision,i=o.rounding,o.precision=n+Math.max(r.e,r.sd())+4,o.rounding=1,s=r.d.length,s<32?(e=Math.ceil(s/3),t=(1/Ee(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),r=le(o,1,r.times(t),new o(1),!0);for(var a,c=e,f=new o(8);c--;)a=r.times(r),r=u.minus(a.times(f.minus(a.times(f))));return S(r,o.precision=n,o.rounding=i,!0)},d.hyperbolicSine=d.sinh=function(){var e,t,n,i,s=this,r=s.constructor;if(!s.isFinite()||s.isZero())return new r(s);if(t=r.precision,n=r.rounding,r.precision=t+Math.max(s.e,s.sd())+4,r.rounding=1,i=s.d.length,i<3)s=le(r,2,s,s,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,s=s.times(1/Ee(5,e)),s=le(r,2,s,s,!0);for(var o,u=new r(5),a=new r(16),c=new r(20);e--;)o=s.times(s),s=s.times(u.plus(o.times(a.times(o).plus(c))))}return r.precision=t,r.rounding=n,S(s,t,n,!0)},d.hyperbolicTangent=d.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,P(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},d.inverseCosine=d.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),s=n.precision,r=n.rounding;return i!==-1?i===0?t.isNeg()?Q(n,s,r):new n(0):new n(NaN):t.isZero()?Q(n,s+4,r).times(.5):(n.precision=s+6,n.rounding=1,t=t.asin(),e=Q(n,s+4,r).times(.5),n.precision=s,n.rounding=r,e.minus(t))},d.inverseHyperbolicCosine=d.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,_=!1,n=n.times(n).minus(1).sqrt().plus(n),_=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},d.inverseHyperbolicSine=d.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,_=!1,n=n.times(n).plus(1).sqrt().plus(n),_=!0,i.precision=e,i.rounding=t,n.ln())},d.inverseHyperbolicTangent=d.atanh=function(){var e,t,n,i,s=this,r=s.constructor;return s.isFinite()?s.e>=0?new r(s.abs().eq(1)?s.s/0:s.isZero()?s:NaN):(e=r.precision,t=r.rounding,i=s.sd(),Math.max(i,e)<2*-s.e-1?S(new r(s),e,t,!0):(r.precision=n=i-s.e,s=P(s.plus(1),new r(1).minus(s),n+e,1),r.precision=e+4,r.rounding=1,s=s.ln(),r.precision=e,r.rounding=t,s.times(.5))):new r(NaN)},d.inverseSine=d.asin=function(){var e,t,n,i,s=this,r=s.constructor;return s.isZero()?new r(s):(t=s.abs().cmp(1),n=r.precision,i=r.rounding,t!==-1?t===0?(e=Q(r,n+4,i).times(.5),e.s=s.s,e):new r(NaN):(r.precision=n+6,r.rounding=1,s=s.div(new r(1).minus(s.times(s)).sqrt().plus(1)).atan(),r.precision=n,r.rounding=i,s.times(2)))},d.inverseTangent=d.atan=function(){var e,t,n,i,s,r,o,u,a,c=this,f=c.constructor,l=f.precision,h=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=Te)return o=Q(f,l+4,h).times(.25),o.s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=Te)return o=Q(f,l+4,h).times(.5),o.s=c.s,o}for(f.precision=u=l+10,f.rounding=1,n=Math.min(28,u/k+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(_=!1,t=Math.ceil(u/k),i=1,a=c.times(c),o=new f(c),s=c;e!==-1;)if(s=s.times(a),r=o.minus(s.div(i+=2)),s=s.times(a),o=r.plus(s.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===r.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),_=!0,S(o,f.precision=l,f.rounding=h,!0)},d.isFinite=function(){return!!this.d},d.isInteger=d.isInt=function(){return!!this.d&&W(this.e/k)>this.d.length-2},d.isNaN=function(){return!this.s},d.isNegative=d.isNeg=function(){return this.s<0},d.isPositive=d.isPos=function(){return this.s>0},d.isZero=function(){return!!this.d&&this.d[0]===0},d.lessThan=d.lt=function(e){return this.cmp(e)<0},d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1},d.logarithm=d.log=function(e){var t,n,i,s,r,o,u,a,c=this,f=c.constructor,l=f.precision,h=f.rounding,p=5;if(e==null)e=new f(10),t=!0;else{if(e=new f(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new f(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)r=!0;else{for(s=n[0];s%10===0;)s/=10;r=s!==1}if(_=!1,u=l+p,o=oe(c,u),i=t?De(f,u+10):oe(e,u),a=P(o,i,u,1),de(a.d,s=l,h))do if(u+=10,o=oe(c,u),i=t?De(f,u+10):oe(e,u),a=P(o,i,u,1),!r){+j(a.d).slice(s+1,s+15)+1==1e14&&(a=S(a,l+1,0));break}while(de(a.d,s+=10,h));return _=!0,S(a,l,h)},d.minus=d.sub=function(e){var t,n,i,s,r,o,u,a,c,f,l,h,p=this,w=p.constructor;if(e=new w(e),!p.d||!e.d)return!p.s||!e.s?e=new w(NaN):p.d?e.s=-e.s:e=new w(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(c=p.d,h=e.d,u=w.precision,a=w.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else if(c[0])e=new w(p);else return new w(a===3?-0:0);return _?S(e,u,a):e}if(n=W(e.e/k),f=W(p.e/k),c=c.slice(),r=f-n,r){for(l=r<0,l?(t=c,r=-r,o=h.length):(t=h,n=f,o=c.length),i=Math.max(Math.ceil(u/k),o)+2,r>i&&(r=i,t.length=1),t.reverse(),i=r;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=h.length,l=i<o,l&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){l=c[i]<h[i];break}r=0}for(l&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>r;){if(c[--i]<h[i]){for(s=i;s&&c[--s]===0;)c[s]=K-1;--c[s],c[i]+=K}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=Se(c,n),_?S(e,u,a):e):new w(a===3?-0:0)},d.modulo=d.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?S(new i(n),i.precision,i.rounding):(_=!1,i.modulo==9?(t=P(n,e.abs(),0,3,1),t.s*=e.s):t=P(n,e,0,i.modulo,1),t=t.times(e),_=!0,n.minus(t))},d.naturalExponential=d.exp=function(){return ye(this)},d.naturalLogarithm=d.ln=function(){return oe(this)},d.negated=d.neg=function(){var e=new this.constructor(this);return e.s=-e.s,S(e)},d.plus=d.add=function(e){var t,n,i,s,r,o,u,a,c,f,l=this,h=l.constructor;if(e=new h(e),!l.d||!e.d)return!l.s||!e.s?e=new h(NaN):l.d||(e=new h(e.d||l.s===e.s?l:NaN)),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,u=h.precision,a=h.rounding,!c[0]||!f[0])return f[0]||(e=new h(l)),_?S(e,u,a):e;if(r=W(l.e/k),i=W(e.e/k),c=c.slice(),s=r-i,s){for(s<0?(n=c,s=-s,o=f.length):(n=f,i=r,o=c.length),r=Math.ceil(u/k),o=r>o?r+1:o+1,s>o&&(s=o,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(o=c.length,s=f.length,o-s<0&&(s=o,n=f,f=c,c=n),t=0;s;)t=(c[--s]=c[s]+f[s]+t)/K|0,c[s]%=K;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=Se(c,i),_?S(e,u,a):e},d.precision=d.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(re+e);return n.d?(t=He(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},d.round=function(){var e=this,t=e.constructor;return S(new t(e),e.e+1,t.rounding)},d.sine=d.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+k,i.rounding=1,n=Ot(i,Ve(i,n)),i.precision=e,i.rounding=t,S(te>2?n.neg():n,e,t,!0)):new i(NaN)},d.squareRoot=d.sqrt=function(){var e,t,n,i,s,r,o=this,u=o.d,a=o.e,c=o.s,f=o.constructor;if(c!==1||!u||!u[0])return new f(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);for(_=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=j(u),(t.length+a)%2==0&&(t+="0"),c=Math.sqrt(t),a=W((a+1)/2)-(a<0||a%2),c==1/0?t="5e"+a:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+a),i=new f(t)):i=new f(c.toString()),n=(a=f.precision)+3;;)if(r=i,i=r.plus(P(o,r,n+2,1)).times(.5),j(r.d).slice(0,n)===(t=j(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!s&&t=="4999"){if(!s&&(S(r,a+1,0),r.times(r).eq(o))){i=r;break}n+=4,s=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(S(i,a+1,1),e=!i.times(i).eq(o));break}return _=!0,S(i,a,f.rounding,e)},d.tangent=d.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=P(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,S(te==2||te==4?n.neg():n,e,t,!0)):new i(NaN)},d.times=d.mul=function(e){var t,n,i,s,r,o,u,a,c,f=this,l=f.constructor,h=f.d,p=(e=new l(e)).d;if(e.s*=f.s,!h||!h[0]||!p||!p[0])return new l(!e.s||h&&!h[0]&&!p||p&&!p[0]&&!h?NaN:!h||!p?e.s/0:e.s*0);for(n=W(f.e/k)+W(e.e/k),a=h.length,c=p.length,a<c&&(r=h,h=p,p=r,o=a,a=c,c=o),r=[],o=a+c,i=o;i--;)r.push(0);for(i=c;--i>=0;){for(t=0,s=a+i;s>i;)u=r[s]+p[i]*h[s-i-1]+t,r[s--]=u%K|0,t=u/K|0;r[s]=(r[s]+t)%K|0}for(;!r[--o];)r.pop();return t?++n:r.shift(),e.d=r,e.e=Se(r,n),_?S(e,l.precision,l.rounding):e},d.toBinary=function(e,t){return Ie(this,2,e,t)},d.toDecimalPlaces=d.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(z(e,0,ie),t===void 0?t=i.rounding:z(t,0,8),S(n,e+n.e+1,t))},d.toExponential=function(e,t){var n,i=this,s=i.constructor;return e===void 0?n=ee(i,!0):(z(e,0,ie),t===void 0?t=s.rounding:z(t,0,8),i=S(new s(i),e+1,t),n=ee(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},d.toFixed=function(e,t){var n,i,s=this,r=s.constructor;return e===void 0?n=ee(s):(z(e,0,ie),t===void 0?t=r.rounding:z(t,0,8),i=S(new r(s),e+s.e+1,t),n=ee(i,!1,e+i.e+1)),s.isNeg()&&!s.isZero()?"-"+n:n},d.toFraction=function(e){var t,n,i,s,r,o,u,a,c,f,l,h,p=this,w=p.d,M=p.constructor;if(!w)return new M(p);if(c=n=new M(1),i=a=new M(0),t=new M(i),r=t.e=He(w)-p.e-1,o=r%k,t.d[0]=Y(10,o<0?k+o:o),e==null)e=r>0?t:c;else{if(u=new M(e),!u.isInt()||u.lt(c))throw Error(re+u);e=u.gt(t)?r>0?t:c:u}for(_=!1,u=new M(j(w)),f=M.precision,M.precision=r=w.length*k*2;l=P(u,t,0,1,1),s=n.plus(l.times(i)),s.cmp(e)!=1;)n=i,i=s,s=c,c=a.plus(l.times(s)),a=s,s=t,t=u.minus(l.times(s)),u=s;return s=P(e.minus(n),i,0,1,1),a=a.plus(s.times(c)),n=n.plus(s.times(i)),a.s=c.s=p.s,h=P(c,i,r,1).minus(p).abs().cmp(P(a,n,r,1).minus(p).abs())<1?[c,i]:[a,n],M.precision=f,_=!0,h},d.toHexadecimal=d.toHex=function(e,t){return Ie(this,16,e,t)},d.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:z(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(_=!1,n=P(n,e,0,t,1).times(e),_=!0,S(n)):(e.s=n.s,n=e),n},d.toNumber=function(){return+this},d.toOctal=function(e,t){return Ie(this,8,e,t)},d.toPower=d.pow=function(e){var t,n,i,s,r,o,u=this,a=u.constructor,c=+(e=new a(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new a(Y(+u,c));if(u=new a(u),u.eq(1))return u;if(i=a.precision,r=a.rounding,e.eq(1))return S(u,i,r);if(t=W(e.e/k),t>=e.d.length-1&&(n=c<0?-c:c)<=Dt)return s=Ye(a,u,n,i),e.s<0?new a(1).div(s):S(s,i,r);if(o=u.s,o<0){if(t<e.d.length-1)return new a(NaN);if(e.d[t]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return n=Y(+u,c),t=n==0||!isFinite(n)?W(c*(Math.log("0."+j(u.d))/Math.LN10+u.e+1)):new a(n+"").e,t>a.maxE+1||t<a.minE-1?new a(t>0?o/0:0):(_=!1,a.rounding=u.s=1,n=Math.min(12,(t+"").length),s=ye(e.times(oe(u,i+n)),i),s.d&&(s=S(s,i+5,1),de(s.d,i,r)&&(t=i+10,s=S(ye(e.times(oe(u,t+n)),t),t+5,1),+j(s.d).slice(i+1,i+15)+1==1e14&&(s=S(s,i+1,0)))),s.s=o,_=!0,a.rounding=r,S(s,i,r))},d.toPrecision=function(e,t){var n,i=this,s=i.constructor;return e===void 0?n=ee(i,i.e<=s.toExpNeg||i.e>=s.toExpPos):(z(e,1,ie),t===void 0?t=s.rounding:z(t,0,8),i=S(new s(i),e,t),n=ee(i,e<=i.e||i.e<=s.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},d.toSignificantDigits=d.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(z(e,1,ie),t===void 0?t=i.rounding:z(t,0,8)),S(new i(n),e,t)},d.toString=function(){var e=this,t=e.constructor,n=ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},d.truncated=d.trunc=function(){return S(new this.constructor(this),this.e+1,1)},d.valueOf=d.toJSON=function(){var e=this,t=e.constructor,n=ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function j(e){var t,n,i,s=e.length-1,r="",o=e[0];if(s>0){for(r+=o,t=1;t<s;t++)i=e[t]+"",n=k-i.length,n&&(r+=se(n)),r+=i;o=e[t],i=o+"",n=k-i.length,n&&(r+=se(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return r+o}function z(e,t,n){if(e!==~~e||e<t||e>n)throw Error(re+e)}function de(e,t,n,i){var s,r,o,u;for(r=e[0];r>=10;r/=10)--t;return--t<0?(t+=k,s=0):(s=Math.ceil((t+1)/k),t%=k),r=Y(10,k-t),u=e[s]%r|0,i==null?t<3?(t==0?u=u/100|0:t==1&&(u=u/10|0),o=n<4&&u==99999||n>3&&u==49999||u==5e4||u==0):o=(n<4&&u+1==r||n>3&&u+1==r/2)&&(e[s+1]/r/100|0)==Y(10,t-2)-1||(u==r/2||u==0)&&(e[s+1]/r/100|0)==0:t<4?(t==0?u=u/1e3|0:t==1?u=u/100|0:t==2&&(u=u/10|0),o=(i||n<4)&&u==9999||!i&&n>3&&u==4999):o=((i||n<4)&&u+1==r||!i&&n>3&&u+1==r/2)&&(e[s+1]/r/1e3|0)==Y(10,t-3)-1,o}function Ne(e,t,n){for(var i,s=[0],r,o=0,u=e.length;o<u;){for(r=s.length;r--;)s[r]*=t;for(s[0]+=_e.indexOf(e.charAt(o++)),i=0;i<s.length;i++)s[i]>n-1&&(s[i+1]===void 0&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}function kt(e,t){var n,i,s;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),s=(1/Ee(4,n)).toString()):(n=16,s="2.3283064365386962890625e-10"),e.precision+=n,t=le(e,1,t.times(s),new e(1));for(var r=n;r--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var P=function(){function e(i,s,r){var o,u=0,a=i.length;for(i=i.slice();a--;)o=i[a]*s+u,i[a]=o%r|0,u=o/r|0;return u&&i.unshift(u),i}function t(i,s,r,o){var u,a;if(r!=o)a=r>o?1:-1;else for(u=a=0;u<r;u++)if(i[u]!=s[u]){a=i[u]>s[u]?1:-1;break}return a}function n(i,s,r,o){for(var u=0;r--;)i[r]-=u,u=i[r]<s[r]?1:0,i[r]=u*o+i[r]-s[r];for(;!i[0]&&i.length>1;)i.shift()}return function(i,s,r,o,u,a){var c,f,l,h,p,w,M,F,A,H,O,q,x,T,E,v,L,y,b,R,U=i.constructor,N=i.s==s.s?1:-1,g=i.d,m=s.d;if(!g||!g[0]||!m||!m[0])return new U(!i.s||!s.s||(g?m&&g[0]==m[0]:!m)?NaN:g&&g[0]==0||!m?N*0:N/0);for(a?(p=1,f=i.e-s.e):(a=K,p=k,f=W(i.e/p)-W(s.e/p)),b=m.length,L=g.length,A=new U(N),H=A.d=[],l=0;m[l]==(g[l]||0);l++);if(m[l]>(g[l]||0)&&f--,r==null?(T=r=U.precision,o=U.rounding):u?T=r+(i.e-s.e)+1:T=r,T<0)H.push(1),w=!0;else{if(T=T/p+2|0,l=0,b==1){for(h=0,m=m[0],T++;(l<L||h)&&T--;l++)E=h*a+(g[l]||0),H[l]=E/m|0,h=E%m|0;w=h||l<L}else{for(h=a/(m[0]+1)|0,h>1&&(m=e(m,h,a),g=e(g,h,a),b=m.length,L=g.length),v=b,O=g.slice(0,b),q=O.length;q<b;)O[q++]=0;R=m.slice(),R.unshift(0),y=m[0],m[1]>=a/2&&++y;do h=0,c=t(m,O,b,q),c<0?(x=O[0],b!=q&&(x=x*a+(O[1]||0)),h=x/y|0,h>1?(h>=a&&(h=a-1),M=e(m,h,a),F=M.length,q=O.length,c=t(M,O,F,q),c==1&&(h--,n(M,b<F?R:m,F,a))):(h==0&&(c=h=1),M=m.slice()),F=M.length,F<q&&M.unshift(0),n(O,M,q,a),c==-1&&(q=O.length,c=t(m,O,b,q),c<1&&(h++,n(O,b<q?R:m,q,a))),q=O.length):c===0&&(h++,O=[0]),H[l++]=h,c&&O[0]?O[q++]=g[v]||0:(O=[g[v]],q=1);while((v++<L||O[0]!==void 0)&&T--);w=O[0]!==void 0}H[0]||H.shift()}if(p==1)A.e=f,Je=w;else{for(l=1,h=H[0];h>=10;h/=10)l++;A.e=l+f*p-1,S(A,u?r+A.e+1:r,o,w)}return A}}();function S(e,t,n,i){var s,r,o,u,a,c,f,l,h,p=e.constructor;e:if(t!=null){if(l=e.d,!l)return e;for(s=1,u=l[0];u>=10;u/=10)s++;if(r=t-s,r<0)r+=k,o=t,f=l[h=0],a=f/Y(10,s-o-1)%10|0;else if(h=Math.ceil((r+1)/k),u=l.length,h>=u)if(i){for(;u++<=h;)l.push(0);f=a=0,s=1,r%=k,o=r-k+1}else break e;else{for(f=u=l[h],s=1;u>=10;u/=10)s++;r%=k,o=r-k+s,a=o<0?0:f/Y(10,s-o-1)%10|0}if(i=i||t<0||l[h+1]!==void 0||(o<0?f:f%Y(10,s-o-1)),c=n<4?(a||i)&&(n==0||n==(e.s<0?3:2)):a>5||a==5&&(n==4||i||n==6&&(r>0?o>0?f/Y(10,s-o):0:l[h-1])%10&1||n==(e.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=e.e+1,l[0]=Y(10,(k-t%k)%k),e.e=-t||0):l[0]=e.e=0,e;if(r==0?(l.length=h,u=1,h--):(l.length=h+1,u=Y(10,k-r),l[h]=o>0?(f/Y(10,s-o)%Y(10,o)|0)*u:0),c)for(;;)if(h==0){for(r=1,o=l[0];o>=10;o/=10)r++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;r!=u&&(e.e++,l[0]==K&&(l[0]=1));break}else{if(l[h]+=u,l[h]!=K)break;l[h--]=0,u=1}for(r=l.length;l[--r]===0;)l.pop()}return _&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function ee(e,t,n){if(!e.isFinite())return We(e);var i,s=e.e,r=j(e.d),o=r.length;return t?(n&&(i=n-o)>0?r=r.charAt(0)+"."+r.slice(1)+se(i):o>1&&(r=r.charAt(0)+"."+r.slice(1)),r=r+(e.e<0?"e":"e+")+e.e):s<0?(r="0."+se(-s-1)+r,n&&(i=n-o)>0&&(r+=se(i))):s>=o?(r+=se(s+1-o),n&&(i=n-s-1)>0&&(r=r+"."+se(i))):((i=s+1)<o&&(r=r.slice(0,i)+"."+r.slice(i)),n&&(i=n-o)>0&&(s+1===o&&(r+="."),r+=se(i))),r}function Se(e,t){var n=e[0];for(t*=k;n>=10;n/=10)t++;return t}function De(e,t,n){if(t>Et)throw _=!0,n&&(e.precision=n),Error(Re);return S(new e($e),t,1,!0)}function Q(e,t,n){if(t>Te)throw Error(Re);return S(new e(Me),t,n,!0)}function He(e){var t=e.length-1,n=t*k+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function se(e){for(var t="";e--;)t+="0";return t}function Ye(e,t,n,i){var s,r=new e(1),o=Math.ceil(i/k+4);for(_=!1;;){if(n%2&&(r=r.times(t),ze(r.d,o)&&(s=!0)),n=W(n/2),n===0){n=r.d.length-1,s&&r.d[n]===0&&++r.d[n];break}t=t.times(t),ze(t.d,o)}return _=!0,r}function Ze(e){return e.d[e.d.length-1]&1}function je(e,t,n){for(var i,s=new e(t[0]),r=0;++r<t.length;)if(i=new e(t[r]),i.s)s[n](i)&&(s=i);else{s=i;break}return s}function ye(e,t){var n,i,s,r,o,u,a,c=0,f=0,l=0,h=e.constructor,p=h.rounding,w=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(_=!1,a=w):a=t,u=new h(.03125);e.e>-2;)e=e.times(u),l+=5;for(i=Math.log(Y(2,l))/Math.LN10*2+5|0,a+=i,n=r=o=new h(1),h.precision=a;;){if(r=S(r.times(e),a,1),n=n.times(++f),u=o.plus(P(r,n,a,1)),j(u.d).slice(0,a)===j(o.d).slice(0,a)){for(s=l;s--;)o=S(o.times(o),a,1);if(t==null)if(c<3&&de(o.d,a-i,p,c))h.precision=a+=10,n=r=u=new h(1),f=0,c++;else return S(o,h.precision=w,p,_=!0);else return h.precision=w,o}o=u}}function oe(e,t){var n,i,s,r,o,u,a,c,f,l,h,p=1,w=10,M=e,F=M.d,A=M.constructor,H=A.rounding,O=A.precision;if(M.s<0||!F||!F[0]||!M.e&&F[0]==1&&F.length==1)return new A(F&&!F[0]?-1/0:M.s!=1?NaN:F?0:M);if(t==null?(_=!1,f=O):f=t,A.precision=f+=w,n=j(F),i=n.charAt(0),Math.abs(r=M.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)M=M.times(e),n=j(M.d),i=n.charAt(0),p++;r=M.e,i>1?(M=new A("0."+n),r++):M=new A(i+"."+n.slice(1))}else return c=De(A,f+2,O).times(r+""),M=oe(new A(i+"."+n.slice(1)),f-w).plus(c),A.precision=O,t==null?S(M,O,H,_=!0):M;for(l=M,a=o=M=P(M.minus(1),M.plus(1),f,1),h=S(M.times(M),f,1),s=3;;){if(o=S(o.times(h),f,1),c=a.plus(P(o,new A(s),f,1)),j(c.d).slice(0,f)===j(a.d).slice(0,f))if(a=a.times(2),r!==0&&(a=a.plus(De(A,f+2,O).times(r+""))),a=P(a,new A(p),f,1),t==null)if(de(a.d,f-w,H,u))A.precision=f+=w,c=o=M=P(l.minus(1),l.plus(1),f,1),h=S(M.times(M),f,1),s=u=1;else return S(a,A.precision=O,H,_=!0);else return A.precision=O,a;a=c,s+=2}}function We(e){return String(e.s*e.s/0)}function Ce(e,t){var n,i,s;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(s=t.length;t.charCodeAt(s-1)===48;--s);if(t=t.slice(i,s),t){if(s-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%k,n<0&&(i+=k),i<s){for(i&&e.d.push(+t.slice(0,i)),s-=k;i<s;)e.d.push(+t.slice(i,i+=k));t=t.slice(i),i=k-t.length}else i-=s;for(;i--;)t+="0";e.d.push(+t),_&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function _t(e,t){var n,i,s,r,o,u,a,c,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Be.test(t))return Ce(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Nt.test(t))n=16,t=t.toLowerCase();else if(bt.test(t))n=2;else if(St.test(t))n=8;else throw Error(re+t);for(r=t.search(/p/i),r>0?(a=+t.slice(r+1),t=t.substring(2,r)):t=t.slice(2),r=t.indexOf("."),o=r>=0,i=e.constructor,o&&(t=t.replace(".",""),u=t.length,r=u-r,s=Ye(i,new i(n),r,r*2)),c=Ne(t,n,K),f=c.length-1,r=f;c[r]===0;--r)c.pop();return r<0?new i(e.s*0):(e.e=Se(c,f),e.d=c,_=!1,o&&(e=P(e,s,u*4)),a&&(e=e.times(Math.abs(a)<54?Y(2,a):ne.pow(2,a))),_=!0,e)}function Ot(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:le(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/Ee(5,n)),t=le(e,2,t,t);for(var s,r=new e(5),o=new e(16),u=new e(20);n--;)s=t.times(t),t=t.times(r.plus(s.times(o.times(s).minus(u))));return t}function le(e,t,n,i,s){var r,o,u,a,c=e.precision,f=Math.ceil(c/k);for(_=!1,a=n.times(n),u=new e(i);;){if(o=P(u.times(a),new e(t++*t++),c,1),u=s?i.plus(o):i.minus(o),i=P(o.times(a),new e(t++*t++),c,1),o=u.plus(i),o.d[f]!==void 0){for(r=f;o.d[r]===u.d[r]&&r--;);if(r==-1)break}r=u,u=i,i=o,o=r}return _=!0,o.d.length=f+1,o}function Ee(e,t){for(var n=e;--t;)n*=e;return n}function Ve(e,t){var n,i=t.s<0,s=Q(e,e.precision,1),r=s.times(.5);if(t=t.abs(),t.lte(r))return te=i?4:1,t;if(n=t.divToInt(s),n.isZero())te=i?3:2;else{if(t=t.minus(n.times(s)),t.lte(r))return te=Ze(n)?i?2:3:i?4:1,t;te=Ze(n)?i?1:4:i?3:2}return t.minus(s).abs()}function Ie(e,t,n,i){var s,r,o,u,a,c,f,l,h,p=e.constructor,w=n!==void 0;if(w?(z(n,1,ie),i===void 0?i=p.rounding:z(i,0,8)):(n=p.precision,i=p.rounding),!e.isFinite())f=We(e);else{for(f=ee(e),o=f.indexOf("."),w?(s=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):s=t,o>=0&&(f=f.replace(".",""),h=new p(1),h.e=f.length-o,h.d=Ne(ee(h),10,s),h.e=h.d.length),l=Ne(f,10,s),r=a=l.length;l[--a]==0;)l.pop();if(!l[0])f=w?"0p+0":"0";else{if(o<0?r--:(e=new p(e),e.d=l,e.e=r,e=P(e,h,n,i,0,s),l=e.d,r=e.e,c=Je),o=l[n],u=s/2,c=c||l[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>u||o===u&&(i===4||c||i===6&&l[n-1]&1||i===(e.s<0?8:7)),l.length=n,c)for(;++l[--n]>s-1;)l[n]=0,n||(++r,l.unshift(1));for(a=l.length;!l[a-1];--a);for(o=0,f="";o<a;o++)f+=_e.charAt(l[o]);if(w){if(a>1)if(t==16||t==8){for(o=t==16?4:3,--a;a%o;a++)f+="0";for(l=Ne(f,s,t),a=l.length;!l[a-1];--a);for(o=1,f="1.";o<a;o++)f+=_e.charAt(l[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(r<0?"p":"p+")+r}else if(r<0){for(;++r;)f="0"+f;f="0."+f}else if(++r>a)for(r-=a;r--;)f+="0";else r<a&&(f=f.slice(0,r)+"."+f.slice(r))}f=(t==16?"0x":t==2?"0b":t==8?"0o":"")+f}return e.s<0?"-"+f:f}function ze(e,t){if(e.length>t)return e.length=t,!0}function Tt(e){return new this(e).abs()}function yt(e){return new this(e).acos()}function Ct(e){return new this(e).acosh()}function It(e,t){return new this(e).plus(t)}function At(e){return new this(e).asin()}function Lt(e){return new this(e).asinh()}function Ft(e){return new this(e).atan()}function Pt(e){return new this(e).atanh()}function Jt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,s=this.rounding,r=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Q(this,r,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Q(this,i,s):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Q(this,r,1).times(.5),n.s=e.s):t.s<0?(this.precision=r,this.rounding=1,n=this.atan(P(e,t,r,1)),t=Q(this,r,1),this.precision=i,this.rounding=s,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(P(e,t,r,1)),n}function Rt(e){return new this(e).cbrt()}function qt(e){return S(e=new this(e),e.e+1,2)}function Ut(e,t,n){return new this(e).clamp(t,n)}function Bt(e){if(!e||typeof e!="object")throw Error(be+"Object expected");var t,n,i,s=e.defaults===!0,r=["precision",1,ie,"rounding",0,8,"toExpNeg",-fe,0,"toExpPos",0,fe,"maxE",0,fe,"minE",-fe,0,"modulo",0,9];for(t=0;t<r.length;t+=3)if(n=r[t],s&&(this[n]=Oe[n]),(i=e[n])!==void 0)if(W(i)===i&&i>=r[t+1]&&i<=r[t+2])this[n]=i;else throw Error(re+n+": "+i);if(n="crypto",s&&(this[n]=Oe[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(qe);else this[n]=!1;else throw Error(re+n+": "+i);return this}function Ht(e){return new this(e).cos()}function Yt(e){return new this(e).cosh()}function Ge(e){var t,n,i;function s(r){var o,u,a,c=this;if(!(c instanceof s))return new s(r);if(c.constructor=s,xe(r)){c.s=r.s,_?!r.d||r.e>s.maxE?(c.e=NaN,c.d=null):r.e<s.minE?(c.e=0,c.d=[0]):(c.e=r.e,c.d=r.d.slice()):(c.e=r.e,c.d=r.d?r.d.slice():r.d);return}if(a=typeof r,a==="number"){if(r===0){c.s=1/r<0?-1:1,c.e=0,c.d=[0];return}if(r<0?(r=-r,c.s=-1):c.s=1,r===~~r&&r<1e7){for(o=0,u=r;u>=10;u/=10)o++;_?o>s.maxE?(c.e=NaN,c.d=null):o<s.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[r]):(c.e=o,c.d=[r]);return}else if(r*0!==0){r||(c.s=NaN),c.e=NaN,c.d=null;return}return Ce(c,r.toString())}else if(a!=="string")throw Error(re+r);return(u=r.charCodeAt(0))===45?(r=r.slice(1),c.s=-1):(u===43&&(r=r.slice(1)),c.s=1),Be.test(r)?Ce(c,r):_t(c,r)}if(s.prototype=d,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=Bt,s.clone=Ge,s.isDecimal=xe,s.abs=Tt,s.acos=yt,s.acosh=Ct,s.add=It,s.asin=At,s.asinh=Lt,s.atan=Ft,s.atanh=Pt,s.atan2=Jt,s.cbrt=Rt,s.ceil=qt,s.clamp=Ut,s.cos=Ht,s.cosh=Yt,s.div=Zt,s.exp=jt,s.floor=Wt,s.hypot=Vt,s.ln=zt,s.log=Gt,s.log10=Xt,s.log2=xt,s.max=Kt,s.min=Qt,s.mod=en,s.mul=tn,s.pow=nn,s.random=rn,s.round=sn,s.sign=on,s.sin=un,s.sinh=cn,s.sqrt=an,s.sub=fn,s.sum=ln,s.tan=hn,s.tanh=dn,s.trunc=mn,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return s.config(e),s}function Zt(e,t){return new this(e).div(t)}function jt(e){return new this(e).exp()}function Wt(e){return S(e=new this(e),e.e+1,3)}function Vt(){var e,t,n=new this(0);for(_=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return _=!0,new this(1/0);n=t}return _=!0,n.sqrt()}function xe(e){return e instanceof ne||e&&e.toStringTag===Ue||!1}function zt(e){return new this(e).ln()}function Gt(e,t){return new this(e).log(t)}function xt(e){return new this(e).log(2)}function Xt(e){return new this(e).log(10)}function Kt(){return je(this,arguments,"lt")}function Qt(){return je(this,arguments,"gt")}function en(e,t){return new this(e).mod(t)}function tn(e,t){return new this(e).mul(t)}function nn(e,t){return new this(e).pow(t)}function rn(e){var t,n,i,s,r=0,o=new this(1),u=[];if(e===void 0?e=this.precision:z(e,1,ie),i=Math.ceil(e/k),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));r<i;)s=t[r],s>=429e7?t[r]=crypto.getRandomValues(new Uint32Array(1))[0]:u[r++]=s%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);r<i;)s=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+((t[r+3]&127)<<24),s>=214e7?crypto.randomBytes(4).copy(t,r):(u.push(s%1e7),r+=4);r=i/4}else throw Error(qe);else for(;r<i;)u[r++]=Math.random()*1e7|0;for(i=u[--r],e%=k,i&&e&&(s=Y(10,k-e),u[r]=(i/s|0)*s);u[r]===0;r--)u.pop();if(r<0)n=0,u=[0];else{for(n=-1;u[0]===0;n-=k)u.shift();for(i=1,s=u[0];s>=10;s/=10)i++;i<k&&(n-=k-i)}return o.e=n,o.d=u,o}function sn(e){return S(e=new this(e),e.e+1,this.rounding)}function on(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function un(e){return new this(e).sin()}function cn(e){return new this(e).sinh()}function an(e){return new this(e).sqrt()}function fn(e,t){return new this(e).sub(t)}function ln(){var e=0,t=arguments,n=new this(t[e]);for(_=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return _=!0,S(n,this.precision,this.rounding)}function hn(e){return new this(e).tan()}function dn(e){return new this(e).tanh()}function mn(e){return S(e=new this(e),e.e+1,1)}d[Symbol.for("nodejs.util.inspect.custom")]=d.toString,d[Symbol.toStringTag]="Decimal";var ne=d.constructor=Ge(Oe);$e=new ne($e),Me=new ne(Me);const pn=(e,t,n=2)=>{const i=new ne(e),s=Object.entries(t).sort(([,r],[,o])=>o-r);for(const[r,o]of s){const u=new ne(o);if(i.greaterThanOrEqualTo(u)){const a=i.dividedBy(u).toFixed(n);return[a,r,a+r]}}return[i.toFixed(n),"",i.toFixed(n)]},gn=(e,t=2)=>{e=e.replace(/\s+/g,"");const n={"+":1,"-":1,"*":2,"/":2},i=u=>new ne(u),s=u=>["+","-","*","/"].includes(u),r=u=>/[0-9.]/.test(u),o=u=>{const a=[],c=[];let f=0;for(;f<u.length;){const h=u[f];if(r(h)){let p="";for(;f<u.length&&r(u[f]);)p+=u[f],f++;a.push(i(p))}else if(h==="(")c.push(h),f++;else if(h===")"){for(;c.length>0&&c[c.length-1]!=="(";)a.push(c.pop());c.pop(),f++}else if(s(h)){for(;c.length>0&&n[c[c.length-1]]>=n[h];)a.push(c.pop());c.push(h),f++}else throw new Error(`无效字符: ${h}`)}for(;c.length>0;)a.push(c.pop());const l=[];for(let h of a)if(typeof h=="string"){const p=l.pop(),w=l.pop();switch(h){case"+":l.push(w.add(p));break;case"-":l.push(w.sub(p));break;case"*":l.push(w.mul(p));break;case"/":if(p.eq(0))throw new Error("除数不能为零");l.push(w.div(p));break}}else l.push(h);return l.pop()};try{const u=o(e);return Number(u.toFixed(t))}catch(u){throw new Error("表达式计算失败:"+u.message)}},wn=(e,t)=>{if(t==="rad")return e*(Math.PI/180);if(t==="deg")return e*(180/Math.PI);throw new Error("请使用正确类型")},vn=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;let r=Math.atan2(i,n)*(180/Math.PI);return r=-r+90,r<0&&(r+=360),r},$n=(e,t)=>{const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},Mn=(e,t,n,i=2)=>{const r={"+":(o,u)=>o.add(u),"-":(o,u)=>o.sub(u),"*":(o,u)=>o.mul(u),"/":(o,u)=>{if(u.eq(0))throw new Error("除数不能为0");return o.div(u)}}[n](new ne(e),new ne(t));return Number(r.toFixed(i))},bn=(e,t)=>t.reduce((n,i)=>{const{key:s,verify:r,msg:o,name:u}=i,a=e[s];return a===""||a===void 0||a===null?n.push({key:s,msg:"必填项",name:u}):(typeof r=="function"?!r(a):!r.test(a))&&n.push({key:s,msg:o,name:u}),n},[]),Nn=({promiseFn:e,maxRetries:t=3,retryDelay:n=2e3,params:i=void 0})=>new Promise((s,r)=>{let o=0;const u=()=>{e(i).then(a=>{s(a)}).catch(a=>{if(o++,o>=t){r(a);return}setTimeout(u,n)})};u()}),Sn=e=>Math.random()*100<e,Dn=(e,t,n=0)=>parseFloat((Math.random()*(t-e)+e).toFixed(n)),En=(e=1)=>{const t=Math.floor(Math.random()*256),n=Math.floor(Math.random()*256),i=Math.floor(Math.random()*256);return`rgba(${t}, ${n}, ${i}, ${e})`},kn=(e,t,n)=>{const i=Array.from({length:t-e+1},(s,r)=>r+e);for(let s=i.length-1;s>0;s--){const r=Math.floor(Math.random()*(s+1));[i[s],i[r]]=[i[r],i[s]]}return i.slice(0,n)},_n=(e,t)=>{const n=ve(e).startOf(t),i=ve().startOf(t);return n.isSame(i)?0:n.isBefore(i)?1:-1},On=e=>{const t=[{unit:"年",milliseconds:31536e6},{unit:"月",milliseconds:2592e6},{unit:"周",milliseconds:6048e5},{unit:"天",milliseconds:864e5},{unit:"小时",milliseconds:36e5},{unit:"分钟",milliseconds:6e4}],i=Date.now()-e;for(const{unit:s,milliseconds:r}of t)if(i>=r)return`${Math.floor(i/r)} ${s}前`;return"刚刚"},Tn=(e={})=>{const{midnight:t="午夜好",morning:n="早上好",forenoon:i="上午好",noon:s="中午好",afternoon:r="下午好",evening:o="晚上好"}=e,u=new Date().getHours();return u<4?t:u<10?n:u<12?i:u<14?s:u<18?r:o};class yn{constructor(t,n){this._isDown=!1,this._currentIndex=0,this._numsLength=0,this._onChange=n,this._numsLength=t,window.addEventListener("pointerup",()=>{this._isDown&&this._up()})}down(t){this._isDown=!0,this._handleChange(t),this._timerId=setTimeout(()=>{this._isDown&&(this._intervalId=setInterval(()=>{this._handleChange(t)},100))},100)}updateIndex(t){this._currentIndex=t}_up(){this._isDown=!1,clearTimeout(this._timerId),clearInterval(this._intervalId)}_handleChange(t){t==="add"?this._currentIndex<this._numsLength-1&&(this._currentIndex++,this._onChange(this._currentIndex)):t==="sub"&&this._currentIndex>0&&(this._currentIndex--,this._onChange(this._currentIndex))}}const Cn=Object.freeze(Object.defineProperty({__proto__:null,Base:{libJsGetDataType:ge,libJsPromiseTimeout:Xe},Browser:{libJsColorConsole:Ke,libJsIsMobile:Qe,libJsIsPad:et,libJsPathParams:tt,libJsSetTitleIcon:nt,libJsTagTitleTip:it,libJsObjToUrlParams:rt},Data:{libJsChunkArray:st,libJsDeepJSONParse:we,libJsGroupArrayByKey:ot,libJsMatchEmail:ut,libJsShuffleArray:ct,libJsStepArray:at,libReverseArrayFromIndex:ft},File:{libJsDownloadImageLink:lt,libJsImageOptimizer:ht,libJsSaveJson:dt},Formatter:{libJsFormatterByte:vt,libJsMaskPhoneNumber:$t,libJsNumComma:Mt,libJsNumberUnit:pn,libJsSecondsFormatterChinese:wt},Math:{libJsCalculateExpression:gn,libJsConvertAngle:wn,libJsCoordsAngle:vn,libJsCoordsDistance:$n,libJsDecimal:Mn},Misc:{libJsRegFormValidate:bn,libJsRetryRequest:Nn,libNumerStepper:yn},Random:{libJsProbabilityResult:Sn,libJsRandom:Dn,libJsRandomColor:En,libJsUniqueRandomNumbers:kn},Time:{libJsSameTimeCheck:_n,libJsTimeAgo:On,libJsTimeGreeting:Tn}},Symbol.toStringTag,{value:"Module"}));window.LibJs=Cn});