document-drive 6.0.0-dev.108 → 6.0.0-dev.109

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.
@@ -1,4 +1,2223 @@
1
- "use strict";var de=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Me=(e,n)=>{for(var i in n)de(e,i,{get:n[i],enumerable:!0})},Xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ge(n))!Je.call(e,r)&&r!==i&&de(e,r,{get:()=>n[r],enumerable:!(t=We(n,r))||t.enumerable});return e};var Ke=e=>Xe(de({},"__esModule",{value:!0}),e);var Xn={};Me(Xn,{Decimal:()=>je,Public:()=>he,getRuntime:()=>be,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Ke(Xn);var he={};Me(he,{validator:()=>Ce});function Ce(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},G=class extends ge{_getNamespace(){return"NullTypes"}},J=class extends G{};me(J,"DbNull");var X=class extends G{};me(X,"JsonNull");var K=class extends G{};me(K,"AnyNull");var Oe={classes:{DbNull:J,JsonNull:X,AnyNull:K},instances:{DbNull:new J(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var xe=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!xe.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var Qe="Cloudflare-Workers",Ye="node";function Re(){var e,n,i;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Qe?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((i=(n=globalThis.process)==null?void 0:n.release)==null?void 0:i.name)===Ye?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ze={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function be(){let e=Re();return{id:e,prettyName:ze[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var H=9e15,$=1e9,we="0123456789abcdef",te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",re="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},Te,Z,w=!0,oe="[DecimalError] ",V=oe+"Invalid argument: ",Le=oe+"Precision limit exceeded",De=oe+"crypto unavailable",Fe="[object Decimal]",b=Math.floor,C=Math.pow,ye=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,en=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,nn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ie=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,tn=9007199254740991,rn=te.length-1,ve=re.length-1,h={toStringTag:Fe};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error(V+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=o.length,r=u.length,n=0,i=t<r?t:r;n<i;++n)if(o[n]!==u[n])return o[n]>u[n]^l<0?1:-1;return t===r?0:t>r^l<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=sn(t,$e(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*C(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=C(i,1/3),e=b((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),t=new a(i),t.s=c.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,l=u.times(u).times(u),f=l.plus(c),t=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(c))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(c));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-b(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return S(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=j(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=j(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/fe(5,e)),r=j(s,2,r,r,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,S(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e,n=this,i=n.constructor,t=n.abs().cmp(1),r=i.precision,s=i.rounding;return t!==-1?t===0?n.isNeg()?L(i,r,s):new i(0):new i(NaN):n.isZero()?L(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,n=n.asin(),e=L(i,r+4,s).times(.5),i.precision=r,i.rounding=s,e.minus(n))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=S(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=L(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=L(c,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=L(c,a+4,d).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),t=1,l=f.times(f),o=new c(f),r=f;e!==-1;)if(r=r.times(l),s=o.minus(r.div(t+=2)),r=r.times(l),o=s.plus(r.div(t+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<<i-1)),w=!0,p(o,c.precision=a,c.rounding=d,!0)};h.isFinite=function(){return!!this.d};h.isInteger=h.isInt=function(){return!!this.d&&b(this.e/m)>this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),x(l.d,r=a,d))do if(u+=10,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),!s){+O(l.d).slice(r+1,r+15)+1==1e14&&(l=p(l,a+1,0));break}while(x(l.d,r+=10,d));return w=!0,p(l,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,d=e.d,u=v.precision,l=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=b(e.e/m),c=b(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=c,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t<o,a&&(o=t),t=0;t<o;t++)if(f[t]!=d[t]){a=f[t]<d[t];break}s=0}for(a&&(n=f,f=d,d=n,e.s=-e.s),o=f.length,t=d.length-o;t>0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]<d[t]){for(r=t;r&&f[--r]===0;)f[r]=D-1;--f[r],f[t]+=D}f[t]-=d[t]}for(;f[--o]===0;)f.pop();for(;f[0]===0;f.shift())--i;return f[0]?(e.d=f,e.e=ue(f,i),w?p(e,u,l):e):new v(l===3?-0:0)};h.modulo=h.mod=function(e){var n,i=this,t=i.constructor;return e=new t(e),!i.d||!e.s||e.d&&!e.d[0]?new t(NaN):!e.d||i.d&&!i.d[0]?p(new t(i),t.precision,t.rounding):(w=!1,t.modulo==9?(n=S(i,e.abs(),0,3,1),n.s*=e.s):n=S(i,e,0,t.modulo,1),n=n.times(e),w=!0,i.minus(n))};h.naturalExponential=h.exp=function(){return Ee(this)};h.naturalLogarithm=h.ln=function(){return B(this)};h.negated=h.neg=function(){var e=new this.constructor(this);return e.s=-e.s,p(e)};h.plus=h.add=function(e){var n,i,t,r,s,o,u,l,f,c,a=this,d=a.constructor;if(e=new d(e),!a.d||!e.d)return!a.s||!e.s?e=new d(NaN):a.d||(e=new d(e.d||a.s===e.s?a:NaN)),e;if(a.s!=e.s)return e.s=-e.s,a.minus(e);if(f=a.d,c=e.d,u=d.precision,l=d.rounding,!f[0]||!c[0])return c[0]||(e=new d(a)),w?p(e,u,l):e;if(s=b(a.e/m),t=b(e.e/m),f=f.slice(),r=s-t,r){for(r<0?(i=f,r=-r,o=c.length):(i=c,t=s,o=f.length),s=Math.ceil(u/m),o=s>o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=c.length,o-r<0&&(r=o,i=c,c=f,f=i),n=0;r;)n=(f[--r]=f[r]+c[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,t),w?p(e,u,l):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(V+e);return i.d?(n=Ze(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=un(t,$e(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=b((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),t=new c(n)):t=new c(f.toString()),i=(l=c.precision)+3;;)if(s=t,t=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,l+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,l+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,l,c.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=S(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,l,f,c=this,a=c.constructor,d=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=b(c.e/m)+b(e.e/m),l=d.length,f=g.length,l<f&&(s=d,d=g,g=s,o=l,l=f,f=o),s=[],o=l+f,t=o;t--;)s.push(0);for(t=f;--t>=0;){for(n=0,r=l+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return ke(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(_(e,0,$),n===void 0?n=t.rounding:_(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,!0):(_(e,0,$),n===void 0?n=r.rounding:_(n,0,8),t=p(new r(t),e+1,n),i=F(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=F(r):(_(e,0,$),n===void 0?n=s.rounding:_(n,0,8),t=p(new s(r),e+r.e+1,n),i=F(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=l=new N(0),n=new N(t),s=n.e=Ze(v)-g.e-1,o=s%m,n.d[0]=C(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error(V+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=l.plus(a.times(r)),l=r,r=n,n=u.minus(a.times(r)),u=r;return r=S(e.minus(i),t,0,1,1),l=l.plus(r.times(f)),i=i.plus(r.times(t)),l.s=f.s=g.s,d=S(f,t,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,t]:[l,i],N.precision=c,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return ke(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.rounding:_(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return ke(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(C(+u,f));if(u=new l(u),u.eq(1))return u;if(t=l.precision,s=l.rounding,e.eq(1))return p(u,t,s);if(n=b(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=tn)return r=Ue(l,u,i,t),e.s<0?new l(1).div(r):p(r,t,s);if(o=u.s,o<0){if(n<e.d.length-1)return new l(NaN);if(e.d[n]&1||(o=1),u.e==0&&u.d[0]==1&&u.d.length==1)return u.s=o,u}return i=C(+u,f),n=i==0||!isFinite(i)?b(f*(Math.log("0."+O(u.d))/Math.LN10+u.e+1)):new l(i+"").e,n>l.maxE+1||n<l.minE-1?new l(n>0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),r=Ee(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),x(r.d,t,s)&&(n=t+10,r=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,l.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(_(e,1,$),n===void 0?n=r.rounding:_(n,0,8),t=p(new r(t),e,n),i=F(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(_(e,1,$),n===void 0?n=t.rounding:_(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;n<r;n++)t=e[n]+"",i=m-t.length,i&&(s+=U(i)),s+=t;o=e[n],t=o+"",i=m-t.length,i&&(s+=U(i))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function _(e,n,i){if(e!==~~e||e<n||e>i)throw Error(V+e)}function x(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=C(10,m-n),u=e[r]%s|0,t==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[r+1]/s/100|0)==C(10,n-2)-1||(u==s/2||u==0)&&(e[r+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==C(10,n-3)-1,o}function ie(e,n,i){for(var t,r=[0],s,o=0,u=e.length;o<u;){for(s=r.length;s--;)r[s]*=n;for(r[0]+=we.indexOf(e.charAt(o++)),t=0;t<r.length;t++)r[t]>i-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function sn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/fe(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=j(e,1,n.times(r),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(t,r,s){var o,u=0,l=t.length;for(t=t.slice();l--;)o=t[l]*r+u,t[l]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;u<s;u++)if(t[u]!=r[u]){l=t[u]>r[u]?1:-1;break}return l}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]<r[s]?1:0,t[s]=u*o+t[s]-r[s];for(;!t[0]&&t.length>1;)t.shift()}return function(t,r,s,o,u,l){var f,c,a,d,g,v,N,A,M,q,E,P,Y,I,le,z,W,ce,T,y,ee=t.constructor,ae=t.s==r.s?1:-1,R=t.d,k=r.d;if(!R||!R[0]||!k||!k[0])return new ee(!t.s||!r.s||(R?k&&R[0]==k[0]:!k)?NaN:R&&R[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=t.e-r.e):(l=D,g=m,c=b(t.e/g)-b(r.e/g)),T=k.length,W=R.length,M=new ee(ae),q=M.d=[],a=0;k[a]==(R[a]||0);a++);if(k[a]>(R[a]||0)&&c--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)q.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,k=k[0],I++;(a<W||d)&&I--;a++)le=d*l+(R[a]||0),q[a]=le/k|0,d=le%k|0;v=d||a<W}else{for(d=l/(k[0]+1)|0,d>1&&(k=e(k,d,l),R=e(R,d,l),T=k.length,W=R.length),z=T,E=R.slice(0,T),P=E.length;P<T;)E[P++]=0;y=k.slice(),y.unshift(0),ce=k[0],k[1]>=l/2&&++ce;do d=0,f=n(k,E,T,P),f<0?(Y=E[0],T!=P&&(Y=Y*l+(E[1]||0)),d=Y/ce|0,d>1?(d>=l&&(d=l-1),N=e(k,d,l),A=N.length,P=E.length,f=n(N,E,A,P),f==1&&(d--,i(N,T<A?y:k,A,l))):(d==0&&(f=d=1),N=k.slice()),A=N.length,A<P&&N.unshift(0),i(E,N,P,l),f==-1&&(P=E.length,f=n(k,E,T,P),f<1&&(d++,i(E,T<P?y:k,P,l))),P=E.length):f===0&&(d++,E=[0]),q[a++]=d,f&&E[0]?E[P++]=R[z]||0:(E=[R[z]],P=1);while((z++<W||E[0]!==void 0)&&I--);v=E[0]!==void 0}q[0]||q.shift()}if(g==1)M.e=c,Te=v;else{for(a=1,d=q[0];d>=10;d/=10)a++;M.e=a+c*g-1,p(M,u?s+M.e+1:s,o,v)}return M}}();function p(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,c=a[d=0],l=c/C(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);c=l=0,r=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,l=o<0?0:c/C(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?c:c%C(10,r-o-1)),f=i<4?(l||t)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||t||i==6&&(s>0?o>0?c/C(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=C(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=C(10,m-s),a[d]=o>0?(c/C(10,r-o)%C(10,o)|0)*u:0),f)for(;;)if(d==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e<g.minE&&(e.e=0,e.d=[0])),e}function F(e,n,i){if(!e.isFinite())return Ve(e);var t,r=e.e,s=O(e.d),o=s.length;return n?(i&&(t=i-o)>0?s=s.charAt(0)+"."+s.slice(1)+U(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)<o&&(s=s.slice(0,t)+"."+s.slice(t)),i&&(t=i-o)>0&&(r+1===o&&(s+="."),s+=U(t))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>rn)throw w=!0,i&&(e.precision=i),Error(Le);return p(new e(te),n,1,!0)}function L(e,n,i){if(n>ve)throw Error(Le);return p(new e(re),n,i,!0)}function Ze(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function Ue(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),_e(s.d,o)&&(r=!0)),i=b(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),_e(n.d,o)}return w=!0,s}function Ae(e){return e.d[e.d.length-1]&1}function Be(e,n,i){for(var t,r=new e(n[0]),s=0;++s<n.length;)if(t=new e(n[s]),t.s)r[i](t)&&(r=t);else{r=t;break}return r}function Ee(e,n){var i,t,r,s,o,u,l,f=0,c=0,a=0,d=e.constructor,g=d.rounding,v=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(n==null?(w=!1,l=v):l=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(C(2,a))/Math.LN10*2+5|0,l+=t,i=s=o=new d(1),d.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(r=a;r--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&x(o.d,l-t,g,f))d.precision=l+=10,i=s=u=new d(1),c=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,l,f,c,a,d,g=1,v=10,N=e,A=N.d,M=N.constructor,q=M.rounding,E=M.precision;if(N.s<0||!A||!A[0]||!N.e&&A[0]==1&&A.length==1)return new M(A&&!A[0]?-1/0:N.s!=1?NaN:A?0:N);if(n==null?(w=!1,c=E):c=n,M.precision=c+=v,i=O(A),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new M("0."+i),s++):N=new M(t+"."+i.slice(1))}else return f=se(M,c+2,E).times(s+""),N=B(new M(t+"."+i.slice(1)),c-v).plus(f),M.precision=E,n==null?p(N,E,q,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),d=p(N.times(N),c,1),r=3;;){if(o=p(o.times(d),c,1),f=l.plus(S(o,new M(r),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(M,c+2,E).times(s+""))),l=S(l,new M(g),c,1),n==null)if(x(l.d,c-v,q,u))M.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),d=p(N.times(N),c,1),r=u=1;else return p(l,M.precision=E,q,w=!0);else return M.precision=E,l;l=f,r+=2}}function Ve(e){return String(e.s*e.s/0)}function Se(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),t<r){for(t&&e.d.push(+n.slice(0,t)),r-=m;t<r;)e.d.push(+n.slice(t,t+=m));n=n.slice(t),t=m-n.length}else t-=r;for(;t--;)n+="0";e.d.push(+n),w&&(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 on(e,n){var i,t,r,s,o,u,l,f,c;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Ie.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(en.test(n))i=16,n=n.toLowerCase();else if(ye.test(n))i=2;else if(nn.test(n))i=8;else throw Error(V+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=Ue(t,new t(i),s,s*2)),f=ie(n,i,D),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,r,u*4)),l&&(e=e.times(Math.abs(l)<54?C(2,l):Q.pow(2,l))),w=!0,e)}function un(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:j(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=j(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function j(e,n,i,t,r){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(t);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=r?t.plus(o):t.minus(o),t=S(o.times(l),new e(n++*n++),c,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function $e(e,n){var i,t=n.s<0,r=L(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=Ae(i)?t?2:3:t?4:1,n;Z=Ae(i)?t?1:4:t?3:2}return n.minus(r).abs()}function ke(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor,v=i!==void 0;if(v?(_(i,1,$),t===void 0?t=g.rounding:_(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())c=Ve(e);else{for(c=F(e),o=c.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(c=c.replace(".",""),d=new g(1),d.e=c.length-o,d.d=ie(F(d),10,r),d.e=d.d.length),a=ie(c,10,r),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,d,i,t,0,r),a=e.d,s=e.e,f=Te),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o<l;o++)c+=we.charAt(a[o]);if(v){if(l>1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,r,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";o<l;o++)c+=we.charAt(a[o])}else c=c.charAt(0)+"."+c.slice(1);c=c+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)c="0"+c;c="0."+c}else if(++s>l)for(s-=l;s--;)c+="0";else s<l&&(c=c.slice(0,s)+"."+c.slice(s))}c=(n==16?"0x":n==2?"0b":n==8?"0o":"")+c}return e.s<0?"-"+c:c}function _e(e,n){if(e.length>n)return e.length=n,!0}function fn(e){return new this(e).abs()}function ln(e){return new this(e).acos()}function cn(e){return new this(e).acosh()}function an(e,n){return new this(e).plus(n)}function dn(e){return new this(e).asin()}function hn(e){return new this(e).asinh()}function pn(e){return new this(e).atan()}function gn(e){return new this(e).atanh()}function mn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=L(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?L(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=L(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=L(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function wn(e){return new this(e).cbrt()}function Nn(e){return p(e=new this(e),e.e+1,2)}function vn(e,n,i){return new this(e).clamp(n,i)}function En(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,$,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n<s.length;n+=3)if(i=s[n],r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(b(t)===t&&t>=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error(V+i+": "+t);if(i="crypto",r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(De);else this[i]=!1;else throw Error(V+i+": "+t);return this}function Sn(e){return new this(e).cos()}function kn(e){return new this(e).cosh()}function He(e){var n,i,t;function r(s){var o,u,l,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,qe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e<r.minE?(f.e=0,f.d=[0]):(f.e=s.e,f.d=s.d.slice()):(f.e=s.e,f.d=s.d?s.d.slice():s.d);return}if(l=typeof s,l==="number"){if(s===0){f.s=1/s<0?-1:1,f.e=0,f.d=[0];return}if(s<0?(s=-s,f.s=-1):f.s=1,s===~~s&&s<1e7){for(o=0,u=s;u>=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o<r.minE?(f.e=0,f.d=[0]):(f.e=o,f.d=[s]):(f.e=o,f.d=[s]);return}else if(s*0!==0){s||(f.s=NaN),f.e=NaN,f.d=null;return}return Se(f,s.toString())}else if(l!=="string")throw Error(V+s);return(u=s.charCodeAt(0))===45?(s=s.slice(1),f.s=-1):(u===43&&(s=s.slice(1)),f.s=1),Ie.test(s)?Se(f,s):on(f,s)}if(r.prototype=h,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=En,r.clone=He,r.isDecimal=qe,r.abs=fn,r.acos=ln,r.acosh=cn,r.add=an,r.asin=dn,r.asinh=hn,r.atan=pn,r.atanh=gn,r.atan2=mn,r.cbrt=wn,r.ceil=Nn,r.clamp=vn,r.cos=Sn,r.cosh=kn,r.div=Mn,r.exp=Cn,r.floor=On,r.hypot=Pn,r.ln=Rn,r.log=bn,r.log10=_n,r.log2=An,r.max=qn,r.min=Tn,r.mod=Ln,r.mul=Dn,r.pow=Fn,r.random=In,r.round=Zn,r.sign=Un,r.sin=Bn,r.sinh=Vn,r.sqrt=$n,r.sub=Hn,r.sum=jn,r.tan=Wn,r.tanh=Gn,r.trunc=Jn,e===void 0&&(e={}),e&&e.defaults!==!0)for(t=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<t.length;)e.hasOwnProperty(i=t[n++])||(e[i]=this[i]);return r.config(e),r}function Mn(e,n){return new this(e).div(n)}function Cn(e){return new this(e).exp()}function On(e){return p(e=new this(e),e.e+1,3)}function Pn(){var e,n,i=new this(0);for(w=!1,e=0;e<arguments.length;)if(n=new this(arguments[e++]),n.d)i.d&&(i=i.plus(n.times(n)));else{if(n.s)return w=!0,new this(1/0);i=n}return w=!0,i.sqrt()}function qe(e){return e instanceof Q||e&&e.toStringTag===Fe||!1}function Rn(e){return new this(e).ln()}function bn(e,n){return new this(e).log(n)}function An(e){return new this(e).log(2)}function _n(e){return new this(e).log(10)}function qn(){return Be(this,arguments,"lt")}function Tn(){return Be(this,arguments,"gt")}function Ln(e,n){return new this(e).mod(n)}function Dn(e,n){return new this(e).mul(n)}function Fn(e,n){return new this(e).pow(n)}function In(e){var n,i,t,r,s=0,o=new this(1),u=[];if(e===void 0?e=this.precision:_(e,1,$),t=Math.ceil(e/m),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(t));s<t;)r=n[s],r>=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s<t;)r=n[s]+(n[s+1]<<8)+(n[s+2]<<16)+((n[s+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(De);else for(;s<t;)u[s++]=Math.random()*1e7|0;for(t=u[--s],e%=m,t&&e&&(r=C(10,m-e),u[s]=(t/r|0)*r);u[s]===0;s--)u.pop();if(s<0)i=0,u=[0];else{for(i=-1;u[0]===0;i-=m)u.shift();for(t=1,r=u[0];r>=10;r/=10)t++;t<m&&(i-=m-t)}return o.e=i,o.d=u,o}function Zn(e){return p(e=new this(e),e.e+1,this.rounding)}function Un(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Bn(e){return new this(e).sin()}function Vn(e){return new this(e).sinh()}function $n(e){return new this(e).sqrt()}function Hn(e,n){return new this(e).sub(n)}function jn(){var e=0,n=arguments,i=new this(n[e]);for(w=!1;i.s&&++e<n.length;)i=i.plus(n[e]);return w=!0,p(i,this.precision,this.rounding)}function Wn(e){return new this(e).tan()}function Gn(e){return new this(e).tanh()}function Jn(e){return p(e=new this(e),e.e+1,1)}h[Symbol.for("nodejs.util.inspect.custom")]=h.toString;h[Symbol.toStringTag]="Decimal";var Q=h.constructor=He(Ne);te=new Q(te);re=new Q(re);var je=Q;0&&(module.exports={Decimal,Public,getRuntime,makeStrictEnum,objectEnumValues});
1
+ "use strict";
2
+ var de = Object.defineProperty;
3
+ var We = Object.getOwnPropertyDescriptor;
4
+ var Ge = Object.getOwnPropertyNames;
5
+ var Je = Object.prototype.hasOwnProperty;
6
+ var Me = (e, n) => {
7
+ for (var i in n) de(e, i, { get: n[i], enumerable: !0 });
8
+ },
9
+ Xe = (e, n, i, t) => {
10
+ if ((n && typeof n == "object") || typeof n == "function")
11
+ for (let r of Ge(n))
12
+ !Je.call(e, r) &&
13
+ r !== i &&
14
+ de(e, r, {
15
+ get: () => n[r],
16
+ enumerable: !(t = We(n, r)) || t.enumerable,
17
+ });
18
+ return e;
19
+ };
20
+ var Ke = (e) => Xe(de({}, "__esModule", { value: !0 }), e);
21
+ var Xn = {};
22
+ Me(Xn, {
23
+ Decimal: () => je,
24
+ Public: () => he,
25
+ getRuntime: () => be,
26
+ makeStrictEnum: () => Pe,
27
+ objectEnumValues: () => Oe,
28
+ });
29
+ module.exports = Ke(Xn);
30
+ var he = {};
31
+ Me(he, { validator: () => Ce });
32
+ function Ce(...e) {
33
+ return (n) => n;
34
+ }
35
+ var ne = Symbol(),
36
+ pe = new WeakMap(),
37
+ ge = class {
38
+ constructor(n) {
39
+ n === ne
40
+ ? pe.set(this, "Prisma.".concat(this._getName()))
41
+ : pe.set(
42
+ this,
43
+ "new Prisma."
44
+ .concat(this._getNamespace(), ".")
45
+ .concat(this._getName(), "()"),
46
+ );
47
+ }
48
+ _getName() {
49
+ return this.constructor.name;
50
+ }
51
+ toString() {
52
+ return pe.get(this);
53
+ }
54
+ },
55
+ G = class extends ge {
56
+ _getNamespace() {
57
+ return "NullTypes";
58
+ }
59
+ },
60
+ J = class extends G {};
61
+ me(J, "DbNull");
62
+ var X = class extends G {};
63
+ me(X, "JsonNull");
64
+ var K = class extends G {};
65
+ me(K, "AnyNull");
66
+ var Oe = {
67
+ classes: { DbNull: J, JsonNull: X, AnyNull: K },
68
+ instances: { DbNull: new J(ne), JsonNull: new X(ne), AnyNull: new K(ne) },
69
+ };
70
+ function me(e, n) {
71
+ Object.defineProperty(e, "name", { value: n, configurable: !0 });
72
+ }
73
+ var xe = new Set([
74
+ "toJSON",
75
+ "$$typeof",
76
+ "asymmetricMatch",
77
+ Symbol.iterator,
78
+ Symbol.toStringTag,
79
+ Symbol.isConcatSpreadable,
80
+ Symbol.toPrimitive,
81
+ ]);
82
+ function Pe(e) {
83
+ return new Proxy(e, {
84
+ get(n, i) {
85
+ if (i in n) return n[i];
86
+ if (!xe.has(i))
87
+ throw new TypeError("Invalid enum value: ".concat(String(i)));
88
+ },
89
+ });
90
+ }
91
+ var Qe = "Cloudflare-Workers",
92
+ Ye = "node";
93
+ function Re() {
94
+ var e, n, i;
95
+ return typeof Netlify == "object"
96
+ ? "netlify"
97
+ : typeof EdgeRuntime == "string"
98
+ ? "edge-light"
99
+ : ((e = globalThis.navigator) == null ? void 0 : e.userAgent) === Qe
100
+ ? "workerd"
101
+ : globalThis.Deno
102
+ ? "deno"
103
+ : globalThis.__lagon__
104
+ ? "lagon"
105
+ : ((i = (n = globalThis.process) == null ? void 0 : n.release) ==
106
+ null
107
+ ? void 0
108
+ : i.name) === Ye
109
+ ? "node"
110
+ : globalThis.Bun
111
+ ? "bun"
112
+ : globalThis.fastly
113
+ ? "fastly"
114
+ : "unknown";
115
+ }
116
+ var ze = {
117
+ node: "Node.js",
118
+ workerd: "Cloudflare Workers",
119
+ deno: "Deno and Deno Deploy",
120
+ netlify: "Netlify Edge Functions",
121
+ "edge-light":
122
+ "Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)",
123
+ };
124
+ function be() {
125
+ let e = Re();
126
+ return {
127
+ id: e,
128
+ prettyName: ze[e] || e,
129
+ isEdge: ["workerd", "deno", "netlify", "edge-light"].includes(e),
130
+ };
131
+ }
132
+ var H = 9e15,
133
+ $ = 1e9,
134
+ we = "0123456789abcdef",
135
+ te =
136
+ "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",
137
+ re =
138
+ "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",
139
+ Ne = {
140
+ precision: 20,
141
+ rounding: 4,
142
+ modulo: 1,
143
+ toExpNeg: -7,
144
+ toExpPos: 21,
145
+ minE: -H,
146
+ maxE: H,
147
+ crypto: !1,
148
+ },
149
+ Te,
150
+ Z,
151
+ w = !0,
152
+ oe = "[DecimalError] ",
153
+ V = oe + "Invalid argument: ",
154
+ Le = oe + "Precision limit exceeded",
155
+ De = oe + "crypto unavailable",
156
+ Fe = "[object Decimal]",
157
+ b = Math.floor,
158
+ C = Math.pow,
159
+ ye = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,
160
+ en = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,
161
+ nn = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,
162
+ Ie = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
163
+ D = 1e7,
164
+ m = 7,
165
+ tn = 9007199254740991,
166
+ rn = te.length - 1,
167
+ ve = re.length - 1,
168
+ h = { toStringTag: Fe };
169
+ h.absoluteValue = h.abs = function () {
170
+ var e = new this.constructor(this);
171
+ return (e.s < 0 && (e.s = 1), p(e));
172
+ };
173
+ h.ceil = function () {
174
+ return p(new this.constructor(this), this.e + 1, 2);
175
+ };
176
+ h.clampedTo = h.clamp = function (e, n) {
177
+ var i,
178
+ t = this,
179
+ r = t.constructor;
180
+ if (((e = new r(e)), (n = new r(n)), !e.s || !n.s)) return new r(NaN);
181
+ if (e.gt(n)) throw Error(V + n);
182
+ return ((i = t.cmp(e)), i < 0 ? e : t.cmp(n) > 0 ? n : new r(t));
183
+ };
184
+ h.comparedTo = h.cmp = function (e) {
185
+ var n,
186
+ i,
187
+ t,
188
+ r,
189
+ s = this,
190
+ o = s.d,
191
+ u = (e = new s.constructor(e)).d,
192
+ l = s.s,
193
+ f = e.s;
194
+ if (!o || !u)
195
+ return !l || !f ? NaN : l !== f ? l : o === u ? 0 : !o ^ (l < 0) ? 1 : -1;
196
+ if (!o[0] || !u[0]) return o[0] ? l : u[0] ? -f : 0;
197
+ if (l !== f) return l;
198
+ if (s.e !== e.e) return (s.e > e.e) ^ (l < 0) ? 1 : -1;
199
+ for (t = o.length, r = u.length, n = 0, i = t < r ? t : r; n < i; ++n)
200
+ if (o[n] !== u[n]) return (o[n] > u[n]) ^ (l < 0) ? 1 : -1;
201
+ return t === r ? 0 : (t > r) ^ (l < 0) ? 1 : -1;
202
+ };
203
+ h.cosine = h.cos = function () {
204
+ var e,
205
+ n,
206
+ i = this,
207
+ t = i.constructor;
208
+ return i.d
209
+ ? i.d[0]
210
+ ? ((e = t.precision),
211
+ (n = t.rounding),
212
+ (t.precision = e + Math.max(i.e, i.sd()) + m),
213
+ (t.rounding = 1),
214
+ (i = sn(t, $e(t, i))),
215
+ (t.precision = e),
216
+ (t.rounding = n),
217
+ p(Z == 2 || Z == 3 ? i.neg() : i, e, n, !0))
218
+ : new t(1)
219
+ : new t(NaN);
220
+ };
221
+ h.cubeRoot = h.cbrt = function () {
222
+ var e,
223
+ n,
224
+ i,
225
+ t,
226
+ r,
227
+ s,
228
+ o,
229
+ u,
230
+ l,
231
+ f,
232
+ c = this,
233
+ a = c.constructor;
234
+ if (!c.isFinite() || c.isZero()) return new a(c);
235
+ for (
236
+ w = !1,
237
+ s = c.s * C(c.s * c, 1 / 3),
238
+ !s || Math.abs(s) == 1 / 0
239
+ ? ((i = O(c.d)),
240
+ (e = c.e),
241
+ (s = (e - i.length + 1) % 3) && (i += s == 1 || s == -2 ? "0" : "00"),
242
+ (s = C(i, 1 / 3)),
243
+ (e = b((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2))),
244
+ s == 1 / 0
245
+ ? (i = "5e" + e)
246
+ : ((i = s.toExponential()),
247
+ (i = i.slice(0, i.indexOf("e") + 1) + e)),
248
+ (t = new a(i)),
249
+ (t.s = c.s))
250
+ : (t = new a(s.toString())),
251
+ o = (e = a.precision) + 3;
252
+ ;
253
+ )
254
+ if (
255
+ ((u = t),
256
+ (l = u.times(u).times(u)),
257
+ (f = l.plus(c)),
258
+ (t = S(f.plus(c).times(u), f.plus(l), o + 2, 1)),
259
+ O(u.d).slice(0, o) === (i = O(t.d)).slice(0, o))
260
+ )
261
+ if (((i = i.slice(o - 3, o + 1)), i == "9999" || (!r && i == "4999"))) {
262
+ if (!r && (p(u, e + 1, 0), u.times(u).times(u).eq(c))) {
263
+ t = u;
264
+ break;
265
+ }
266
+ ((o += 4), (r = 1));
267
+ } else {
268
+ (!+i || (!+i.slice(1) && i.charAt(0) == "5")) &&
269
+ (p(t, e + 1, 1), (n = !t.times(t).times(t).eq(c)));
270
+ break;
271
+ }
272
+ return ((w = !0), p(t, e, a.rounding, n));
273
+ };
274
+ h.decimalPlaces = h.dp = function () {
275
+ var e,
276
+ n = this.d,
277
+ i = NaN;
278
+ if (n) {
279
+ if (((e = n.length - 1), (i = (e - b(this.e / m)) * m), (e = n[e]), e))
280
+ for (; e % 10 == 0; e /= 10) i--;
281
+ i < 0 && (i = 0);
282
+ }
283
+ return i;
284
+ };
285
+ h.dividedBy = h.div = function (e) {
286
+ return S(this, new this.constructor(e));
287
+ };
288
+ h.dividedToIntegerBy = h.divToInt = function (e) {
289
+ var n = this,
290
+ i = n.constructor;
291
+ return p(S(n, new i(e), 0, 1, 1), i.precision, i.rounding);
292
+ };
293
+ h.equals = h.eq = function (e) {
294
+ return this.cmp(e) === 0;
295
+ };
296
+ h.floor = function () {
297
+ return p(new this.constructor(this), this.e + 1, 3);
298
+ };
299
+ h.greaterThan = h.gt = function (e) {
300
+ return this.cmp(e) > 0;
301
+ };
302
+ h.greaterThanOrEqualTo = h.gte = function (e) {
303
+ var n = this.cmp(e);
304
+ return n == 1 || n === 0;
305
+ };
306
+ h.hyperbolicCosine = h.cosh = function () {
307
+ var e,
308
+ n,
309
+ i,
310
+ t,
311
+ r,
312
+ s = this,
313
+ o = s.constructor,
314
+ u = new o(1);
315
+ if (!s.isFinite()) return new o(s.s ? 1 / 0 : NaN);
316
+ if (s.isZero()) return u;
317
+ ((i = o.precision),
318
+ (t = o.rounding),
319
+ (o.precision = i + Math.max(s.e, s.sd()) + 4),
320
+ (o.rounding = 1),
321
+ (r = s.d.length),
322
+ r < 32
323
+ ? ((e = Math.ceil(r / 3)), (n = (1 / fe(4, e)).toString()))
324
+ : ((e = 16), (n = "2.3283064365386962890625e-10")),
325
+ (s = j(o, 1, s.times(n), new o(1), !0)));
326
+ for (var l, f = e, c = new o(8); f--; )
327
+ ((l = s.times(s)), (s = u.minus(l.times(c.minus(l.times(c))))));
328
+ return p(s, (o.precision = i), (o.rounding = t), !0);
329
+ };
330
+ h.hyperbolicSine = h.sinh = function () {
331
+ var e,
332
+ n,
333
+ i,
334
+ t,
335
+ r = this,
336
+ s = r.constructor;
337
+ if (!r.isFinite() || r.isZero()) return new s(r);
338
+ if (
339
+ ((n = s.precision),
340
+ (i = s.rounding),
341
+ (s.precision = n + Math.max(r.e, r.sd()) + 4),
342
+ (s.rounding = 1),
343
+ (t = r.d.length),
344
+ t < 3)
345
+ )
346
+ r = j(s, 2, r, r, !0);
347
+ else {
348
+ ((e = 1.4 * Math.sqrt(t)),
349
+ (e = e > 16 ? 16 : e | 0),
350
+ (r = r.times(1 / fe(5, e))),
351
+ (r = j(s, 2, r, r, !0)));
352
+ for (var o, u = new s(5), l = new s(16), f = new s(20); e--; )
353
+ ((o = r.times(r)), (r = r.times(u.plus(o.times(l.times(o).plus(f))))));
354
+ }
355
+ return ((s.precision = n), (s.rounding = i), p(r, n, i, !0));
356
+ };
357
+ h.hyperbolicTangent = h.tanh = function () {
358
+ var e,
359
+ n,
360
+ i = this,
361
+ t = i.constructor;
362
+ return i.isFinite()
363
+ ? i.isZero()
364
+ ? new t(i)
365
+ : ((e = t.precision),
366
+ (n = t.rounding),
367
+ (t.precision = e + 7),
368
+ (t.rounding = 1),
369
+ S(i.sinh(), i.cosh(), (t.precision = e), (t.rounding = n)))
370
+ : new t(i.s);
371
+ };
372
+ h.inverseCosine = h.acos = function () {
373
+ var e,
374
+ n = this,
375
+ i = n.constructor,
376
+ t = n.abs().cmp(1),
377
+ r = i.precision,
378
+ s = i.rounding;
379
+ return t !== -1
380
+ ? t === 0
381
+ ? n.isNeg()
382
+ ? L(i, r, s)
383
+ : new i(0)
384
+ : new i(NaN)
385
+ : n.isZero()
386
+ ? L(i, r + 4, s).times(0.5)
387
+ : ((i.precision = r + 6),
388
+ (i.rounding = 1),
389
+ (n = n.asin()),
390
+ (e = L(i, r + 4, s).times(0.5)),
391
+ (i.precision = r),
392
+ (i.rounding = s),
393
+ e.minus(n));
394
+ };
395
+ h.inverseHyperbolicCosine = h.acosh = function () {
396
+ var e,
397
+ n,
398
+ i = this,
399
+ t = i.constructor;
400
+ return i.lte(1)
401
+ ? new t(i.eq(1) ? 0 : NaN)
402
+ : i.isFinite()
403
+ ? ((e = t.precision),
404
+ (n = t.rounding),
405
+ (t.precision = e + Math.max(Math.abs(i.e), i.sd()) + 4),
406
+ (t.rounding = 1),
407
+ (w = !1),
408
+ (i = i.times(i).minus(1).sqrt().plus(i)),
409
+ (w = !0),
410
+ (t.precision = e),
411
+ (t.rounding = n),
412
+ i.ln())
413
+ : new t(i);
414
+ };
415
+ h.inverseHyperbolicSine = h.asinh = function () {
416
+ var e,
417
+ n,
418
+ i = this,
419
+ t = i.constructor;
420
+ return !i.isFinite() || i.isZero()
421
+ ? new t(i)
422
+ : ((e = t.precision),
423
+ (n = t.rounding),
424
+ (t.precision = e + 2 * Math.max(Math.abs(i.e), i.sd()) + 6),
425
+ (t.rounding = 1),
426
+ (w = !1),
427
+ (i = i.times(i).plus(1).sqrt().plus(i)),
428
+ (w = !0),
429
+ (t.precision = e),
430
+ (t.rounding = n),
431
+ i.ln());
432
+ };
433
+ h.inverseHyperbolicTangent = h.atanh = function () {
434
+ var e,
435
+ n,
436
+ i,
437
+ t,
438
+ r = this,
439
+ s = r.constructor;
440
+ return r.isFinite()
441
+ ? r.e >= 0
442
+ ? new s(r.abs().eq(1) ? r.s / 0 : r.isZero() ? r : NaN)
443
+ : ((e = s.precision),
444
+ (n = s.rounding),
445
+ (t = r.sd()),
446
+ Math.max(t, e) < 2 * -r.e - 1
447
+ ? p(new s(r), e, n, !0)
448
+ : ((s.precision = i = t - r.e),
449
+ (r = S(r.plus(1), new s(1).minus(r), i + e, 1)),
450
+ (s.precision = e + 4),
451
+ (s.rounding = 1),
452
+ (r = r.ln()),
453
+ (s.precision = e),
454
+ (s.rounding = n),
455
+ r.times(0.5)))
456
+ : new s(NaN);
457
+ };
458
+ h.inverseSine = h.asin = function () {
459
+ var e,
460
+ n,
461
+ i,
462
+ t,
463
+ r = this,
464
+ s = r.constructor;
465
+ return r.isZero()
466
+ ? new s(r)
467
+ : ((n = r.abs().cmp(1)),
468
+ (i = s.precision),
469
+ (t = s.rounding),
470
+ n !== -1
471
+ ? n === 0
472
+ ? ((e = L(s, i + 4, t).times(0.5)), (e.s = r.s), e)
473
+ : new s(NaN)
474
+ : ((s.precision = i + 6),
475
+ (s.rounding = 1),
476
+ (r = r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan()),
477
+ (s.precision = i),
478
+ (s.rounding = t),
479
+ r.times(2)));
480
+ };
481
+ h.inverseTangent = h.atan = function () {
482
+ var e,
483
+ n,
484
+ i,
485
+ t,
486
+ r,
487
+ s,
488
+ o,
489
+ u,
490
+ l,
491
+ f = this,
492
+ c = f.constructor,
493
+ a = c.precision,
494
+ d = c.rounding;
495
+ if (f.isFinite()) {
496
+ if (f.isZero()) return new c(f);
497
+ if (f.abs().eq(1) && a + 4 <= ve)
498
+ return ((o = L(c, a + 4, d).times(0.25)), (o.s = f.s), o);
499
+ } else {
500
+ if (!f.s) return new c(NaN);
501
+ if (a + 4 <= ve) return ((o = L(c, a + 4, d).times(0.5)), (o.s = f.s), o);
502
+ }
503
+ for (
504
+ c.precision = u = a + 10,
505
+ c.rounding = 1,
506
+ i = Math.min(28, (u / m + 2) | 0),
507
+ e = i;
508
+ e;
509
+ --e
510
+ )
511
+ f = f.div(f.times(f).plus(1).sqrt().plus(1));
512
+ for (
513
+ w = !1, n = Math.ceil(u / m), t = 1, l = f.times(f), o = new c(f), r = f;
514
+ e !== -1;
515
+ )
516
+ if (
517
+ ((r = r.times(l)),
518
+ (s = o.minus(r.div((t += 2)))),
519
+ (r = r.times(l)),
520
+ (o = s.plus(r.div((t += 2)))),
521
+ o.d[n] !== void 0)
522
+ )
523
+ for (e = n; o.d[e] === s.d[e] && e--; );
524
+ return (
525
+ i && (o = o.times(2 << (i - 1))),
526
+ (w = !0),
527
+ p(o, (c.precision = a), (c.rounding = d), !0)
528
+ );
529
+ };
530
+ h.isFinite = function () {
531
+ return !!this.d;
532
+ };
533
+ h.isInteger = h.isInt = function () {
534
+ return !!this.d && b(this.e / m) > this.d.length - 2;
535
+ };
536
+ h.isNaN = function () {
537
+ return !this.s;
538
+ };
539
+ h.isNegative = h.isNeg = function () {
540
+ return this.s < 0;
541
+ };
542
+ h.isPositive = h.isPos = function () {
543
+ return this.s > 0;
544
+ };
545
+ h.isZero = function () {
546
+ return !!this.d && this.d[0] === 0;
547
+ };
548
+ h.lessThan = h.lt = function (e) {
549
+ return this.cmp(e) < 0;
550
+ };
551
+ h.lessThanOrEqualTo = h.lte = function (e) {
552
+ return this.cmp(e) < 1;
553
+ };
554
+ h.logarithm = h.log = function (e) {
555
+ var n,
556
+ i,
557
+ t,
558
+ r,
559
+ s,
560
+ o,
561
+ u,
562
+ l,
563
+ f = this,
564
+ c = f.constructor,
565
+ a = c.precision,
566
+ d = c.rounding,
567
+ g = 5;
568
+ if (e == null) ((e = new c(10)), (n = !0));
569
+ else {
570
+ if (((e = new c(e)), (i = e.d), e.s < 0 || !i || !i[0] || e.eq(1)))
571
+ return new c(NaN);
572
+ n = e.eq(10);
573
+ }
574
+ if (((i = f.d), f.s < 0 || !i || !i[0] || f.eq(1)))
575
+ return new c(i && !i[0] ? -1 / 0 : f.s != 1 ? NaN : i ? 0 : 1 / 0);
576
+ if (n)
577
+ if (i.length > 1) s = !0;
578
+ else {
579
+ for (r = i[0]; r % 10 === 0; ) r /= 10;
580
+ s = r !== 1;
581
+ }
582
+ if (
583
+ ((w = !1),
584
+ (u = a + g),
585
+ (o = B(f, u)),
586
+ (t = n ? se(c, u + 10) : B(e, u)),
587
+ (l = S(o, t, u, 1)),
588
+ x(l.d, (r = a), d))
589
+ )
590
+ do
591
+ if (
592
+ ((u += 10),
593
+ (o = B(f, u)),
594
+ (t = n ? se(c, u + 10) : B(e, u)),
595
+ (l = S(o, t, u, 1)),
596
+ !s)
597
+ ) {
598
+ +O(l.d).slice(r + 1, r + 15) + 1 == 1e14 && (l = p(l, a + 1, 0));
599
+ break;
600
+ }
601
+ while (x(l.d, (r += 10), d));
602
+ return ((w = !0), p(l, a, d));
603
+ };
604
+ h.minus = h.sub = function (e) {
605
+ var n,
606
+ i,
607
+ t,
608
+ r,
609
+ s,
610
+ o,
611
+ u,
612
+ l,
613
+ f,
614
+ c,
615
+ a,
616
+ d,
617
+ g = this,
618
+ v = g.constructor;
619
+ if (((e = new v(e)), !g.d || !e.d))
620
+ return (
621
+ !g.s || !e.s
622
+ ? (e = new v(NaN))
623
+ : g.d
624
+ ? (e.s = -e.s)
625
+ : (e = new v(e.d || g.s !== e.s ? g : NaN)),
626
+ e
627
+ );
628
+ if (g.s != e.s) return ((e.s = -e.s), g.plus(e));
629
+ if (
630
+ ((f = g.d), (d = e.d), (u = v.precision), (l = v.rounding), !f[0] || !d[0])
631
+ ) {
632
+ if (d[0]) e.s = -e.s;
633
+ else if (f[0]) e = new v(g);
634
+ else return new v(l === 3 ? -0 : 0);
635
+ return w ? p(e, u, l) : e;
636
+ }
637
+ if (((i = b(e.e / m)), (c = b(g.e / m)), (f = f.slice()), (s = c - i), s)) {
638
+ for (
639
+ a = s < 0,
640
+ a
641
+ ? ((n = f), (s = -s), (o = d.length))
642
+ : ((n = d), (i = c), (o = f.length)),
643
+ t = Math.max(Math.ceil(u / m), o) + 2,
644
+ s > t && ((s = t), (n.length = 1)),
645
+ n.reverse(),
646
+ t = s;
647
+ t--;
648
+ )
649
+ n.push(0);
650
+ n.reverse();
651
+ } else {
652
+ for (t = f.length, o = d.length, a = t < o, a && (o = t), t = 0; t < o; t++)
653
+ if (f[t] != d[t]) {
654
+ a = f[t] < d[t];
655
+ break;
656
+ }
657
+ s = 0;
658
+ }
659
+ for (
660
+ a && ((n = f), (f = d), (d = n), (e.s = -e.s)),
661
+ o = f.length,
662
+ t = d.length - o;
663
+ t > 0;
664
+ --t
665
+ )
666
+ f[o++] = 0;
667
+ for (t = d.length; t > s; ) {
668
+ if (f[--t] < d[t]) {
669
+ for (r = t; r && f[--r] === 0; ) f[r] = D - 1;
670
+ (--f[r], (f[t] += D));
671
+ }
672
+ f[t] -= d[t];
673
+ }
674
+ for (; f[--o] === 0; ) f.pop();
675
+ for (; f[0] === 0; f.shift()) --i;
676
+ return f[0]
677
+ ? ((e.d = f), (e.e = ue(f, i)), w ? p(e, u, l) : e)
678
+ : new v(l === 3 ? -0 : 0);
679
+ };
680
+ h.modulo = h.mod = function (e) {
681
+ var n,
682
+ i = this,
683
+ t = i.constructor;
684
+ return (
685
+ (e = new t(e)),
686
+ !i.d || !e.s || (e.d && !e.d[0])
687
+ ? new t(NaN)
688
+ : !e.d || (i.d && !i.d[0])
689
+ ? p(new t(i), t.precision, t.rounding)
690
+ : ((w = !1),
691
+ t.modulo == 9
692
+ ? ((n = S(i, e.abs(), 0, 3, 1)), (n.s *= e.s))
693
+ : (n = S(i, e, 0, t.modulo, 1)),
694
+ (n = n.times(e)),
695
+ (w = !0),
696
+ i.minus(n))
697
+ );
698
+ };
699
+ h.naturalExponential = h.exp = function () {
700
+ return Ee(this);
701
+ };
702
+ h.naturalLogarithm = h.ln = function () {
703
+ return B(this);
704
+ };
705
+ h.negated = h.neg = function () {
706
+ var e = new this.constructor(this);
707
+ return ((e.s = -e.s), p(e));
708
+ };
709
+ h.plus = h.add = function (e) {
710
+ var n,
711
+ i,
712
+ t,
713
+ r,
714
+ s,
715
+ o,
716
+ u,
717
+ l,
718
+ f,
719
+ c,
720
+ a = this,
721
+ d = a.constructor;
722
+ if (((e = new d(e)), !a.d || !e.d))
723
+ return (
724
+ !a.s || !e.s
725
+ ? (e = new d(NaN))
726
+ : a.d || (e = new d(e.d || a.s === e.s ? a : NaN)),
727
+ e
728
+ );
729
+ if (a.s != e.s) return ((e.s = -e.s), a.minus(e));
730
+ if (
731
+ ((f = a.d), (c = e.d), (u = d.precision), (l = d.rounding), !f[0] || !c[0])
732
+ )
733
+ return (c[0] || (e = new d(a)), w ? p(e, u, l) : e);
734
+ if (((s = b(a.e / m)), (t = b(e.e / m)), (f = f.slice()), (r = s - t), r)) {
735
+ for (
736
+ r < 0
737
+ ? ((i = f), (r = -r), (o = c.length))
738
+ : ((i = c), (t = s), (o = f.length)),
739
+ s = Math.ceil(u / m),
740
+ o = s > o ? s + 1 : o + 1,
741
+ r > o && ((r = o), (i.length = 1)),
742
+ i.reverse();
743
+ r--;
744
+ )
745
+ i.push(0);
746
+ i.reverse();
747
+ }
748
+ for (
749
+ o = f.length,
750
+ r = c.length,
751
+ o - r < 0 && ((r = o), (i = c), (c = f), (f = i)),
752
+ n = 0;
753
+ r;
754
+ )
755
+ ((n = ((f[--r] = f[r] + c[r] + n) / D) | 0), (f[r] %= D));
756
+ for (n && (f.unshift(n), ++t), o = f.length; f[--o] == 0; ) f.pop();
757
+ return ((e.d = f), (e.e = ue(f, t)), w ? p(e, u, l) : e);
758
+ };
759
+ h.precision = h.sd = function (e) {
760
+ var n,
761
+ i = this;
762
+ if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error(V + e);
763
+ return (
764
+ i.d ? ((n = Ze(i.d)), e && i.e + 1 > n && (n = i.e + 1)) : (n = NaN),
765
+ n
766
+ );
767
+ };
768
+ h.round = function () {
769
+ var e = this,
770
+ n = e.constructor;
771
+ return p(new n(e), e.e + 1, n.rounding);
772
+ };
773
+ h.sine = h.sin = function () {
774
+ var e,
775
+ n,
776
+ i = this,
777
+ t = i.constructor;
778
+ return i.isFinite()
779
+ ? i.isZero()
780
+ ? new t(i)
781
+ : ((e = t.precision),
782
+ (n = t.rounding),
783
+ (t.precision = e + Math.max(i.e, i.sd()) + m),
784
+ (t.rounding = 1),
785
+ (i = un(t, $e(t, i))),
786
+ (t.precision = e),
787
+ (t.rounding = n),
788
+ p(Z > 2 ? i.neg() : i, e, n, !0))
789
+ : new t(NaN);
790
+ };
791
+ h.squareRoot = h.sqrt = function () {
792
+ var e,
793
+ n,
794
+ i,
795
+ t,
796
+ r,
797
+ s,
798
+ o = this,
799
+ u = o.d,
800
+ l = o.e,
801
+ f = o.s,
802
+ c = o.constructor;
803
+ if (f !== 1 || !u || !u[0])
804
+ return new c(!f || (f < 0 && (!u || u[0])) ? NaN : u ? o : 1 / 0);
805
+ for (
806
+ w = !1,
807
+ f = Math.sqrt(+o),
808
+ f == 0 || f == 1 / 0
809
+ ? ((n = O(u)),
810
+ (n.length + l) % 2 == 0 && (n += "0"),
811
+ (f = Math.sqrt(n)),
812
+ (l = b((l + 1) / 2) - (l < 0 || l % 2)),
813
+ f == 1 / 0
814
+ ? (n = "5e" + l)
815
+ : ((n = f.toExponential()),
816
+ (n = n.slice(0, n.indexOf("e") + 1) + l)),
817
+ (t = new c(n)))
818
+ : (t = new c(f.toString())),
819
+ i = (l = c.precision) + 3;
820
+ ;
821
+ )
822
+ if (
823
+ ((s = t),
824
+ (t = s.plus(S(o, s, i + 2, 1)).times(0.5)),
825
+ O(s.d).slice(0, i) === (n = O(t.d)).slice(0, i))
826
+ )
827
+ if (((n = n.slice(i - 3, i + 1)), n == "9999" || (!r && n == "4999"))) {
828
+ if (!r && (p(s, l + 1, 0), s.times(s).eq(o))) {
829
+ t = s;
830
+ break;
831
+ }
832
+ ((i += 4), (r = 1));
833
+ } else {
834
+ (!+n || (!+n.slice(1) && n.charAt(0) == "5")) &&
835
+ (p(t, l + 1, 1), (e = !t.times(t).eq(o)));
836
+ break;
837
+ }
838
+ return ((w = !0), p(t, l, c.rounding, e));
839
+ };
840
+ h.tangent = h.tan = function () {
841
+ var e,
842
+ n,
843
+ i = this,
844
+ t = i.constructor;
845
+ return i.isFinite()
846
+ ? i.isZero()
847
+ ? new t(i)
848
+ : ((e = t.precision),
849
+ (n = t.rounding),
850
+ (t.precision = e + 10),
851
+ (t.rounding = 1),
852
+ (i = i.sin()),
853
+ (i.s = 1),
854
+ (i = S(i, new t(1).minus(i.times(i)).sqrt(), e + 10, 0)),
855
+ (t.precision = e),
856
+ (t.rounding = n),
857
+ p(Z == 2 || Z == 4 ? i.neg() : i, e, n, !0))
858
+ : new t(NaN);
859
+ };
860
+ h.times = h.mul = function (e) {
861
+ var n,
862
+ i,
863
+ t,
864
+ r,
865
+ s,
866
+ o,
867
+ u,
868
+ l,
869
+ f,
870
+ c = this,
871
+ a = c.constructor,
872
+ d = c.d,
873
+ g = (e = new a(e)).d;
874
+ if (((e.s *= c.s), !d || !d[0] || !g || !g[0]))
875
+ return new a(
876
+ !e.s || (d && !d[0] && !g) || (g && !g[0] && !d)
877
+ ? NaN
878
+ : !d || !g
879
+ ? e.s / 0
880
+ : e.s * 0,
881
+ );
882
+ for (
883
+ i = b(c.e / m) + b(e.e / m),
884
+ l = d.length,
885
+ f = g.length,
886
+ l < f && ((s = d), (d = g), (g = s), (o = l), (l = f), (f = o)),
887
+ s = [],
888
+ o = l + f,
889
+ t = o;
890
+ t--;
891
+ )
892
+ s.push(0);
893
+ for (t = f; --t >= 0; ) {
894
+ for (n = 0, r = l + t; r > t; )
895
+ ((u = s[r] + g[t] * d[r - t - 1] + n),
896
+ (s[r--] = (u % D) | 0),
897
+ (n = (u / D) | 0));
898
+ s[r] = ((s[r] + n) % D) | 0;
899
+ }
900
+ for (; !s[--o]; ) s.pop();
901
+ return (
902
+ n ? ++i : s.shift(),
903
+ (e.d = s),
904
+ (e.e = ue(s, i)),
905
+ w ? p(e, a.precision, a.rounding) : e
906
+ );
907
+ };
908
+ h.toBinary = function (e, n) {
909
+ return ke(this, 2, e, n);
910
+ };
911
+ h.toDecimalPlaces = h.toDP = function (e, n) {
912
+ var i = this,
913
+ t = i.constructor;
914
+ return (
915
+ (i = new t(i)),
916
+ e === void 0
917
+ ? i
918
+ : (_(e, 0, $),
919
+ n === void 0 ? (n = t.rounding) : _(n, 0, 8),
920
+ p(i, e + i.e + 1, n))
921
+ );
922
+ };
923
+ h.toExponential = function (e, n) {
924
+ var i,
925
+ t = this,
926
+ r = t.constructor;
927
+ return (
928
+ e === void 0
929
+ ? (i = F(t, !0))
930
+ : (_(e, 0, $),
931
+ n === void 0 ? (n = r.rounding) : _(n, 0, 8),
932
+ (t = p(new r(t), e + 1, n)),
933
+ (i = F(t, !0, e + 1))),
934
+ t.isNeg() && !t.isZero() ? "-" + i : i
935
+ );
936
+ };
937
+ h.toFixed = function (e, n) {
938
+ var i,
939
+ t,
940
+ r = this,
941
+ s = r.constructor;
942
+ return (
943
+ e === void 0
944
+ ? (i = F(r))
945
+ : (_(e, 0, $),
946
+ n === void 0 ? (n = s.rounding) : _(n, 0, 8),
947
+ (t = p(new s(r), e + r.e + 1, n)),
948
+ (i = F(t, !1, e + t.e + 1))),
949
+ r.isNeg() && !r.isZero() ? "-" + i : i
950
+ );
951
+ };
952
+ h.toFraction = function (e) {
953
+ var n,
954
+ i,
955
+ t,
956
+ r,
957
+ s,
958
+ o,
959
+ u,
960
+ l,
961
+ f,
962
+ c,
963
+ a,
964
+ d,
965
+ g = this,
966
+ v = g.d,
967
+ N = g.constructor;
968
+ if (!v) return new N(g);
969
+ if (
970
+ ((f = i = new N(1)),
971
+ (t = l = new N(0)),
972
+ (n = new N(t)),
973
+ (s = n.e = Ze(v) - g.e - 1),
974
+ (o = s % m),
975
+ (n.d[0] = C(10, o < 0 ? m + o : o)),
976
+ e == null)
977
+ )
978
+ e = s > 0 ? n : f;
979
+ else {
980
+ if (((u = new N(e)), !u.isInt() || u.lt(f))) throw Error(V + u);
981
+ e = u.gt(n) ? (s > 0 ? n : f) : u;
982
+ }
983
+ for (
984
+ w = !1,
985
+ u = new N(O(v)),
986
+ c = N.precision,
987
+ N.precision = s = v.length * m * 2;
988
+ (a = S(u, n, 0, 1, 1)), (r = i.plus(a.times(t))), r.cmp(e) != 1;
989
+ )
990
+ ((i = t),
991
+ (t = r),
992
+ (r = f),
993
+ (f = l.plus(a.times(r))),
994
+ (l = r),
995
+ (r = n),
996
+ (n = u.minus(a.times(r))),
997
+ (u = r));
998
+ return (
999
+ (r = S(e.minus(i), t, 0, 1, 1)),
1000
+ (l = l.plus(r.times(f))),
1001
+ (i = i.plus(r.times(t))),
1002
+ (l.s = f.s = g.s),
1003
+ (d =
1004
+ S(f, t, s, 1)
1005
+ .minus(g)
1006
+ .abs()
1007
+ .cmp(S(l, i, s, 1).minus(g).abs()) < 1
1008
+ ? [f, t]
1009
+ : [l, i]),
1010
+ (N.precision = c),
1011
+ (w = !0),
1012
+ d
1013
+ );
1014
+ };
1015
+ h.toHexadecimal = h.toHex = function (e, n) {
1016
+ return ke(this, 16, e, n);
1017
+ };
1018
+ h.toNearest = function (e, n) {
1019
+ var i = this,
1020
+ t = i.constructor;
1021
+ if (((i = new t(i)), e == null)) {
1022
+ if (!i.d) return i;
1023
+ ((e = new t(1)), (n = t.rounding));
1024
+ } else {
1025
+ if (((e = new t(e)), n === void 0 ? (n = t.rounding) : _(n, 0, 8), !i.d))
1026
+ return e.s ? i : e;
1027
+ if (!e.d) return (e.s && (e.s = i.s), e);
1028
+ }
1029
+ return (
1030
+ e.d[0]
1031
+ ? ((w = !1), (i = S(i, e, 0, n, 1).times(e)), (w = !0), p(i))
1032
+ : ((e.s = i.s), (i = e)),
1033
+ i
1034
+ );
1035
+ };
1036
+ h.toNumber = function () {
1037
+ return +this;
1038
+ };
1039
+ h.toOctal = function (e, n) {
1040
+ return ke(this, 8, e, n);
1041
+ };
1042
+ h.toPower = h.pow = function (e) {
1043
+ var n,
1044
+ i,
1045
+ t,
1046
+ r,
1047
+ s,
1048
+ o,
1049
+ u = this,
1050
+ l = u.constructor,
1051
+ f = +(e = new l(e));
1052
+ if (!u.d || !e.d || !u.d[0] || !e.d[0]) return new l(C(+u, f));
1053
+ if (((u = new l(u)), u.eq(1))) return u;
1054
+ if (((t = l.precision), (s = l.rounding), e.eq(1))) return p(u, t, s);
1055
+ if (((n = b(e.e / m)), n >= e.d.length - 1 && (i = f < 0 ? -f : f) <= tn))
1056
+ return ((r = Ue(l, u, i, t)), e.s < 0 ? new l(1).div(r) : p(r, t, s));
1057
+ if (((o = u.s), o < 0)) {
1058
+ if (n < e.d.length - 1) return new l(NaN);
1059
+ if ((e.d[n] & 1 || (o = 1), u.e == 0 && u.d[0] == 1 && u.d.length == 1))
1060
+ return ((u.s = o), u);
1061
+ }
1062
+ return (
1063
+ (i = C(+u, f)),
1064
+ (n =
1065
+ i == 0 || !isFinite(i)
1066
+ ? b(f * (Math.log("0." + O(u.d)) / Math.LN10 + u.e + 1))
1067
+ : new l(i + "").e),
1068
+ n > l.maxE + 1 || n < l.minE - 1
1069
+ ? new l(n > 0 ? o / 0 : 0)
1070
+ : ((w = !1),
1071
+ (l.rounding = u.s = 1),
1072
+ (i = Math.min(12, (n + "").length)),
1073
+ (r = Ee(e.times(B(u, t + i)), t)),
1074
+ r.d &&
1075
+ ((r = p(r, t + 5, 1)),
1076
+ x(r.d, t, s) &&
1077
+ ((n = t + 10),
1078
+ (r = p(Ee(e.times(B(u, n + i)), n), n + 5, 1)),
1079
+ +O(r.d).slice(t + 1, t + 15) + 1 == 1e14 && (r = p(r, t + 1, 0)))),
1080
+ (r.s = o),
1081
+ (w = !0),
1082
+ (l.rounding = s),
1083
+ p(r, t, s))
1084
+ );
1085
+ };
1086
+ h.toPrecision = function (e, n) {
1087
+ var i,
1088
+ t = this,
1089
+ r = t.constructor;
1090
+ return (
1091
+ e === void 0
1092
+ ? (i = F(t, t.e <= r.toExpNeg || t.e >= r.toExpPos))
1093
+ : (_(e, 1, $),
1094
+ n === void 0 ? (n = r.rounding) : _(n, 0, 8),
1095
+ (t = p(new r(t), e, n)),
1096
+ (i = F(t, e <= t.e || t.e <= r.toExpNeg, e))),
1097
+ t.isNeg() && !t.isZero() ? "-" + i : i
1098
+ );
1099
+ };
1100
+ h.toSignificantDigits = h.toSD = function (e, n) {
1101
+ var i = this,
1102
+ t = i.constructor;
1103
+ return (
1104
+ e === void 0
1105
+ ? ((e = t.precision), (n = t.rounding))
1106
+ : (_(e, 1, $), n === void 0 ? (n = t.rounding) : _(n, 0, 8)),
1107
+ p(new t(i), e, n)
1108
+ );
1109
+ };
1110
+ h.toString = function () {
1111
+ var e = this,
1112
+ n = e.constructor,
1113
+ i = F(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
1114
+ return e.isNeg() && !e.isZero() ? "-" + i : i;
1115
+ };
1116
+ h.truncated = h.trunc = function () {
1117
+ return p(new this.constructor(this), this.e + 1, 1);
1118
+ };
1119
+ h.valueOf = h.toJSON = function () {
1120
+ var e = this,
1121
+ n = e.constructor,
1122
+ i = F(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
1123
+ return e.isNeg() ? "-" + i : i;
1124
+ };
1125
+ function O(e) {
1126
+ var n,
1127
+ i,
1128
+ t,
1129
+ r = e.length - 1,
1130
+ s = "",
1131
+ o = e[0];
1132
+ if (r > 0) {
1133
+ for (s += o, n = 1; n < r; n++)
1134
+ ((t = e[n] + ""), (i = m - t.length), i && (s += U(i)), (s += t));
1135
+ ((o = e[n]), (t = o + ""), (i = m - t.length), i && (s += U(i)));
1136
+ } else if (o === 0) return "0";
1137
+ for (; o % 10 === 0; ) o /= 10;
1138
+ return s + o;
1139
+ }
1140
+ function _(e, n, i) {
1141
+ if (e !== ~~e || e < n || e > i) throw Error(V + e);
1142
+ }
1143
+ function x(e, n, i, t) {
1144
+ var r, s, o, u;
1145
+ for (s = e[0]; s >= 10; s /= 10) --n;
1146
+ return (
1147
+ --n < 0 ? ((n += m), (r = 0)) : ((r = Math.ceil((n + 1) / m)), (n %= m)),
1148
+ (s = C(10, m - n)),
1149
+ (u = (e[r] % s) | 0),
1150
+ t == null
1151
+ ? n < 3
1152
+ ? (n == 0 ? (u = (u / 100) | 0) : n == 1 && (u = (u / 10) | 0),
1153
+ (o =
1154
+ (i < 4 && u == 99999) ||
1155
+ (i > 3 && u == 49999) ||
1156
+ u == 5e4 ||
1157
+ u == 0))
1158
+ : (o =
1159
+ (((i < 4 && u + 1 == s) || (i > 3 && u + 1 == s / 2)) &&
1160
+ ((e[r + 1] / s / 100) | 0) == C(10, n - 2) - 1) ||
1161
+ ((u == s / 2 || u == 0) && ((e[r + 1] / s / 100) | 0) == 0))
1162
+ : n < 4
1163
+ ? (n == 0
1164
+ ? (u = (u / 1e3) | 0)
1165
+ : n == 1
1166
+ ? (u = (u / 100) | 0)
1167
+ : n == 2 && (u = (u / 10) | 0),
1168
+ (o = ((t || i < 4) && u == 9999) || (!t && i > 3 && u == 4999)))
1169
+ : (o =
1170
+ (((t || i < 4) && u + 1 == s) || (!t && i > 3 && u + 1 == s / 2)) &&
1171
+ ((e[r + 1] / s / 1e3) | 0) == C(10, n - 3) - 1),
1172
+ o
1173
+ );
1174
+ }
1175
+ function ie(e, n, i) {
1176
+ for (var t, r = [0], s, o = 0, u = e.length; o < u; ) {
1177
+ for (s = r.length; s--; ) r[s] *= n;
1178
+ for (r[0] += we.indexOf(e.charAt(o++)), t = 0; t < r.length; t++)
1179
+ r[t] > i - 1 &&
1180
+ (r[t + 1] === void 0 && (r[t + 1] = 0),
1181
+ (r[t + 1] += (r[t] / i) | 0),
1182
+ (r[t] %= i));
1183
+ }
1184
+ return r.reverse();
1185
+ }
1186
+ function sn(e, n) {
1187
+ var i, t, r;
1188
+ if (n.isZero()) return n;
1189
+ ((t = n.d.length),
1190
+ t < 32
1191
+ ? ((i = Math.ceil(t / 3)), (r = (1 / fe(4, i)).toString()))
1192
+ : ((i = 16), (r = "2.3283064365386962890625e-10")),
1193
+ (e.precision += i),
1194
+ (n = j(e, 1, n.times(r), new e(1))));
1195
+ for (var s = i; s--; ) {
1196
+ var o = n.times(n);
1197
+ n = o.times(o).minus(o).times(8).plus(1);
1198
+ }
1199
+ return ((e.precision -= i), n);
1200
+ }
1201
+ var S = (function () {
1202
+ function e(t, r, s) {
1203
+ var o,
1204
+ u = 0,
1205
+ l = t.length;
1206
+ for (t = t.slice(); l--; )
1207
+ ((o = t[l] * r + u), (t[l] = (o % s) | 0), (u = (o / s) | 0));
1208
+ return (u && t.unshift(u), t);
1209
+ }
1210
+ function n(t, r, s, o) {
1211
+ var u, l;
1212
+ if (s != o) l = s > o ? 1 : -1;
1213
+ else
1214
+ for (u = l = 0; u < s; u++)
1215
+ if (t[u] != r[u]) {
1216
+ l = t[u] > r[u] ? 1 : -1;
1217
+ break;
1218
+ }
1219
+ return l;
1220
+ }
1221
+ function i(t, r, s, o) {
1222
+ for (var u = 0; s--; )
1223
+ ((t[s] -= u), (u = t[s] < r[s] ? 1 : 0), (t[s] = u * o + t[s] - r[s]));
1224
+ for (; !t[0] && t.length > 1; ) t.shift();
1225
+ }
1226
+ return function (t, r, s, o, u, l) {
1227
+ var f,
1228
+ c,
1229
+ a,
1230
+ d,
1231
+ g,
1232
+ v,
1233
+ N,
1234
+ A,
1235
+ M,
1236
+ q,
1237
+ E,
1238
+ P,
1239
+ Y,
1240
+ I,
1241
+ le,
1242
+ z,
1243
+ W,
1244
+ ce,
1245
+ T,
1246
+ y,
1247
+ ee = t.constructor,
1248
+ ae = t.s == r.s ? 1 : -1,
1249
+ R = t.d,
1250
+ k = r.d;
1251
+ if (!R || !R[0] || !k || !k[0])
1252
+ return new ee(
1253
+ !t.s || !r.s || (R ? k && R[0] == k[0] : !k)
1254
+ ? NaN
1255
+ : (R && R[0] == 0) || !k
1256
+ ? ae * 0
1257
+ : ae / 0,
1258
+ );
1259
+ for (
1260
+ l
1261
+ ? ((g = 1), (c = t.e - r.e))
1262
+ : ((l = D), (g = m), (c = b(t.e / g) - b(r.e / g))),
1263
+ T = k.length,
1264
+ W = R.length,
1265
+ M = new ee(ae),
1266
+ q = M.d = [],
1267
+ a = 0;
1268
+ k[a] == (R[a] || 0);
1269
+ a++
1270
+ );
1271
+ if (
1272
+ (k[a] > (R[a] || 0) && c--,
1273
+ s == null
1274
+ ? ((I = s = ee.precision), (o = ee.rounding))
1275
+ : u
1276
+ ? (I = s + (t.e - r.e) + 1)
1277
+ : (I = s),
1278
+ I < 0)
1279
+ )
1280
+ (q.push(1), (v = !0));
1281
+ else {
1282
+ if (((I = (I / g + 2) | 0), (a = 0), T == 1)) {
1283
+ for (d = 0, k = k[0], I++; (a < W || d) && I--; a++)
1284
+ ((le = d * l + (R[a] || 0)),
1285
+ (q[a] = (le / k) | 0),
1286
+ (d = (le % k) | 0));
1287
+ v = d || a < W;
1288
+ } else {
1289
+ for (
1290
+ d = (l / (k[0] + 1)) | 0,
1291
+ d > 1 &&
1292
+ ((k = e(k, d, l)),
1293
+ (R = e(R, d, l)),
1294
+ (T = k.length),
1295
+ (W = R.length)),
1296
+ z = T,
1297
+ E = R.slice(0, T),
1298
+ P = E.length;
1299
+ P < T;
1300
+ )
1301
+ E[P++] = 0;
1302
+ ((y = k.slice()), y.unshift(0), (ce = k[0]), k[1] >= l / 2 && ++ce);
1303
+ do
1304
+ ((d = 0),
1305
+ (f = n(k, E, T, P)),
1306
+ f < 0
1307
+ ? ((Y = E[0]),
1308
+ T != P && (Y = Y * l + (E[1] || 0)),
1309
+ (d = (Y / ce) | 0),
1310
+ d > 1
1311
+ ? (d >= l && (d = l - 1),
1312
+ (N = e(k, d, l)),
1313
+ (A = N.length),
1314
+ (P = E.length),
1315
+ (f = n(N, E, A, P)),
1316
+ f == 1 && (d--, i(N, T < A ? y : k, A, l)))
1317
+ : (d == 0 && (f = d = 1), (N = k.slice())),
1318
+ (A = N.length),
1319
+ A < P && N.unshift(0),
1320
+ i(E, N, P, l),
1321
+ f == -1 &&
1322
+ ((P = E.length),
1323
+ (f = n(k, E, T, P)),
1324
+ f < 1 && (d++, i(E, T < P ? y : k, P, l))),
1325
+ (P = E.length))
1326
+ : f === 0 && (d++, (E = [0])),
1327
+ (q[a++] = d),
1328
+ f && E[0] ? (E[P++] = R[z] || 0) : ((E = [R[z]]), (P = 1)));
1329
+ while ((z++ < W || E[0] !== void 0) && I--);
1330
+ v = E[0] !== void 0;
1331
+ }
1332
+ q[0] || q.shift();
1333
+ }
1334
+ if (g == 1) ((M.e = c), (Te = v));
1335
+ else {
1336
+ for (a = 1, d = q[0]; d >= 10; d /= 10) a++;
1337
+ ((M.e = a + c * g - 1), p(M, u ? s + M.e + 1 : s, o, v));
1338
+ }
1339
+ return M;
1340
+ };
1341
+ })();
1342
+ function p(e, n, i, t) {
1343
+ var r,
1344
+ s,
1345
+ o,
1346
+ u,
1347
+ l,
1348
+ f,
1349
+ c,
1350
+ a,
1351
+ d,
1352
+ g = e.constructor;
1353
+ e: if (n != null) {
1354
+ if (((a = e.d), !a)) return e;
1355
+ for (r = 1, u = a[0]; u >= 10; u /= 10) r++;
1356
+ if (((s = n - r), s < 0))
1357
+ ((s += m),
1358
+ (o = n),
1359
+ (c = a[(d = 0)]),
1360
+ (l = ((c / C(10, r - o - 1)) % 10) | 0));
1361
+ else if (((d = Math.ceil((s + 1) / m)), (u = a.length), d >= u))
1362
+ if (t) {
1363
+ for (; u++ <= d; ) a.push(0);
1364
+ ((c = l = 0), (r = 1), (s %= m), (o = s - m + 1));
1365
+ } else break e;
1366
+ else {
1367
+ for (c = u = a[d], r = 1; u >= 10; u /= 10) r++;
1368
+ ((s %= m),
1369
+ (o = s - m + r),
1370
+ (l = o < 0 ? 0 : ((c / C(10, r - o - 1)) % 10) | 0));
1371
+ }
1372
+ if (
1373
+ ((t =
1374
+ t ||
1375
+ n < 0 ||
1376
+ a[d + 1] !== void 0 ||
1377
+ (o < 0 ? c : c % C(10, r - o - 1))),
1378
+ (f =
1379
+ i < 4
1380
+ ? (l || t) && (i == 0 || i == (e.s < 0 ? 3 : 2))
1381
+ : l > 5 ||
1382
+ (l == 5 &&
1383
+ (i == 4 ||
1384
+ t ||
1385
+ (i == 6 &&
1386
+ ((s > 0 ? (o > 0 ? c / C(10, r - o) : 0) : a[d - 1]) % 10) &
1387
+ 1) ||
1388
+ i == (e.s < 0 ? 8 : 7)))),
1389
+ n < 1 || !a[0])
1390
+ )
1391
+ return (
1392
+ (a.length = 0),
1393
+ f
1394
+ ? ((n -= e.e + 1), (a[0] = C(10, (m - (n % m)) % m)), (e.e = -n || 0))
1395
+ : (a[0] = e.e = 0),
1396
+ e
1397
+ );
1398
+ if (
1399
+ (s == 0
1400
+ ? ((a.length = d), (u = 1), d--)
1401
+ : ((a.length = d + 1),
1402
+ (u = C(10, m - s)),
1403
+ (a[d] = o > 0 ? (((c / C(10, r - o)) % C(10, o)) | 0) * u : 0)),
1404
+ f)
1405
+ )
1406
+ for (;;)
1407
+ if (d == 0) {
1408
+ for (s = 1, o = a[0]; o >= 10; o /= 10) s++;
1409
+ for (o = a[0] += u, u = 1; o >= 10; o /= 10) u++;
1410
+ s != u && (e.e++, a[0] == D && (a[0] = 1));
1411
+ break;
1412
+ } else {
1413
+ if (((a[d] += u), a[d] != D)) break;
1414
+ ((a[d--] = 0), (u = 1));
1415
+ }
1416
+ for (s = a.length; a[--s] === 0; ) a.pop();
1417
+ }
1418
+ return (
1419
+ w &&
1420
+ (e.e > g.maxE
1421
+ ? ((e.d = null), (e.e = NaN))
1422
+ : e.e < g.minE && ((e.e = 0), (e.d = [0]))),
1423
+ e
1424
+ );
1425
+ }
1426
+ function F(e, n, i) {
1427
+ if (!e.isFinite()) return Ve(e);
1428
+ var t,
1429
+ r = e.e,
1430
+ s = O(e.d),
1431
+ o = s.length;
1432
+ return (
1433
+ n
1434
+ ? (i && (t = i - o) > 0
1435
+ ? (s = s.charAt(0) + "." + s.slice(1) + U(t))
1436
+ : o > 1 && (s = s.charAt(0) + "." + s.slice(1)),
1437
+ (s = s + (e.e < 0 ? "e" : "e+") + e.e))
1438
+ : r < 0
1439
+ ? ((s = "0." + U(-r - 1) + s), i && (t = i - o) > 0 && (s += U(t)))
1440
+ : r >= o
1441
+ ? ((s += U(r + 1 - o)),
1442
+ i && (t = i - r - 1) > 0 && (s = s + "." + U(t)))
1443
+ : ((t = r + 1) < o && (s = s.slice(0, t) + "." + s.slice(t)),
1444
+ i && (t = i - o) > 0 && (r + 1 === o && (s += "."), (s += U(t)))),
1445
+ s
1446
+ );
1447
+ }
1448
+ function ue(e, n) {
1449
+ var i = e[0];
1450
+ for (n *= m; i >= 10; i /= 10) n++;
1451
+ return n;
1452
+ }
1453
+ function se(e, n, i) {
1454
+ if (n > rn) throw ((w = !0), i && (e.precision = i), Error(Le));
1455
+ return p(new e(te), n, 1, !0);
1456
+ }
1457
+ function L(e, n, i) {
1458
+ if (n > ve) throw Error(Le);
1459
+ return p(new e(re), n, i, !0);
1460
+ }
1461
+ function Ze(e) {
1462
+ var n = e.length - 1,
1463
+ i = n * m + 1;
1464
+ if (((n = e[n]), n)) {
1465
+ for (; n % 10 == 0; n /= 10) i--;
1466
+ for (n = e[0]; n >= 10; n /= 10) i++;
1467
+ }
1468
+ return i;
1469
+ }
1470
+ function U(e) {
1471
+ for (var n = ""; e--; ) n += "0";
1472
+ return n;
1473
+ }
1474
+ function Ue(e, n, i, t) {
1475
+ var r,
1476
+ s = new e(1),
1477
+ o = Math.ceil(t / m + 4);
1478
+ for (w = !1; ; ) {
1479
+ if (
1480
+ (i % 2 && ((s = s.times(n)), _e(s.d, o) && (r = !0)),
1481
+ (i = b(i / 2)),
1482
+ i === 0)
1483
+ ) {
1484
+ ((i = s.d.length - 1), r && s.d[i] === 0 && ++s.d[i]);
1485
+ break;
1486
+ }
1487
+ ((n = n.times(n)), _e(n.d, o));
1488
+ }
1489
+ return ((w = !0), s);
1490
+ }
1491
+ function Ae(e) {
1492
+ return e.d[e.d.length - 1] & 1;
1493
+ }
1494
+ function Be(e, n, i) {
1495
+ for (var t, r = new e(n[0]), s = 0; ++s < n.length; )
1496
+ if (((t = new e(n[s])), t.s)) r[i](t) && (r = t);
1497
+ else {
1498
+ r = t;
1499
+ break;
1500
+ }
1501
+ return r;
1502
+ }
1503
+ function Ee(e, n) {
1504
+ var i,
1505
+ t,
1506
+ r,
1507
+ s,
1508
+ o,
1509
+ u,
1510
+ l,
1511
+ f = 0,
1512
+ c = 0,
1513
+ a = 0,
1514
+ d = e.constructor,
1515
+ g = d.rounding,
1516
+ v = d.precision;
1517
+ if (!e.d || !e.d[0] || e.e > 17)
1518
+ return new d(
1519
+ e.d
1520
+ ? e.d[0]
1521
+ ? e.s < 0
1522
+ ? 0
1523
+ : 1 / 0
1524
+ : 1
1525
+ : e.s
1526
+ ? e.s < 0
1527
+ ? 0
1528
+ : e
1529
+ : NaN,
1530
+ );
1531
+ for (
1532
+ n == null ? ((w = !1), (l = v)) : (l = n), u = new d(0.03125);
1533
+ e.e > -2;
1534
+ )
1535
+ ((e = e.times(u)), (a += 5));
1536
+ for (
1537
+ t = ((Math.log(C(2, a)) / Math.LN10) * 2 + 5) | 0,
1538
+ l += t,
1539
+ i = s = o = new d(1),
1540
+ d.precision = l;
1541
+ ;
1542
+ ) {
1543
+ if (
1544
+ ((s = p(s.times(e), l, 1)),
1545
+ (i = i.times(++c)),
1546
+ (u = o.plus(S(s, i, l, 1))),
1547
+ O(u.d).slice(0, l) === O(o.d).slice(0, l))
1548
+ ) {
1549
+ for (r = a; r--; ) o = p(o.times(o), l, 1);
1550
+ if (n == null)
1551
+ if (f < 3 && x(o.d, l - t, g, f))
1552
+ ((d.precision = l += 10), (i = s = u = new d(1)), (c = 0), f++);
1553
+ else return p(o, (d.precision = v), g, (w = !0));
1554
+ else return ((d.precision = v), o);
1555
+ }
1556
+ o = u;
1557
+ }
1558
+ }
1559
+ function B(e, n) {
1560
+ var i,
1561
+ t,
1562
+ r,
1563
+ s,
1564
+ o,
1565
+ u,
1566
+ l,
1567
+ f,
1568
+ c,
1569
+ a,
1570
+ d,
1571
+ g = 1,
1572
+ v = 10,
1573
+ N = e,
1574
+ A = N.d,
1575
+ M = N.constructor,
1576
+ q = M.rounding,
1577
+ E = M.precision;
1578
+ if (N.s < 0 || !A || !A[0] || (!N.e && A[0] == 1 && A.length == 1))
1579
+ return new M(A && !A[0] ? -1 / 0 : N.s != 1 ? NaN : A ? 0 : N);
1580
+ if (
1581
+ (n == null ? ((w = !1), (c = E)) : (c = n),
1582
+ (M.precision = c += v),
1583
+ (i = O(A)),
1584
+ (t = i.charAt(0)),
1585
+ Math.abs((s = N.e)) < 15e14)
1586
+ ) {
1587
+ for (; (t < 7 && t != 1) || (t == 1 && i.charAt(1) > 3); )
1588
+ ((N = N.times(e)), (i = O(N.d)), (t = i.charAt(0)), g++);
1589
+ ((s = N.e),
1590
+ t > 1 ? ((N = new M("0." + i)), s++) : (N = new M(t + "." + i.slice(1))));
1591
+ } else
1592
+ return (
1593
+ (f = se(M, c + 2, E).times(s + "")),
1594
+ (N = B(new M(t + "." + i.slice(1)), c - v).plus(f)),
1595
+ (M.precision = E),
1596
+ n == null ? p(N, E, q, (w = !0)) : N
1597
+ );
1598
+ for (
1599
+ a = N,
1600
+ l = o = N = S(N.minus(1), N.plus(1), c, 1),
1601
+ d = p(N.times(N), c, 1),
1602
+ r = 3;
1603
+ ;
1604
+ ) {
1605
+ if (
1606
+ ((o = p(o.times(d), c, 1)),
1607
+ (f = l.plus(S(o, new M(r), c, 1))),
1608
+ O(f.d).slice(0, c) === O(l.d).slice(0, c))
1609
+ )
1610
+ if (
1611
+ ((l = l.times(2)),
1612
+ s !== 0 && (l = l.plus(se(M, c + 2, E).times(s + ""))),
1613
+ (l = S(l, new M(g), c, 1)),
1614
+ n == null)
1615
+ )
1616
+ if (x(l.d, c - v, q, u))
1617
+ ((M.precision = c += v),
1618
+ (f = o = N = S(a.minus(1), a.plus(1), c, 1)),
1619
+ (d = p(N.times(N), c, 1)),
1620
+ (r = u = 1));
1621
+ else return p(l, (M.precision = E), q, (w = !0));
1622
+ else return ((M.precision = E), l);
1623
+ ((l = f), (r += 2));
1624
+ }
1625
+ }
1626
+ function Ve(e) {
1627
+ return String((e.s * e.s) / 0);
1628
+ }
1629
+ function Se(e, n) {
1630
+ var i, t, r;
1631
+ for (
1632
+ (i = n.indexOf(".")) > -1 && (n = n.replace(".", "")),
1633
+ (t = n.search(/e/i)) > 0
1634
+ ? (i < 0 && (i = t), (i += +n.slice(t + 1)), (n = n.substring(0, t)))
1635
+ : i < 0 && (i = n.length),
1636
+ t = 0;
1637
+ n.charCodeAt(t) === 48;
1638
+ t++
1639
+ );
1640
+ for (r = n.length; n.charCodeAt(r - 1) === 48; --r);
1641
+ if (((n = n.slice(t, r)), n)) {
1642
+ if (
1643
+ ((r -= t),
1644
+ (e.e = i = i - t - 1),
1645
+ (e.d = []),
1646
+ (t = (i + 1) % m),
1647
+ i < 0 && (t += m),
1648
+ t < r)
1649
+ ) {
1650
+ for (t && e.d.push(+n.slice(0, t)), r -= m; t < r; )
1651
+ e.d.push(+n.slice(t, (t += m)));
1652
+ ((n = n.slice(t)), (t = m - n.length));
1653
+ } else t -= r;
1654
+ for (; t--; ) n += "0";
1655
+ (e.d.push(+n),
1656
+ w &&
1657
+ (e.e > e.constructor.maxE
1658
+ ? ((e.d = null), (e.e = NaN))
1659
+ : e.e < e.constructor.minE && ((e.e = 0), (e.d = [0]))));
1660
+ } else ((e.e = 0), (e.d = [0]));
1661
+ return e;
1662
+ }
1663
+ function on(e, n) {
1664
+ var i, t, r, s, o, u, l, f, c;
1665
+ if (n.indexOf("_") > -1) {
1666
+ if (((n = n.replace(/(\d)_(?=\d)/g, "$1")), Ie.test(n))) return Se(e, n);
1667
+ } else if (n === "Infinity" || n === "NaN")
1668
+ return (+n || (e.s = NaN), (e.e = NaN), (e.d = null), e);
1669
+ if (en.test(n)) ((i = 16), (n = n.toLowerCase()));
1670
+ else if (ye.test(n)) i = 2;
1671
+ else if (nn.test(n)) i = 8;
1672
+ else throw Error(V + n);
1673
+ for (
1674
+ s = n.search(/p/i),
1675
+ s > 0
1676
+ ? ((l = +n.slice(s + 1)), (n = n.substring(2, s)))
1677
+ : (n = n.slice(2)),
1678
+ s = n.indexOf("."),
1679
+ o = s >= 0,
1680
+ t = e.constructor,
1681
+ o &&
1682
+ ((n = n.replace(".", "")),
1683
+ (u = n.length),
1684
+ (s = u - s),
1685
+ (r = Ue(t, new t(i), s, s * 2))),
1686
+ f = ie(n, i, D),
1687
+ c = f.length - 1,
1688
+ s = c;
1689
+ f[s] === 0;
1690
+ --s
1691
+ )
1692
+ f.pop();
1693
+ return s < 0
1694
+ ? new t(e.s * 0)
1695
+ : ((e.e = ue(f, c)),
1696
+ (e.d = f),
1697
+ (w = !1),
1698
+ o && (e = S(e, r, u * 4)),
1699
+ l && (e = e.times(Math.abs(l) < 54 ? C(2, l) : Q.pow(2, l))),
1700
+ (w = !0),
1701
+ e);
1702
+ }
1703
+ function un(e, n) {
1704
+ var i,
1705
+ t = n.d.length;
1706
+ if (t < 3) return n.isZero() ? n : j(e, 2, n, n);
1707
+ ((i = 1.4 * Math.sqrt(t)),
1708
+ (i = i > 16 ? 16 : i | 0),
1709
+ (n = n.times(1 / fe(5, i))),
1710
+ (n = j(e, 2, n, n)));
1711
+ for (var r, s = new e(5), o = new e(16), u = new e(20); i--; )
1712
+ ((r = n.times(n)), (n = n.times(s.plus(r.times(o.times(r).minus(u))))));
1713
+ return n;
1714
+ }
1715
+ function j(e, n, i, t, r) {
1716
+ var s,
1717
+ o,
1718
+ u,
1719
+ l,
1720
+ f = 1,
1721
+ c = e.precision,
1722
+ a = Math.ceil(c / m);
1723
+ for (w = !1, l = i.times(i), u = new e(t); ; ) {
1724
+ if (
1725
+ ((o = S(u.times(l), new e(n++ * n++), c, 1)),
1726
+ (u = r ? t.plus(o) : t.minus(o)),
1727
+ (t = S(o.times(l), new e(n++ * n++), c, 1)),
1728
+ (o = u.plus(t)),
1729
+ o.d[a] !== void 0)
1730
+ ) {
1731
+ for (s = a; o.d[s] === u.d[s] && s--; );
1732
+ if (s == -1) break;
1733
+ }
1734
+ ((s = u), (u = t), (t = o), (o = s), f++);
1735
+ }
1736
+ return ((w = !0), (o.d.length = a + 1), o);
1737
+ }
1738
+ function fe(e, n) {
1739
+ for (var i = e; --n; ) i *= e;
1740
+ return i;
1741
+ }
1742
+ function $e(e, n) {
1743
+ var i,
1744
+ t = n.s < 0,
1745
+ r = L(e, e.precision, 1),
1746
+ s = r.times(0.5);
1747
+ if (((n = n.abs()), n.lte(s))) return ((Z = t ? 4 : 1), n);
1748
+ if (((i = n.divToInt(r)), i.isZero())) Z = t ? 3 : 2;
1749
+ else {
1750
+ if (((n = n.minus(i.times(r))), n.lte(s)))
1751
+ return ((Z = Ae(i) ? (t ? 2 : 3) : t ? 4 : 1), n);
1752
+ Z = Ae(i) ? (t ? 1 : 4) : t ? 3 : 2;
1753
+ }
1754
+ return n.minus(r).abs();
1755
+ }
1756
+ function ke(e, n, i, t) {
1757
+ var r,
1758
+ s,
1759
+ o,
1760
+ u,
1761
+ l,
1762
+ f,
1763
+ c,
1764
+ a,
1765
+ d,
1766
+ g = e.constructor,
1767
+ v = i !== void 0;
1768
+ if (
1769
+ (v
1770
+ ? (_(i, 1, $), t === void 0 ? (t = g.rounding) : _(t, 0, 8))
1771
+ : ((i = g.precision), (t = g.rounding)),
1772
+ !e.isFinite())
1773
+ )
1774
+ c = Ve(e);
1775
+ else {
1776
+ for (
1777
+ c = F(e),
1778
+ o = c.indexOf("."),
1779
+ v
1780
+ ? ((r = 2), n == 16 ? (i = i * 4 - 3) : n == 8 && (i = i * 3 - 2))
1781
+ : (r = n),
1782
+ o >= 0 &&
1783
+ ((c = c.replace(".", "")),
1784
+ (d = new g(1)),
1785
+ (d.e = c.length - o),
1786
+ (d.d = ie(F(d), 10, r)),
1787
+ (d.e = d.d.length)),
1788
+ a = ie(c, 10, r),
1789
+ s = l = a.length;
1790
+ a[--l] == 0;
1791
+ )
1792
+ a.pop();
1793
+ if (!a[0]) c = v ? "0p+0" : "0";
1794
+ else {
1795
+ if (
1796
+ (o < 0
1797
+ ? s--
1798
+ : ((e = new g(e)),
1799
+ (e.d = a),
1800
+ (e.e = s),
1801
+ (e = S(e, d, i, t, 0, r)),
1802
+ (a = e.d),
1803
+ (s = e.e),
1804
+ (f = Te)),
1805
+ (o = a[i]),
1806
+ (u = r / 2),
1807
+ (f = f || a[i + 1] !== void 0),
1808
+ (f =
1809
+ t < 4
1810
+ ? (o !== void 0 || f) && (t === 0 || t === (e.s < 0 ? 3 : 2))
1811
+ : o > u ||
1812
+ (o === u &&
1813
+ (t === 4 ||
1814
+ f ||
1815
+ (t === 6 && a[i - 1] & 1) ||
1816
+ t === (e.s < 0 ? 8 : 7)))),
1817
+ (a.length = i),
1818
+ f)
1819
+ )
1820
+ for (; ++a[--i] > r - 1; ) ((a[i] = 0), i || (++s, a.unshift(1)));
1821
+ for (l = a.length; !a[l - 1]; --l);
1822
+ for (o = 0, c = ""; o < l; o++) c += we.charAt(a[o]);
1823
+ if (v) {
1824
+ if (l > 1)
1825
+ if (n == 16 || n == 8) {
1826
+ for (o = n == 16 ? 4 : 3, --l; l % o; l++) c += "0";
1827
+ for (a = ie(c, r, n), l = a.length; !a[l - 1]; --l);
1828
+ for (o = 1, c = "1."; o < l; o++) c += we.charAt(a[o]);
1829
+ } else c = c.charAt(0) + "." + c.slice(1);
1830
+ c = c + (s < 0 ? "p" : "p+") + s;
1831
+ } else if (s < 0) {
1832
+ for (; ++s; ) c = "0" + c;
1833
+ c = "0." + c;
1834
+ } else if (++s > l) for (s -= l; s--; ) c += "0";
1835
+ else s < l && (c = c.slice(0, s) + "." + c.slice(s));
1836
+ }
1837
+ c = (n == 16 ? "0x" : n == 2 ? "0b" : n == 8 ? "0o" : "") + c;
1838
+ }
1839
+ return e.s < 0 ? "-" + c : c;
1840
+ }
1841
+ function _e(e, n) {
1842
+ if (e.length > n) return ((e.length = n), !0);
1843
+ }
1844
+ function fn(e) {
1845
+ return new this(e).abs();
1846
+ }
1847
+ function ln(e) {
1848
+ return new this(e).acos();
1849
+ }
1850
+ function cn(e) {
1851
+ return new this(e).acosh();
1852
+ }
1853
+ function an(e, n) {
1854
+ return new this(e).plus(n);
1855
+ }
1856
+ function dn(e) {
1857
+ return new this(e).asin();
1858
+ }
1859
+ function hn(e) {
1860
+ return new this(e).asinh();
1861
+ }
1862
+ function pn(e) {
1863
+ return new this(e).atan();
1864
+ }
1865
+ function gn(e) {
1866
+ return new this(e).atanh();
1867
+ }
1868
+ function mn(e, n) {
1869
+ ((e = new this(e)), (n = new this(n)));
1870
+ var i,
1871
+ t = this.precision,
1872
+ r = this.rounding,
1873
+ s = t + 4;
1874
+ return (
1875
+ !e.s || !n.s
1876
+ ? (i = new this(NaN))
1877
+ : !e.d && !n.d
1878
+ ? ((i = L(this, s, 1).times(n.s > 0 ? 0.25 : 0.75)), (i.s = e.s))
1879
+ : !n.d || e.isZero()
1880
+ ? ((i = n.s < 0 ? L(this, t, r) : new this(0)), (i.s = e.s))
1881
+ : !e.d || n.isZero()
1882
+ ? ((i = L(this, s, 1).times(0.5)), (i.s = e.s))
1883
+ : n.s < 0
1884
+ ? ((this.precision = s),
1885
+ (this.rounding = 1),
1886
+ (i = this.atan(S(e, n, s, 1))),
1887
+ (n = L(this, s, 1)),
1888
+ (this.precision = t),
1889
+ (this.rounding = r),
1890
+ (i = e.s < 0 ? i.minus(n) : i.plus(n)))
1891
+ : (i = this.atan(S(e, n, s, 1))),
1892
+ i
1893
+ );
1894
+ }
1895
+ function wn(e) {
1896
+ return new this(e).cbrt();
1897
+ }
1898
+ function Nn(e) {
1899
+ return p((e = new this(e)), e.e + 1, 2);
1900
+ }
1901
+ function vn(e, n, i) {
1902
+ return new this(e).clamp(n, i);
1903
+ }
1904
+ function En(e) {
1905
+ if (!e || typeof e != "object") throw Error(oe + "Object expected");
1906
+ var n,
1907
+ i,
1908
+ t,
1909
+ r = e.defaults === !0,
1910
+ s = [
1911
+ "precision",
1912
+ 1,
1913
+ $,
1914
+ "rounding",
1915
+ 0,
1916
+ 8,
1917
+ "toExpNeg",
1918
+ -H,
1919
+ 0,
1920
+ "toExpPos",
1921
+ 0,
1922
+ H,
1923
+ "maxE",
1924
+ 0,
1925
+ H,
1926
+ "minE",
1927
+ -H,
1928
+ 0,
1929
+ "modulo",
1930
+ 0,
1931
+ 9,
1932
+ ];
1933
+ for (n = 0; n < s.length; n += 3)
1934
+ if (((i = s[n]), r && (this[i] = Ne[i]), (t = e[i]) !== void 0))
1935
+ if (b(t) === t && t >= s[n + 1] && t <= s[n + 2]) this[i] = t;
1936
+ else throw Error(V + i + ": " + t);
1937
+ if (((i = "crypto"), r && (this[i] = Ne[i]), (t = e[i]) !== void 0))
1938
+ if (t === !0 || t === !1 || t === 0 || t === 1)
1939
+ if (t)
1940
+ if (
1941
+ typeof crypto < "u" &&
1942
+ crypto &&
1943
+ (crypto.getRandomValues || crypto.randomBytes)
1944
+ )
1945
+ this[i] = !0;
1946
+ else throw Error(De);
1947
+ else this[i] = !1;
1948
+ else throw Error(V + i + ": " + t);
1949
+ return this;
1950
+ }
1951
+ function Sn(e) {
1952
+ return new this(e).cos();
1953
+ }
1954
+ function kn(e) {
1955
+ return new this(e).cosh();
1956
+ }
1957
+ function He(e) {
1958
+ var n, i, t;
1959
+ function r(s) {
1960
+ var o,
1961
+ u,
1962
+ l,
1963
+ f = this;
1964
+ if (!(f instanceof r)) return new r(s);
1965
+ if (((f.constructor = r), qe(s))) {
1966
+ ((f.s = s.s),
1967
+ w
1968
+ ? !s.d || s.e > r.maxE
1969
+ ? ((f.e = NaN), (f.d = null))
1970
+ : s.e < r.minE
1971
+ ? ((f.e = 0), (f.d = [0]))
1972
+ : ((f.e = s.e), (f.d = s.d.slice()))
1973
+ : ((f.e = s.e), (f.d = s.d ? s.d.slice() : s.d)));
1974
+ return;
1975
+ }
1976
+ if (((l = typeof s), l === "number")) {
1977
+ if (s === 0) {
1978
+ ((f.s = 1 / s < 0 ? -1 : 1), (f.e = 0), (f.d = [0]));
1979
+ return;
1980
+ }
1981
+ if ((s < 0 ? ((s = -s), (f.s = -1)) : (f.s = 1), s === ~~s && s < 1e7)) {
1982
+ for (o = 0, u = s; u >= 10; u /= 10) o++;
1983
+ w
1984
+ ? o > r.maxE
1985
+ ? ((f.e = NaN), (f.d = null))
1986
+ : o < r.minE
1987
+ ? ((f.e = 0), (f.d = [0]))
1988
+ : ((f.e = o), (f.d = [s]))
1989
+ : ((f.e = o), (f.d = [s]));
1990
+ return;
1991
+ } else if (s * 0 !== 0) {
1992
+ (s || (f.s = NaN), (f.e = NaN), (f.d = null));
1993
+ return;
1994
+ }
1995
+ return Se(f, s.toString());
1996
+ } else if (l !== "string") throw Error(V + s);
1997
+ return (
1998
+ (u = s.charCodeAt(0)) === 45
1999
+ ? ((s = s.slice(1)), (f.s = -1))
2000
+ : (u === 43 && (s = s.slice(1)), (f.s = 1)),
2001
+ Ie.test(s) ? Se(f, s) : on(f, s)
2002
+ );
2003
+ }
2004
+ if (
2005
+ ((r.prototype = h),
2006
+ (r.ROUND_UP = 0),
2007
+ (r.ROUND_DOWN = 1),
2008
+ (r.ROUND_CEIL = 2),
2009
+ (r.ROUND_FLOOR = 3),
2010
+ (r.ROUND_HALF_UP = 4),
2011
+ (r.ROUND_HALF_DOWN = 5),
2012
+ (r.ROUND_HALF_EVEN = 6),
2013
+ (r.ROUND_HALF_CEIL = 7),
2014
+ (r.ROUND_HALF_FLOOR = 8),
2015
+ (r.EUCLID = 9),
2016
+ (r.config = r.set = En),
2017
+ (r.clone = He),
2018
+ (r.isDecimal = qe),
2019
+ (r.abs = fn),
2020
+ (r.acos = ln),
2021
+ (r.acosh = cn),
2022
+ (r.add = an),
2023
+ (r.asin = dn),
2024
+ (r.asinh = hn),
2025
+ (r.atan = pn),
2026
+ (r.atanh = gn),
2027
+ (r.atan2 = mn),
2028
+ (r.cbrt = wn),
2029
+ (r.ceil = Nn),
2030
+ (r.clamp = vn),
2031
+ (r.cos = Sn),
2032
+ (r.cosh = kn),
2033
+ (r.div = Mn),
2034
+ (r.exp = Cn),
2035
+ (r.floor = On),
2036
+ (r.hypot = Pn),
2037
+ (r.ln = Rn),
2038
+ (r.log = bn),
2039
+ (r.log10 = _n),
2040
+ (r.log2 = An),
2041
+ (r.max = qn),
2042
+ (r.min = Tn),
2043
+ (r.mod = Ln),
2044
+ (r.mul = Dn),
2045
+ (r.pow = Fn),
2046
+ (r.random = In),
2047
+ (r.round = Zn),
2048
+ (r.sign = Un),
2049
+ (r.sin = Bn),
2050
+ (r.sinh = Vn),
2051
+ (r.sqrt = $n),
2052
+ (r.sub = Hn),
2053
+ (r.sum = jn),
2054
+ (r.tan = Wn),
2055
+ (r.tanh = Gn),
2056
+ (r.trunc = Jn),
2057
+ e === void 0 && (e = {}),
2058
+ e && e.defaults !== !0)
2059
+ )
2060
+ for (
2061
+ t = [
2062
+ "precision",
2063
+ "rounding",
2064
+ "toExpNeg",
2065
+ "toExpPos",
2066
+ "maxE",
2067
+ "minE",
2068
+ "modulo",
2069
+ "crypto",
2070
+ ],
2071
+ n = 0;
2072
+ n < t.length;
2073
+ )
2074
+ e.hasOwnProperty((i = t[n++])) || (e[i] = this[i]);
2075
+ return (r.config(e), r);
2076
+ }
2077
+ function Mn(e, n) {
2078
+ return new this(e).div(n);
2079
+ }
2080
+ function Cn(e) {
2081
+ return new this(e).exp();
2082
+ }
2083
+ function On(e) {
2084
+ return p((e = new this(e)), e.e + 1, 3);
2085
+ }
2086
+ function Pn() {
2087
+ var e,
2088
+ n,
2089
+ i = new this(0);
2090
+ for (w = !1, e = 0; e < arguments.length; )
2091
+ if (((n = new this(arguments[e++])), n.d)) i.d && (i = i.plus(n.times(n)));
2092
+ else {
2093
+ if (n.s) return ((w = !0), new this(1 / 0));
2094
+ i = n;
2095
+ }
2096
+ return ((w = !0), i.sqrt());
2097
+ }
2098
+ function qe(e) {
2099
+ return e instanceof Q || (e && e.toStringTag === Fe) || !1;
2100
+ }
2101
+ function Rn(e) {
2102
+ return new this(e).ln();
2103
+ }
2104
+ function bn(e, n) {
2105
+ return new this(e).log(n);
2106
+ }
2107
+ function An(e) {
2108
+ return new this(e).log(2);
2109
+ }
2110
+ function _n(e) {
2111
+ return new this(e).log(10);
2112
+ }
2113
+ function qn() {
2114
+ return Be(this, arguments, "lt");
2115
+ }
2116
+ function Tn() {
2117
+ return Be(this, arguments, "gt");
2118
+ }
2119
+ function Ln(e, n) {
2120
+ return new this(e).mod(n);
2121
+ }
2122
+ function Dn(e, n) {
2123
+ return new this(e).mul(n);
2124
+ }
2125
+ function Fn(e, n) {
2126
+ return new this(e).pow(n);
2127
+ }
2128
+ function In(e) {
2129
+ var n,
2130
+ i,
2131
+ t,
2132
+ r,
2133
+ s = 0,
2134
+ o = new this(1),
2135
+ u = [];
2136
+ if (
2137
+ (e === void 0 ? (e = this.precision) : _(e, 1, $),
2138
+ (t = Math.ceil(e / m)),
2139
+ this.crypto)
2140
+ )
2141
+ if (crypto.getRandomValues)
2142
+ for (n = crypto.getRandomValues(new Uint32Array(t)); s < t; )
2143
+ ((r = n[s]),
2144
+ r >= 429e7
2145
+ ? (n[s] = crypto.getRandomValues(new Uint32Array(1))[0])
2146
+ : (u[s++] = r % 1e7));
2147
+ else if (crypto.randomBytes) {
2148
+ for (n = crypto.randomBytes((t *= 4)); s < t; )
2149
+ ((r =
2150
+ n[s] + (n[s + 1] << 8) + (n[s + 2] << 16) + ((n[s + 3] & 127) << 24)),
2151
+ r >= 214e7
2152
+ ? crypto.randomBytes(4).copy(n, s)
2153
+ : (u.push(r % 1e7), (s += 4)));
2154
+ s = t / 4;
2155
+ } else throw Error(De);
2156
+ else for (; s < t; ) u[s++] = (Math.random() * 1e7) | 0;
2157
+ for (
2158
+ t = u[--s],
2159
+ e %= m,
2160
+ t && e && ((r = C(10, m - e)), (u[s] = ((t / r) | 0) * r));
2161
+ u[s] === 0;
2162
+ s--
2163
+ )
2164
+ u.pop();
2165
+ if (s < 0) ((i = 0), (u = [0]));
2166
+ else {
2167
+ for (i = -1; u[0] === 0; i -= m) u.shift();
2168
+ for (t = 1, r = u[0]; r >= 10; r /= 10) t++;
2169
+ t < m && (i -= m - t);
2170
+ }
2171
+ return ((o.e = i), (o.d = u), o);
2172
+ }
2173
+ function Zn(e) {
2174
+ return p((e = new this(e)), e.e + 1, this.rounding);
2175
+ }
2176
+ function Un(e) {
2177
+ return ((e = new this(e)), e.d ? (e.d[0] ? e.s : 0 * e.s) : e.s || NaN);
2178
+ }
2179
+ function Bn(e) {
2180
+ return new this(e).sin();
2181
+ }
2182
+ function Vn(e) {
2183
+ return new this(e).sinh();
2184
+ }
2185
+ function $n(e) {
2186
+ return new this(e).sqrt();
2187
+ }
2188
+ function Hn(e, n) {
2189
+ return new this(e).sub(n);
2190
+ }
2191
+ function jn() {
2192
+ var e = 0,
2193
+ n = arguments,
2194
+ i = new this(n[e]);
2195
+ for (w = !1; i.s && ++e < n.length; ) i = i.plus(n[e]);
2196
+ return ((w = !0), p(i, this.precision, this.rounding));
2197
+ }
2198
+ function Wn(e) {
2199
+ return new this(e).tan();
2200
+ }
2201
+ function Gn(e) {
2202
+ return new this(e).tanh();
2203
+ }
2204
+ function Jn(e) {
2205
+ return p((e = new this(e)), e.e + 1, 1);
2206
+ }
2207
+ h[Symbol.for("nodejs.util.inspect.custom")] = h.toString;
2208
+ h[Symbol.toStringTag] = "Decimal";
2209
+ var Q = (h.constructor = He(Ne));
2210
+ te = new Q(te);
2211
+ re = new Q(re);
2212
+ var je = Q;
2213
+ 0 &&
2214
+ (module.exports = {
2215
+ Decimal,
2216
+ Public,
2217
+ getRuntime,
2218
+ makeStrictEnum,
2219
+ objectEnumValues,
2220
+ });
2
2221
  /*! Bundled license information:
3
2222
 
4
2223
  decimal.js/decimal.mjs: