UNPKG

bt-tools

Version:
1 lines 41 kB
!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BtTools=e():n.BtTools=e()}(self,function(){return(()=>{var t={9670:(n,e,t)=>{var r=t(111);n.exports=function(n){if(!r(n))throw TypeError(String(n)+" is not an object");return n}},1318:(n,e,t)=>{var c=t(5656),f=t(7466),a=t(1400),t=function(u){return function(n,e,t){var r,i=c(n),o=f(i.length),s=a(t,o);if(u&&e!=e){for(;s<o;)if((r=i[s++])!=r)return!0}else for(;s<o;s++)if((u||s in i)&&i[s]===e)return u||s||0;return!u&&-1}};n.exports={includes:t(!0),indexOf:t(!1)}},4326:n=>{var e={}.toString;n.exports=function(n){return e.call(n).slice(8,-1)}},9920:(n,e,t)=>{var u=t(6656),c=t(3887),f=t(1236),a=t(3070);n.exports=function(n,e){for(var t=c(e),r=a.f,i=f.f,o=0;o<t.length;o++){var s=t[o];u(n,s)||r(n,s,i(e,s))}}},4230:(n,e,t)=>{var o=t(4488),s=/"/g;n.exports=function(n,e,t,r){var i=String(o(n)),n="<"+e;return""!==t&&(n+=" "+t+'="'+String(r).replace(s,"&quot;")+'"'),n+">"+i+"</"+e+">"}},8880:(n,e,t)=>{var r=t(9781),i=t(3070),o=t(9114);n.exports=r?function(n,e,t){return i.f(n,e,o(1,t))}:function(n,e,t){return n[e]=t,n}},9114:n=>{n.exports=function(n,e){return{enumerable:!(1&n),configurable:!(2&n),writable:!(4&n),value:e}}},9781:(n,e,t)=>{t=t(7293);n.exports=!t(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},317:(n,e,t)=>{var r=t(7854),t=t(111),i=r.document,o=t(i)&&t(i.createElement);n.exports=function(n){return o?i.createElement(n):{}}},748:n=>{n.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(n,e,t)=>{var f=t(7854),a=t(1236).f,l=t(8880),h=t(1320),d=t(3505),p=t(9920),g=t(4705);n.exports=function(n,e){var t,r,i,o=n.target,s=n.global,u=n.stat,c=s?f:u?f[o]||d(o,{}):(f[o]||{}).prototype;if(c)for(t in e){if(r=e[t],i=n.noTargetGet?(i=a(c,t))&&i.value:c[t],!g(s?t:o+(u?".":"#")+t,n.forced)&&void 0!==i){if(typeof r==typeof i)continue;p(r,i)}(n.sham||i&&i.sham)&&l(r,"sham",!0),h(c,t,r,n)}}},7293:n=>{n.exports=function(n){try{return!!n()}catch(n){return!0}}},5005:(n,e,t)=>{function r(n){return"function"==typeof n?n:void 0}var i=t(857),o=t(7854);n.exports=function(n,e){return arguments.length<2?r(i[n])||r(o[n]):i[n]&&i[n][e]||o[n]&&o[n][e]}},7854:(n,e,t)=>{function r(n){return n&&n.Math==Math&&n}n.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t.g&&t.g)||function(){return this}()||Function("return this")()},6656:(n,e,t)=>{var r=t(7908),i={}.hasOwnProperty;n.exports=Object.hasOwn||function(n,e){return i.call(r(n),e)}},3501:n=>{n.exports={}},4664:(n,e,t)=>{var r=t(9781),i=t(7293),o=t(317);n.exports=!r&&!i(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},8361:(n,e,t)=>{var r=t(7293),i=t(4326),o="".split;n.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(n){return"String"==i(n)?o.call(n,""):Object(n)}:Object},2788:(n,e,t)=>{var t=t(5465),r=Function.toString;"function"!=typeof t.inspectSource&&(t.inspectSource=function(n){return r.call(n)}),n.exports=t.inspectSource},9909:(n,e,t)=>{var r,i,o,s,u,c,f,a,l=t(8536),h=t(7854),d=t(111),p=t(8880),g=t(6656),m=t(5465),w=t(6200),t=t(3501),v="Object already initialized",h=h.WeakMap;f=l||m.state?(r=m.state||(m.state=new h),i=r.get,o=r.has,s=r.set,u=function(n,e){if(o.call(r,n))throw new TypeError(v);return e.facade=n,s.call(r,n,e),e},c=function(n){return i.call(r,n)||{}},function(n){return o.call(r,n)}):(t[a=w("state")]=!0,u=function(n,e){if(g(n,a))throw new TypeError(v);return e.facade=n,p(n,a,e),e},c=function(n){return g(n,a)?n[a]:{}},function(n){return g(n,a)}),n.exports={set:u,get:c,has:f,enforce:function(n){return f(n)?c(n):u(n,{})},getterFor:function(t){return function(n){var e;if(!d(n)||(e=c(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return e}}}},4705:(n,e,t)=>{var r=t(7293),i=/#|\.prototype\./,t=function(n,e){n=s[o(n)];return n==c||n!=u&&("function"==typeof e?r(e):!!e)},o=t.normalize=function(n){return String(n).replace(i,".").toLowerCase()},s=t.data={},u=t.NATIVE="N",c=t.POLYFILL="P";n.exports=t},111:n=>{n.exports=function(n){return"object"==typeof n?null!==n:"function"==typeof n}},1913:n=>{n.exports=!1},8536:(n,e,t)=>{var r=t(7854),t=t(2788),r=r.WeakMap;n.exports="function"==typeof r&&/native code/.test(t(r))},3070:(n,e,t)=>{var r=t(9781),i=t(4664),o=t(9670),s=t(7593),u=Object.defineProperty;e.f=r?u:function(n,e,t){if(o(n),e=s(e,!0),o(t),i)try{return u(n,e,t)}catch(n){}if("get"in t||"set"in t)throw TypeError("Accessors not supported");return"value"in t&&(n[e]=t.value),n}},1236:(n,e,t)=>{var r=t(9781),i=t(5296),o=t(9114),s=t(5656),u=t(7593),c=t(6656),f=t(4664),a=Object.getOwnPropertyDescriptor;e.f=r?a:function(n,e){if(n=s(n),e=u(e,!0),f)try{return a(n,e)}catch(n){}if(c(n,e))return o(!i.f.call(n,e),n[e])}},8006:(n,e,t)=>{var r=t(6324),i=t(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(n){return r(n,i)}},5181:(n,e)=>{e.f=Object.getOwnPropertySymbols},6324:(n,e,t)=>{var s=t(6656),u=t(5656),c=t(1318).indexOf,f=t(3501);n.exports=function(n,e){var t,r=u(n),i=0,o=[];for(t in r)!s(f,t)&&s(r,t)&&o.push(t);for(;e.length>i;)s(r,t=e[i++])&&(~c(o,t)||o.push(t));return o}},5296:(n,e)=>{"use strict";var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!t.call({1:2},1);e.f=i?function(n){n=r(this,n);return!!n&&n.enumerable}:t},3887:(n,e,t)=>{var r=t(5005),i=t(8006),o=t(5181),s=t(9670);n.exports=r("Reflect","ownKeys")||function(n){var e=i.f(s(n)),t=o.f;return t?e.concat(t(n)):e}},857:(n,e,t)=>{t=t(7854);n.exports=t},1320:(n,e,t)=>{var u=t(7854),c=t(8880),f=t(6656),a=t(3505),r=t(2788),t=t(9909),i=t.get,l=t.enforce,h=String(String).split("String");(n.exports=function(n,e,t,r){var i=!!r&&!!r.unsafe,o=!!r&&!!r.enumerable,s=!!r&&!!r.noTargetGet;"function"==typeof t&&("string"!=typeof e||f(t,"name")||c(t,"name",e),(r=l(t)).source||(r.source=h.join("string"==typeof e?e:""))),n!==u?(i?!s&&n[e]&&(o=!0):delete n[e],o?n[e]=t:c(n,e,t)):o?n[e]=t:a(e,t)})(Function.prototype,"toString",function(){return"function"==typeof this&&i(this).source||r(this)})},4488:n=>{n.exports=function(n){if(null==n)throw TypeError("Can't call method on "+n);return n}},3505:(n,e,t)=>{var r=t(7854),i=t(8880);n.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},6200:(n,e,t)=>{var r=t(2309),i=t(9711),o=r("keys");n.exports=function(n){return o[n]||(o[n]=i(n))}},5465:(n,e,t)=>{var r=t(7854),i=t(3505),t="__core-js_shared__",t=r[t]||i(t,{});n.exports=t},2309:(n,e,t)=>{var r=t(1913),i=t(5465);(n.exports=function(n,e){return i[n]||(i[n]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},3429:(n,e,t)=>{var r=t(7293);n.exports=function(e){return r(function(){var n=""[e]('"');return n!==n.toLowerCase()||3<n.split('"').length})}},1400:(n,e,t)=>{var r=t(9958),i=Math.max,o=Math.min;n.exports=function(n,e){n=r(n);return n<0?i(n+e,0):o(n,e)}},5656:(n,e,t)=>{var r=t(8361),i=t(4488);n.exports=function(n){return r(i(n))}},9958:n=>{var e=Math.ceil,t=Math.floor;n.exports=function(n){return isNaN(n=+n)?0:(0<n?t:e)(n)}},7466:(n,e,t)=>{var r=t(9958),i=Math.min;n.exports=function(n){return 0<n?i(r(n),9007199254740991):0}},7908:(n,e,t)=>{var r=t(4488);n.exports=function(n){return Object(r(n))}},7593:(n,e,t)=>{var i=t(111);n.exports=function(n,e){if(!i(n))return n;var t,r;if(e&&"function"==typeof(t=n.toString)&&!i(r=t.call(n)))return r;if("function"==typeof(t=n.valueOf)&&!i(r=t.call(n)))return r;if(!e&&"function"==typeof(t=n.toString)&&!i(r=t.call(n)))return r;throw TypeError("Can't convert object to primitive value")}},9711:n=>{var e=0,t=Math.random();n.exports=function(n){return"Symbol("+String(void 0===n?"":n)+")_"+(++e+t).toString(36)}},86:(n,e,t)=>{"use strict";var r=t(2109),i=t(4230);r({target:"String",proto:!0,forced:t(3429)("sub")},{sub:function(){return i(this,"sub","","")}})},3776:function(Cn,Un,Hn){var Bn;!function(){"use strict";var a,T,o,s=9e15,p=1e9,g="0123456789abcdef",r="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",i="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",u={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-s,maxE:s,crypto:!1},y=!0,c="[DecimalError] ",m=c+"Invalid argument: ",f=c+"Precision limit exceeded",l=c+"crypto unavailable",e="[object Decimal]",q=Math.floor,w=Math.pow,h=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,d=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,v=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,b=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,F=1e7,_=7,N=r.length-1,x=i.length-1,E={toStringTag:e};function O(n){var e,t,r,i=n.length-1,o="",s=n[0];if(0<i){for(o+=s,e=1;e<i;e++)r=n[e]+"",(t=_-r.length)&&(o+=H(t)),o+=r;s=n[e],(t=_-(r=s+"").length)&&(o+=H(t))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function S(n,e,t){if(n!==~~n||n<e||t<n)throw Error(m+n)}function M(n,e,t,r){for(var i,o,s=n[0];10<=s;s/=10)--e;return--e<0?(e+=_,i=0):(i=Math.ceil((e+1)/_),e%=_),s=w(10,_-e),o=n[i]%s|0,null==r?e<3?(0==e?o=o/100|0:1==e&&(o=o/10|0),t<4&&99999==o||3<t&&49999==o||5e4==o||0==o):(t<4&&o+1==s||3<t&&o+1==s/2)&&(n[i+1]/s/100|0)==w(10,e-2)-1||(o==s/2||0==o)&&0==(n[i+1]/s/100|0):e<4?(0==e?o=o/1e3|0:1==e?o=o/100|0:2==e&&(o=o/10|0),(r||t<4)&&9999==o||!r&&3<t&&4999==o):((r||t<4)&&o+1==s||!r&&3<t&&o+1==s/2)&&(n[i+1]/s/1e3|0)==w(10,e-3)-1}function j(n,e,t){for(var r,i,o=[0],s=0,u=n.length;s<u;){for(i=o.length;i--;)o[i]*=e;for(o[0]+=g.indexOf(n.charAt(s++)),r=0;r<o.length;r++)o[r]>t-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/t|0,o[r]%=t)}return o.reverse()}E.absoluteValue=E.abs=function(){var n=new this.constructor(this);return n.s<0&&(n.s=1),L(n)},E.ceil=function(){return L(new this.constructor(this),this.e+1,2)},E.clampedTo=E.clamp=function(n,e){var t=this.constructor;if(n=new t(n),e=new t(e),!n.s||!e.s)return new t(NaN);if(n.gt(e))throw Error(m+e);return this.cmp(n)<0?n:0<this.cmp(e)?e:new t(this)},E.comparedTo=E.cmp=function(n){var e,t,r=this,i=r.d,o=(n=new r.constructor(n)).d,s=r.s,u=n.s;if(!i||!o)return s&&u?s!==u?s:i===o?0:!i^s<0?1:-1:NaN;if(!i[0]||!o[0])return i[0]?s:o[0]?-u:0;if(s!==u)return s;if(r.e!==n.e)return r.e>n.e^s<0?1:-1;for(e=0,t=(r=i.length)<(n=o.length)?r:n;e<t;++e)if(i[e]!==o[e])return i[e]>o[e]^s<0?1:-1;return r===n?0:n<r^s<0?1:-1},E.cosine=E.cos=function(){var n,e,t=this,r=t.constructor;return t.d?t.d[0]?(n=r.precision,e=r.rounding,r.precision=n+Math.max(t.e,t.sd())+_,r.rounding=1,t=function(n,e){var t,r;if(e.isZero())return e;r=(r=e.d.length)<32?(t=Math.ceil(r/3),(1/K(4,t)).toString()):(t=16,"2.3283064365386962890625e-10");n.precision+=t,e=G(n,1,e.times(r),new n(1));for(var i=t;i--;){var o=e.times(e);e=o.times(o).minus(o).times(8).plus(1)}return n.precision-=t,e}(r,Y(r,t)),r.precision=n,r.rounding=e,L(2==o||3==o?t.neg():t,n,e,!0)):new r(1):new r(NaN)},E.cubeRoot=E.cbrt=function(){var n,e,t,r,i,o,s,u,c,f,a=this,l=a.constructor;if(!a.isFinite()||a.isZero())return new l(a);for(y=!1,(o=a.s*w(a.s*a,1/3))&&Math.abs(o)!=1/0?r=new l(o.toString()):(t=O(a.d),(o=((n=a.e)-t.length+1)%3)&&(t+=1==o||-2==o?"0":"00"),o=w(t,1/3),n=q((n+1)/3)-(n%3==(n<0?-1:2)),(r=new l(t=o==1/0?"5e"+n:(t=o.toExponential()).slice(0,t.indexOf("e")+1)+n)).s=a.s),s=(n=l.precision)+3;;)if(f=(c=(u=r).times(u).times(u)).plus(a),r=P(f.plus(a).times(u),f.plus(c),s+2,1),O(u.d).slice(0,s)===(t=O(r.d)).slice(0,s)){if("9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(L(r,n+1,1),e=!r.times(r).times(r).eq(a));break}if(!i&&(L(u,n+1,0),u.times(u).times(u).eq(a))){r=u;break}s+=4,i=1}return y=!0,L(r,n,l.rounding,e)},E.decimalPlaces=E.dp=function(){var n,e=this.d,t=NaN;if(e){if(t=((n=e.length-1)-q(this.e/_))*_,n=e[n])for(;n%10==0;n/=10)t--;t<0&&(t=0)}return t},E.dividedBy=E.div=function(n){return P(this,new this.constructor(n))},E.dividedToIntegerBy=E.divToInt=function(n){var e=this.constructor;return L(P(this,new e(n),0,1,1),e.precision,e.rounding)},E.equals=E.eq=function(n){return 0===this.cmp(n)},E.floor=function(){return L(new this.constructor(this),this.e+1,3)},E.greaterThan=E.gt=function(n){return 0<this.cmp(n)},E.greaterThanOrEqualTo=E.gte=function(n){n=this.cmp(n);return 1==n||0===n},E.hyperbolicCosine=E.cosh=function(){var n,e,t,r=(u=this).constructor,i=new r(1);if(!u.isFinite())return new r(u.s?1/0:NaN);if(u.isZero())return i;e=r.precision,t=r.rounding,r.precision=e+Math.max(u.e,u.sd())+4,r.rounding=1;for(var o,s=(s=u.d.length)<32?(1/K(4,n=Math.ceil(s/3))).toString():(n=16,"2.3283064365386962890625e-10"),u=G(r,1,u.times(s),new r(1),!0),c=n,f=new r(8);c--;)o=u.times(u),u=i.minus(o.times(f.minus(o.times(f))));return L(u,r.precision=e,r.rounding=t,!0)},E.hyperbolicSine=E.sinh=function(){var n,e,t,r=(s=this).constructor;if(!s.isFinite()||s.isZero())return new r(s);if(n=r.precision,e=r.rounding,r.precision=n+Math.max(s.e,s.sd())+4,r.rounding=1,(t=s.d.length)<3)s=G(r,2,s,s,!0);else for(var i,o=1.4*Math.sqrt(t),s=G(r,2,s=s.times(1/K(5,o=16<o?16:0|o)),s,!0),u=new r(5),c=new r(16),f=new r(20);o--;)i=s.times(s),s=s.times(u.plus(i.times(c.times(i).plus(f))));return L(s,r.precision=n,r.rounding=e,!0)},E.hyperbolicTangent=E.tanh=function(){var n,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+7,r.rounding=1,P(t.sinh(),t.cosh(),r.precision=n,r.rounding=e)):new r(t.s)},E.inverseCosine=E.acos=function(){var n=this,e=n.constructor,t=n.abs().cmp(1),r=e.precision,i=e.rounding;return-1!==t?0===t?n.isNeg()?C(e,r,i):new e(0):new e(NaN):n.isZero()?C(e,r+4,i).times(.5):(e.precision=r+6,e.rounding=1,n=n.asin(),t=C(e,r+4,i).times(.5),e.precision=r,e.rounding=i,t.minus(n))},E.inverseHyperbolicCosine=E.acosh=function(){var n,e,t=this,r=t.constructor;return t.lte(1)?new r(t.eq(1)?0:NaN):t.isFinite()?(n=r.precision,e=r.rounding,r.precision=n+Math.max(Math.abs(t.e),t.sd())+4,r.rounding=1,y=!1,t=t.times(t).minus(1).sqrt().plus(t),y=!0,r.precision=n,r.rounding=e,t.ln()):new r(t)},E.inverseHyperbolicSine=E.asinh=function(){var n,e,t=this,r=t.constructor;return!t.isFinite()||t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+2*Math.max(Math.abs(t.e),t.sd())+6,r.rounding=1,y=!1,t=t.times(t).plus(1).sqrt().plus(t),y=!0,r.precision=n,r.rounding=e,t.ln())},E.inverseHyperbolicTangent=E.atanh=function(){var n,e,t,r=this,i=r.constructor;return r.isFinite()?0<=r.e?new i(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(n=i.precision,e=i.rounding,t=r.sd(),Math.max(t,n)<2*-r.e-1?L(new i(r),n,e,!0):(i.precision=t=t-r.e,r=P(r.plus(1),new i(1).minus(r),t+n,1),i.precision=n+4,i.rounding=1,r=r.ln(),i.precision=n,i.rounding=e,r.times(.5))):new i(NaN)},E.inverseSine=E.asin=function(){var n,e,t,r=this,i=r.constructor;return r.isZero()?new i(r):(n=r.abs().cmp(1),e=i.precision,t=i.rounding,-1!==n?0===n?((n=C(i,e+4,t).times(.5)).s=r.s,n):new i(NaN):(i.precision=e+6,i.rounding=1,r=r.div(new i(1).minus(r.times(r)).sqrt().plus(1)).atan(),i.precision=e,i.rounding=t,r.times(2)))},E.inverseTangent=E.atan=function(){var n,e,t,r,i,o,s,u,c,f=this,a=f.constructor,l=a.precision,h=a.rounding;if(f.isFinite()){if(f.isZero())return new a(f);if(f.abs().eq(1)&&l+4<=x)return(s=C(a,l+4,h).times(.25)).s=f.s,s}else{if(!f.s)return new a(NaN);if(l+4<=x)return(s=C(a,l+4,h).times(.5)).s=f.s,s}for(a.precision=u=l+10,a.rounding=1,n=t=Math.min(28,u/_+2|0);n;--n)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(y=!1,e=Math.ceil(u/_),r=1,c=f.times(f),s=new a(f),i=f;-1!==n;)if(i=i.times(c),o=s.minus(i.div(r+=2)),i=i.times(c),void 0!==(s=o.plus(i.div(r+=2))).d[e])for(n=e;s.d[n]===o.d[n]&&n--;);return t&&(s=s.times(2<<t-1)),y=!0,L(s,a.precision=l,a.rounding=h,!0)},E.isFinite=function(){return!!this.d},E.isInteger=E.isInt=function(){return!!this.d&&q(this.e/_)>this.d.length-2},E.isNaN=function(){return!this.s},E.isNegative=E.isNeg=function(){return this.s<0},E.isPositive=E.isPos=function(){return 0<this.s},E.isZero=function(){return!!this.d&&0===this.d[0]},E.lessThan=E.lt=function(n){return this.cmp(n)<0},E.lessThanOrEqualTo=E.lte=function(n){return this.cmp(n)<1},E.logarithm=E.log=function(n){var e,t,r,i,o,s,u,c,f=this,a=f.constructor,l=a.precision,h=a.rounding;if(null==n)n=new a(10),e=!0;else{if(t=(n=new a(n)).d,n.s<0||!t||!t[0]||n.eq(1))return new a(NaN);e=n.eq(10)}if(t=f.d,f.s<0||!t||!t[0]||f.eq(1))return new a(t&&!t[0]?-1/0:1!=f.s?NaN:t?0:1/0);if(e)if(1<t.length)o=!0;else{for(i=t[0];i%10==0;)i/=10;o=1!==i}if(y=!1,s=z(f,u=l+5),r=e?I(a,u+10):z(n,u),M((c=P(s,r,u,1)).d,i=l,h))do{if(s=z(f,u+=10),r=e?I(a,u+10):z(n,u),c=P(s,r,u,1),!o){+O(c.d).slice(i+1,i+15)+1==1e14&&(c=L(c,l+1,0));break}}while(M(c.d,i+=10,h));return y=!0,L(c,l,h)},E.minus=E.sub=function(n){var e,t,r,i,o,s,u,c,f,a,l,h=this,d=h.constructor;if(n=new d(n),!h.d||!n.d)return h.s&&n.s?h.d?n.s=-n.s:n=new d(n.d||h.s!==n.s?h:NaN):n=new d(NaN),n;if(h.s!=n.s)return n.s=-n.s,h.plus(n);if(f=h.d,l=n.d,u=d.precision,c=d.rounding,!f[0]||!l[0]){if(l[0])n.s=-n.s;else{if(!f[0])return new d(3===c?-0:0);n=new d(h)}return y?L(n,u,c):n}if(t=q(n.e/_),h=q(h.e/_),f=f.slice(),o=h-t){for(s=(a=o<0)?(e=f,o=-o,l.length):(e=l,t=h,f.length),(r=Math.max(Math.ceil(u/_),s)+2)<o&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for((a=(r=f.length)<(s=l.length))&&(s=r),r=0;r<s;r++)if(f[r]!=l[r]){a=f[r]<l[r];break}o=0}for(a&&(e=f,f=l,l=e,n.s=-n.s),s=f.length,r=l.length-s;0<r;--r)f[s++]=0;for(r=l.length;o<r;){if(f[--r]<l[r]){for(i=r;i&&0===f[--i];)f[i]=F-1;--f[i],f[r]+=F}f[r]-=l[r]}for(;0===f[--s];)f.pop();for(;0===f[0];f.shift())--t;return f[0]?(n.d=f,n.e=R(f,t),y?L(n,u,c):n):new d(3===c?-0:0)},E.modulo=E.mod=function(n){var e,t=this,r=t.constructor;return n=new r(n),!t.d||!n.s||n.d&&!n.d[0]?new r(NaN):!n.d||t.d&&!t.d[0]?L(new r(t),r.precision,r.rounding):(y=!1,9==r.modulo?(e=P(t,n.abs(),0,3,1)).s*=n.s:e=P(t,n,0,r.modulo,1),e=e.times(n),y=!0,t.minus(e))},E.naturalExponential=E.exp=function(){return $(this)},E.naturalLogarithm=E.ln=function(){return z(this)},E.negated=E.neg=function(){var n=new this.constructor(this);return n.s=-n.s,L(n)},E.plus=E.add=function(n){var e,t,r,i,o,s,u,c,f=this,a=f.constructor;if(n=new a(n),!f.d||!n.d)return f.s&&n.s?f.d||(n=new a(n.d||f.s===n.s?f:NaN)):n=new a(NaN),n;if(f.s!=n.s)return n.s=-n.s,f.minus(n);if(u=f.d,c=n.d,o=a.precision,s=a.rounding,!u[0]||!c[0])return c[0]||(n=new a(f)),y?L(n,o,s):n;if(a=q(f.e/_),f=q(n.e/_),u=u.slice(),r=a-f){for((i=(i=r<0?(t=u,r=-r,c.length):(t=c,f=a,u.length))<(a=Math.ceil(o/_))?a+1:i+1)<r&&(r=i,t.length=1),t.reverse();r--;)t.push(0);t.reverse()}for((i=u.length)-(r=c.length)<0&&(r=i,t=c,c=u,u=t),e=0;r;)e=(u[--r]=u[r]+c[r]+e)/F|0,u[r]%=F;for(e&&(u.unshift(e),++f),i=u.length;0==u[--i];)u.pop();return n.d=u,n.e=R(u,f),y?L(n,o,s):n},E.precision=E.sd=function(n){var e;if(void 0!==n&&n!==!!n&&1!==n&&0!==n)throw Error(m+n);return this.d?(e=U(this.d),n&&this.e+1>e&&(e=this.e+1)):e=NaN,e},E.round=function(){var n=this.constructor;return L(new n(this),this.e+1,n.rounding)},E.sine=E.sin=function(){var n,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+Math.max(t.e,t.sd())+_,r.rounding=1,t=function(n,e){var t,r=e.d.length;if(r<3)return e.isZero()?e:G(n,2,e,e);t=16<(t=1.4*Math.sqrt(r))?16:0|t,e=e.times(1/K(5,t)),e=G(n,2,e,e);for(var i,o=new n(5),s=new n(16),u=new n(20);t--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(u))));return e}(r,Y(r,t)),r.precision=n,r.rounding=e,L(2<o?t.neg():t,n,e,!0)):new r(NaN)},E.squareRoot=E.sqrt=function(){var n,e,t,r,i,o,s=this,u=s.d,c=s.e,f=s.s,a=s.constructor;if(1!==f||!u||!u[0])return new a(!f||f<0&&(!u||u[0])?NaN:u?s:1/0);for(y=!1,r=0==(f=Math.sqrt(+s))||f==1/0?(((e=O(u)).length+c)%2==0&&(e+="0"),f=Math.sqrt(e),c=q((c+1)/2)-(c<0||c%2),new a(e=f==1/0?"5e"+c:(e=f.toExponential()).slice(0,e.indexOf("e")+1)+c)):new a(f.toString()),t=(c=a.precision)+3;;)if(r=(o=r).plus(P(s,o,t+2,1)).times(.5),O(o.d).slice(0,t)===(e=O(r.d)).slice(0,t)){if("9999"!=(e=e.slice(t-3,t+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(L(r,c+1,1),n=!r.times(r).eq(s));break}if(!i&&(L(o,c+1,0),o.times(o).eq(s))){r=o;break}t+=4,i=1}return y=!0,L(r,c,a.rounding,n)},E.tangent=E.tan=function(){var n,e,t=this,r=t.constructor;return t.isFinite()?t.isZero()?new r(t):(n=r.precision,e=r.rounding,r.precision=n+10,r.rounding=1,(t=t.sin()).s=1,t=P(t,new r(1).minus(t.times(t)).sqrt(),n+10,0),r.precision=n,r.rounding=e,L(2==o||4==o?t.neg():t,n,e,!0)):new r(NaN)},E.times=E.mul=function(n){var e,t,r,i,o,s,u,c,f,a=this.constructor,l=this.d,h=(n=new a(n)).d;if(n.s*=this.s,!(l&&l[0]&&h&&h[0]))return new a(!n.s||l&&!l[0]&&!h||h&&!h[0]&&!l?NaN:l&&h?0*n.s:n.s/0);for(t=q(this.e/_)+q(n.e/_),(c=l.length)<(f=h.length)&&(o=l,l=h,h=o,s=c,c=f,f=s),o=[],r=s=c+f;r--;)o.push(0);for(r=f;0<=--r;){for(e=0,i=c+r;r<i;)u=o[i]+h[r]*l[i-r-1]+e,o[i--]=u%F|0,e=u/F|0;o[i]=(o[i]+e)%F|0}for(;!o[--s];)o.pop();return e?++t:o.shift(),n.d=o,n.e=R(o,t),y?L(n,a.precision,a.rounding):n},E.toBinary=function(n,e){return t(this,2,n,e)},E.toDecimalPlaces=E.toDP=function(n,e){var t=this.constructor,r=new t(this);return void 0===n?r:(S(n,0,p),void 0===e?e=t.rounding:S(e,0,8),L(r,n+r.e+1,e))},E.toExponential=function(n,e){var t=this,r=t.constructor,n=void 0===n?k(t,!0):(S(n,0,p),void 0===e?e=r.rounding:S(e,0,8),k(t=L(new r(t),n+1,e),!0,n+1));return t.isNeg()&&!t.isZero()?"-"+n:n},E.toFixed=function(n,e){var t=this,r=t.constructor,i=void 0===n?k(t):(S(n,0,p),void 0===e?e=r.rounding:S(e,0,8),k(i=L(new r(t),n+t.e+1,e),!1,n+i.e+1));return t.isNeg()&&!t.isZero()?"-"+i:i},E.toFraction=function(n){var e,t,r,i,o,s,u,c,f,a,l=this,h=l.d,d=l.constructor;if(!h)return new d(l);if(c=t=new d(1),r=u=new d(0),o=(e=new d(r)).e=U(h)-l.e-1,e.d[0]=w(10,(f=o%_)<0?_+f:f),null==n)n=0<o?e:c;else{if(!(s=new d(n)).isInt()||s.lt(c))throw Error(m+s);n=s.gt(e)?0<o?e:c:s}for(y=!1,s=new d(O(h)),f=d.precision,d.precision=o=h.length*_*2;a=P(s,e,0,1,1),1!=(i=t.plus(a.times(r))).cmp(n);)t=r,r=i,c=u.plus(a.times(i=c)),u=i,e=s.minus(a.times(i=e)),s=i;return i=P(n.minus(t),r,0,1,1),u=u.plus(i.times(c)),t=t.plus(i.times(r)),u.s=c.s=l.s,l=P(c,r,o,1).minus(l).abs().cmp(P(u,t,o,1).minus(l).abs())<1?[c,r]:[u,t],d.precision=f,y=!0,l},E.toHexadecimal=E.toHex=function(n,e){return t(this,16,n,e)},E.toNearest=function(n,e){var t=(r=this).constructor,r=new t(r);if(null==n){if(!r.d)return r;n=new t(1),e=t.rounding}else{if(n=new t(n),void 0===e?e=t.rounding:S(e,0,8),!r.d)return n.s?r:n;if(!n.d)return n.s&&(n.s=r.s),n}return n.d[0]?(y=!1,r=P(r,n,0,e,1).times(n),y=!0,L(r)):(n.s=r.s,r=n),r},E.toNumber=function(){return+this},E.toOctal=function(n,e){return t(this,8,n,e)},E.toPower=E.pow=function(n){var e,t,r,i,o,s,u=this,c=u.constructor,f=+(n=new c(n));if(!(u.d&&n.d&&u.d[0]&&n.d[0]))return new c(w(+u,f));if((u=new c(u)).eq(1))return u;if(r=c.precision,o=c.rounding,n.eq(1))return L(u,r,o);if((e=q(n.e/_))>=n.d.length-1&&(t=f<0?-f:f)<=9007199254740991)return i=B(c,u,t,r),n.s<0?new c(1).div(i):L(i,r,o);if((s=u.s)<0){if(e<n.d.length-1)return new c(NaN);if(0==(1&n.d[e])&&(s=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=s,u}return(e=0!=(t=w(+u,f))&&isFinite(t)?new c(t+"").e:q(f*(Math.log("0."+O(u.d))/Math.LN10+u.e+1)))>c.maxE+1||e<c.minE-1?new c(0<e?s/0:0):(y=!1,c.rounding=u.s=1,t=Math.min(12,(e+"").length),(i=(i=$(n.times(z(u,r+t)),r)).d&&M((i=L(i,r+5,1)).d,r,o)&&+O((i=L($(n.times(z(u,(e=r+10)+t)),e),e+5,1)).d).slice(r+1,r+15)+1==1e14?L(i,r+1,0):i).s=s,y=!0,L(i,r,c.rounding=o))},E.toPrecision=function(n,e){var t=this,r=t.constructor,n=void 0===n?k(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(S(n,1,p),void 0===e?e=r.rounding:S(e,0,8),k(t=L(new r(t),n,e),n<=t.e||t.e<=r.toExpNeg,n));return t.isNeg()&&!t.isZero()?"-"+n:n},E.toSignificantDigits=E.toSD=function(n,e){var t=this.constructor;return void 0===n?(n=t.precision,e=t.rounding):(S(n,1,p),void 0===e?e=t.rounding:S(e,0,8)),L(new t(this),n,e)},E.toString=function(){var n=this,e=n.constructor,e=k(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()&&!n.isZero()?"-"+e:e},E.truncated=E.trunc=function(){return L(new this.constructor(this),this.e+1,1)},E.valueOf=E.toJSON=function(){var n=this,e=n.constructor,e=k(n,n.e<=e.toExpNeg||n.e>=e.toExpPos);return n.isNeg()?"-"+e:e};var P=function(n,e,t,r,i,o){var s,u,c,f,a,l,h,d,p,g,m,w,v,y,b,N,x,E,O,S=n.constructor,M=n.s==e.s?1:-1,j=n.d,P=e.d;if(!(j&&j[0]&&P&&P[0]))return new S(n.s&&e.s&&(j?!P||j[0]!=P[0]:P)?j&&0==j[0]||!P?0*M:M/0:NaN);for(u=o?(a=1,n.e-e.e):(o=F,q(n.e/(a=_))-q(e.e/a)),E=P.length,N=j.length,p=(M=new S(M)).d=[],c=0;P[c]==(j[c]||0);c++);if(P[c]>(j[c]||0)&&u--,null==t?(v=t=S.precision,r=S.rounding):v=i?t+(n.e-e.e)+1:t,v<0)p.push(1),l=!0;else{if(v=v/a+2|0,c=0,1==E){for(P=P[f=0],v++;(c<N||f)&&v--;c++)y=f*o+(j[c]||0),p[c]=y/P|0,f=y%P|0;l=f||c<N}else{for(1<(f=o/(P[0]+1)|0)&&(P=A(P,f,o),j=A(j,f,o),E=P.length,N=j.length),m=(g=j.slice(0,b=E)).length;m<E;)g[m++]=0;for((O=P.slice()).unshift(0),x=P[0],P[1]>=o/2&&++x;f=0,(s=D(P,g,E,m))<0?(w=g[0],1<(f=(w=E!=m?w*o+(g[1]||0):w)/x|0)?1==(s=D(h=A(P,f=o<=f?o-1:f,o),g,d=h.length,m=g.length))&&(f--,Z(h,E<d?O:P,d,o)):(0==f&&(s=f=1),h=P.slice()),(d=h.length)<m&&h.unshift(0),Z(g,h,m,o),-1==s&&(s=D(P,g,E,m=g.length))<1&&(f++,Z(g,E<m?O:P,m,o)),m=g.length):0===s&&(f++,g=[0]),p[c++]=f,s&&g[0]?g[m++]=j[b]||0:(g=[j[b]],m=1),(b++<N||void 0!==g[0])&&v--;);l=void 0!==g[0]}p[0]||p.shift()}if(1==a)M.e=u,T=l;else{for(c=1,f=p[0];10<=f;f/=10)c++;M.e=c+u*a-1,L(M,i?t+M.e+1:t,r,l)}return M};function A(n,e,t){var r,i=0,o=n.length;for(n=n.slice();o--;)r=n[o]*e+i,n[o]=r%t|0,i=r/t|0;return i&&n.unshift(i),n}function D(n,e,t,r){var i,o;if(t!=r)o=r<t?1:-1;else for(i=o=0;i<t;i++)if(n[i]!=e[i]){o=n[i]>e[i]?1:-1;break}return o}function Z(n,e,t,r){for(var i=0;t--;)n[t]-=i,i=n[t]<e[t]?1:0,n[t]=i*r+n[t]-e[t];for(;!n[0]&&1<n.length;)n.shift()}function L(n,e,t,r){var i,o,s,u,c,f,a,l,h=n.constructor;n:if(null!=e){if(!(a=n.d))return n;for(i=1,u=a[0];10<=u;u/=10)i++;if((o=e-i)<0)o+=_,c=(f=a[l=0])/w(10,i-(s=e)-1)%10|0;else if(l=Math.ceil((o+1)/_),(u=a.length)<=l){if(!r)break n;for(;u++<=l;)a.push(0);f=c=0,s=(o%=_)-_+(i=1)}else{for(f=u=a[l],i=1;10<=u;u/=10)i++;c=(s=(o%=_)-_+i)<0?0:f/w(10,i-s-1)%10|0}if(r=r||e<0||void 0!==a[l+1]||(s<0?f:f%w(10,i-s-1)),c=t<4?(c||r)&&(0==t||t==(n.s<0?3:2)):5<c||5==c&&(4==t||r||6==t&&(0<o?0<s?f/w(10,i-s):0:a[l-1])%10&1||t==(n.s<0?8:7)),e<1||!a[0])return a.length=0,c?(e-=n.e+1,a[0]=w(10,(_-e%_)%_),n.e=-e||0):a[0]=n.e=0,n;if(0==o?(a.length=l,u=1,l--):(a.length=l+1,u=w(10,_-o),a[l]=0<s?(f/w(10,i-s)%w(10,s)|0)*u:0),c)for(;;){if(0==l){for(o=1,s=a[0];10<=s;s/=10)o++;for(s=a[0]+=u,u=1;10<=s;s/=10)u++;o!=u&&(n.e++,a[0]==F&&(a[0]=1));break}if(a[l]+=u,a[l]!=F)break;a[l--]=0,u=1}for(o=a.length;0===a[--o];)a.pop()}return y&&(n.e>h.maxE?(n.d=null,n.e=NaN):n.e<h.minE&&(n.e=0,n.d=[0])),n}function k(n,e,t){if(!n.isFinite())return W(n);var r,i=n.e,o=O(n.d),s=o.length;return e?(t&&0<(r=t-s)?o=o.charAt(0)+"."+o.slice(1)+H(r):1<s&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(n.e<0?"e":"e+")+n.e):i<0?(o="0."+H(-i-1)+o,t&&0<(r=t-s)&&(o+=H(r))):s<=i?(o+=H(i+1-s),t&&0<(r=t-i-1)&&(o=o+"."+H(r))):((r=i+1)<s&&(o=o.slice(0,r)+"."+o.slice(r)),t&&0<(r=t-s)&&(i+1===s&&(o+="."),o+=H(r))),o}function R(n,e){var t=n[0];for(e*=_;10<=t;t/=10)e++;return e}function I(n,e,t){if(N<e)throw y=!0,t&&(n.precision=t),Error(f);return L(new n(r),e,1,!0)}function C(n,e,t){if(x<e)throw Error(f);return L(new n(i),e,t,!0)}function U(n){var e=n.length-1,t=e*_+1;if(e=n[e]){for(;e%10==0;e/=10)t--;for(e=n[0];10<=e;e/=10)t++}return t}function H(n){for(var e="";n--;)e+="0";return e}function B(n,e,t,r){var i,o=new n(1),s=Math.ceil(r/_+4);for(y=!1;;){if(t%2&&Q((o=o.times(e)).d,s)&&(i=!0),0===(t=q(t/2))){t=o.d.length-1,i&&0===o.d[t]&&++o.d[t];break}Q((e=e.times(e)).d,s)}return y=!0,o}function V(n){return 1&n.d[n.d.length-1]}function n(n,e,t){for(var r,i=new n(e[0]),o=0;++o<e.length;){if(!(r=new n(e[o])).s){i=r;break}i[t](r)&&(i=r)}return i}function $(n,e){var t,r,i,o,s,u,c,f=0,a=0,l=0,h=n.constructor,d=h.rounding,p=h.precision;if(!n.d||!n.d[0]||17<n.e)return new h(n.d?n.d[0]?n.s<0?0:1/0:1:n.s?n.s<0?0:n:NaN);for(c=null==e?(y=!1,p):e,u=new h(.03125);-2<n.e;)n=n.times(u),l+=5;for(c+=r=Math.log(w(2,l))/Math.LN10*2+5|0,t=o=s=new h(1),h.precision=c;;){if(o=L(o.times(n),c,1),t=t.times(++a),O((u=s.plus(P(o,t,c,1))).d).slice(0,c)===O(s.d).slice(0,c)){for(i=l;i--;)s=L(s.times(s),c,1);if(null!=e)return h.precision=p,s;if(!(f<3&&M(s.d,c-r,d,f)))return L(s,h.precision=p,d,y=!0);h.precision=c+=10,t=o=u=new h(1),a=0,f++}s=u}}function z(n,e){var t,r,i,o,s,u,c,f,a,l,h,d=1,p=n,g=p.d,m=p.constructor,w=m.rounding,v=m.precision;if(p.s<0||!g||!g[0]||!p.e&&1==g[0]&&1==g.length)return new m(g&&!g[0]?-1/0:1!=p.s?NaN:g?0:p);if(a=null==e?(y=!1,v):e,m.precision=a+=10,r=(t=O(g)).charAt(0),!(Math.abs(o=p.e)<15e14))return f=I(m,a+2,v).times(o+""),p=z(new m(r+"."+t.slice(1)),a-10).plus(f),m.precision=v,null==e?L(p,v,w,y=!0):p;for(;r<7&&1!=r||1==r&&3<t.charAt(1);)r=(t=O((p=p.times(n)).d)).charAt(0),d++;for(o=p.e,1<r?(p=new m("0."+t),o++):p=new m(r+"."+t.slice(1)),c=s=p=P((l=p).minus(1),p.plus(1),a,1),h=L(p.times(p),a,1),i=3;;){if(s=L(s.times(h),a,1),O((f=c.plus(P(s,new m(i),a,1))).d).slice(0,a)===O(c.d).slice(0,a)){if(c=c.times(2),0!==o&&(c=c.plus(I(m,a+2,v).times(o+""))),c=P(c,new m(d),a,1),null!=e)return m.precision=v,c;if(!M(c.d,a-10,w,u))return L(c,m.precision=v,w,y=!0);m.precision=a+=10,f=s=p=P(l.minus(1),l.plus(1),a,1),h=L(p.times(p),a,1),i=u=1}c=f,i+=2}}function W(n){return String(n.s*n.s/0)}function J(n,e){var t,r,i;for(0<(r=(e=-1<(t=e.indexOf("."))?e.replace(".",""):e).search(/e/i))?(t<0&&(t=r),t+=+e.slice(r+1),e=e.substring(0,r)):t<0&&(t=e.length),r=0;48===e.charCodeAt(r);r++);for(i=e.length;48===e.charCodeAt(i-1);--i);if(e=e.slice(r,i)){if(i-=r,n.e=t=t-r-1,n.d=[],r=(t+1)%_,t<0&&(r+=_),r<i){for(r&&n.d.push(+e.slice(0,r)),i-=_;r<i;)n.d.push(+e.slice(r,r+=_));e=e.slice(r),r=_-e.length}else r-=i;for(;r--;)e+="0";n.d.push(+e),y&&(n.e>n.constructor.maxE?(n.d=null,n.e=NaN):n.e<n.constructor.minE&&(n.e=0,n.d=[0]))}else n.e=0,n.d=[0];return n}function G(n,e,t,r,i){var o,s,u,c,f=n.precision,a=Math.ceil(f/_);for(y=!1,c=t.times(t),u=new n(r);;){if(s=P(u.times(c),new n(e++*e++),f,1),u=i?r.plus(s):r.minus(s),r=P(s.times(c),new n(e++*e++),f,1),void 0!==(s=u.plus(r)).d[a]){for(o=a;s.d[o]===u.d[o]&&o--;);if(-1==o)break}o=u,u=r,r=s,s=o,0}return y=!0,s.d.length=a+1,s}function K(n,e){for(var t=n;--e;)t*=n;return t}function Y(n,e){var t=e.s<0,r=C(n,n.precision,1),i=r.times(.5);if((e=e.abs()).lte(i))return o=t?4:1,e;if((n=e.divToInt(r)).isZero())o=t?3:2;else{if((e=e.minus(n.times(r))).lte(i))return o=V(n)?t?2:3:t?4:1,e;o=V(n)?t?1:4:t?3:2}return e.minus(r).abs()}function t(n,e,t,r){var i,o,s,u,c,f,a,l,h=n.constructor,d=void 0!==t;if(d?(S(t,1,p),void 0===r?r=h.rounding:S(r,0,8)):(t=h.precision,r=h.rounding),n.isFinite()){for(d?(i=2,16==e?t=4*t-3:8==e&&(t=3*t-2)):i=e,0<=(s=(f=k(n)).indexOf("."))&&(f=f.replace(".",""),(l=new h(1)).e=f.length-s,l.d=j(k(l),10,i),l.e=l.d.length),o=u=(a=j(f,10,i)).length;0==a[--u];)a.pop();if(a[0]){if(s<0?o--:((n=new h(n)).d=a,n.e=o,a=(n=P(n,l,t,r,0,i)).d,o=n.e,c=T),s=a[t],l=i/2,c=c||void 0!==a[t+1],c=r<4?(void 0!==s||c)&&(0===r||r===(n.s<0?3:2)):l<s||s===l&&(4===r||c||6===r&&1&a[t-1]||r===(n.s<0?8:7)),a.length=t,c)for(;++a[--t]>i-1;)a[t]=0,t||(++o,a.unshift(1));for(u=a.length;!a[u-1];--u);for(s=0,f="";s<u;s++)f+=g.charAt(a[s]);if(d){if(1<u)if(16==e||8==e){for(s=16==e?4:3,--u;u%s;u++)f+="0";for(u=(a=j(f,i,e)).length;!a[u-1];--u);for(s=1,f="1.";s<u;s++)f+=g.charAt(a[s])}else f=f.charAt(0)+"."+f.slice(1);f=f+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)f="0"+f;f="0."+f}else if(++o>u)for(o-=u;o--;)f+="0";else o<u&&(f=f.slice(0,o)+"."+f.slice(o))}else f=d?"0p+0":"0";f=(16==e?"0x":2==e?"0b":8==e?"0o":"")+f}else f=W(n);return n.s<0?"-"+f:f}function Q(n,e){return n.length>e&&(n.length=e,1)}function X(n){return new this(n).abs()}function nn(n){return new this(n).acos()}function en(n){return new this(n).acosh()}function tn(n,e){return new this(n).plus(e)}function rn(n){return new this(n).asin()}function on(n){return new this(n).asinh()}function sn(n){return new this(n).atan()}function un(n){return new this(n).atanh()}function cn(n,e){n=new this(n),e=new this(e);var t,r=this.precision,i=this.rounding,o=r+4;return n.s&&e.s?n.d||e.d?!e.d||n.isZero()?(t=e.s<0?C(this,r,i):new this(0)).s=n.s:!n.d||e.isZero()?(t=C(this,o,1).times(.5)).s=n.s:t=e.s<0?(this.precision=o,this.rounding=1,t=this.atan(P(n,e,o,1)),e=C(this,o,1),this.precision=r,this.rounding=i,n.s<0?t.minus(e):t.plus(e)):this.atan(P(n,e,o,1)):(t=C(this,o,1).times(0<e.s?.25:.75)).s=n.s:t=new this(NaN),t}function fn(n){return new this(n).cbrt()}function an(n){return L(n=new this(n),n.e+1,2)}function ln(n,e,t){return new this(n).clamp(e,t)}function hn(n){if(!n||"object"!=typeof n)throw Error(c+"Object expected");for(var e,t,r=!0===n.defaults,i=["precision",1,p,"rounding",0,8,"toExpNeg",-s,0,"toExpPos",0,s,"maxE",0,s,"minE",-s,0,"modulo",0,9],o=0;o<i.length;o+=3)if(e=i[o],r&&(this[e]=u[e]),void 0!==(t=n[e])){if(!(q(t)===t&&i[o+1]<=t&&t<=i[o+2]))throw Error(m+e+": "+t);this[e]=t}if(e="crypto",r&&(this[e]=u[e]),void 0!==(t=n[e])){if(!0!==t&&!1!==t&&0!==t&&1!==t)throw Error(m+e+": "+t);if(t){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(l);this[e]=!0}else this[e]=!1}return this}function dn(n){return new this(n).cos()}function pn(n){return new this(n).cosh()}function gn(n,e){return new this(n).div(e)}function mn(n){return new this(n).exp()}function wn(n){return L(n=new this(n),n.e+1,3)}function vn(){var n,e,t=new this(0);for(y=!1,n=0;n<arguments.length;)if((e=new this(arguments[n++])).d)t.d&&(t=t.plus(e.times(e)));else{if(e.s)return y=!0,new this(1/0);t=e}return y=!0,t.sqrt()}function yn(n){return n instanceof a||n&&n.toStringTag===e||!1}function bn(n){return new this(n).ln()}function Nn(n,e){return new this(n).log(e)}function xn(n){return new this(n).log(2)}function En(n){return new this(n).log(10)}function On(){return n(this,arguments,"lt")}function Sn(){return n(this,arguments,"gt")}function Mn(n,e){return new this(n).mod(e)}function jn(n,e){return new this(n).mul(e)}function Pn(n,e){return new this(n).pow(e)}function Tn(n){var e,t,r,i,o=0,s=new this(1),u=[];if(void 0===n?n=this.precision:S(n,1,p),r=Math.ceil(n/_),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(r));o<r;)429e7<=(i=e[o])?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(l);for(e=crypto.randomBytes(r*=4);o<r;)214e7<=(i=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((127&e[o+3])<<24))?crypto.randomBytes(4).copy(e,o):(u.push(i%1e7),o+=4);o=r/4}else for(;o<r;)u[o++]=1e7*Math.random()|0;for(r=u[--o],n%=_,r&&n&&(i=w(10,_-n),u[o]=(r/i|0)*i);0===u[o];o--)u.pop();if(o<0)u=[t=0];else{for(t=-1;0===u[0];t-=_)u.shift();for(r=1,i=u[0];10<=i;i/=10)r++;r<_&&(t-=_-r)}return s.e=t,s.d=u,s}function qn(n){return L(n=new this(n),n.e+1,this.rounding)}function Fn(n){return(n=new this(n)).d?n.d[0]?n.s:0*n.s:n.s||NaN}function _n(n){return new this(n).sin()}function An(n){return new this(n).sinh()}function Dn(n){return new this(n).sqrt()}function Zn(n,e){return new this(n).sub(e)}function Ln(){var n=0,e=arguments,t=new this(e[n]);for(y=!1;t.s&&++n<e.length;)t=t.plus(e[n]);return y=!0,L(t,this.precision,this.rounding)}function kn(n){return new this(n).tan()}function Rn(n){return new this(n).tanh()}function In(n){return L(n=new this(n),n.e+1,1)}((a=function n(e){var t,r,i;function o(n){var e,t,r,i=this;if(!(i instanceof o))return new o(n);if(i.constructor=o,yn(n))return i.s=n.s,void(y?!n.d||n.e>o.maxE?(i.e=NaN,i.d=null):n.e<o.minE?(i.e=0,i.d=[0]):(i.e=n.e,i.d=n.d.slice()):(i.e=n.e,i.d=n.d&&n.d.slice()));if("number"==(r=typeof n)){if(0===n)return i.s=1/n<0?-1:1,i.e=0,void(i.d=[0]);if(n<0?(n=-n,i.s=-1):i.s=1,n===~~n&&n<1e7){for(e=0,t=n;10<=t;t/=10)e++;return void(y?o.maxE<e?(i.e=NaN,i.d=null):e<o.minE?(i.e=0,i.d=[0]):(i.e=e,i.d=[n]):(i.e=e,i.d=[n]))}return 0*n!=0?(n||(i.s=NaN),i.e=NaN,void(i.d=null)):J(i,n.toString())}if("string"!=r)throw Error(m+n);return 45===(t=n.charCodeAt(0))?(n=n.slice(1),i.s=-1):(43===t&&(n=n.slice(1)),i.s=1),(b.test(n)?J:function(n,e){var t,r,i,o,s,u,c,f;if(-1<e.indexOf("_")){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),b.test(e))return J(n,e)}else if("Infinity"===e||"NaN"===e)return+e||(n.s=NaN),n.e=NaN,n.d=null,n;if(d.test(e))f=16,e=e.toLowerCase();else if(h.test(e))f=2;else{if(!v.test(e))throw Error(m+e);f=8}for(i=(e=0<(i=e.search(/p/i))?(u=+e.slice(i+1),e.substring(2,i)):e.slice(2)).indexOf("."),t=n.constructor,(o=0<=i)&&(i=(s=(e=e.replace(".","")).length)-i,r=B(t,new t(f),i,2*i)),i=f=(c=j(e,f,F)).length-1;0===c[i];--i)c.pop();return i<0?new t(0*n.s):(n.e=R(c,f),n.d=c,y=!1,o&&(n=P(n,r,4*s)),u&&(n=n.times(Math.abs(u)<54?w(2,u):a.pow(2,u))),y=!0,n)})(i,n)}if(o.prototype=E,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=hn,o.clone=n,o.isDecimal=yn,o.abs=X,o.acos=nn,o.acosh=en,o.add=tn,o.asin=rn,o.asinh=on,o.atan=sn,o.atanh=un,o.atan2=cn,o.cbrt=fn,o.ceil=an,o.clamp=ln,o.cos=dn,o.cosh=pn,o.div=gn,o.exp=mn,o.floor=wn,o.hypot=vn,o.ln=bn,o.log=Nn,o.log10=En,o.log2=xn,o.max=On,o.min=Sn,o.mod=Mn,o.mul=jn,o.pow=Pn,o.random=Tn,o.round=qn,o.sign=Fn,o.sin=_n,o.sinh=An,o.sqrt=Dn,o.sub=Zn,o.sum=Ln,o.tan=kn,o.tanh=Rn,o.trunc=In,(e=void 0===e?{}:e)&&!0!==e.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(r=i[t++])||(e[r]=this[r]);return o.config(e),o}(u)).prototype.constructor=a).default=a.Decimal=a,r=new a(r),i=new a(i),void 0===(Bn=function(){return a}.call(Un,Hn,Un,Cn))||(Cn.exports=Bn)}()}},r={};function i(n){var e=r[n];if(void 0!==e)return e.exports;e=r[n]={exports:{}};return t[n].call(e.exports,e,e.exports,i),e.exports}i.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return i.d(e,{a:e}),e},i.d=(n,e)=>{for(var t in e)i.o(e,t)&&!i.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),i.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),i.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var o={};return(()=>{"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}i.r(o),i.d(o,{default:()=>e});i(86);var n=i(3776),r=i.n(n);const e={isJsonStr:function(n){if("string"==typeof n)try{var e=JSON.parse(n);return"object"===t(e)&&e?!0:!1}catch(n){return!1}},plus:function(n,e){return new(r())(n).add(e).toNumber()},minus:function(n,e){return new(r())(n).sub(e).toNumber()},times:function(n,e){return new(r())(n).mul(e).toNumber()},div:function(n,e){return new(r())(n).div(e).toNumber()}}})(),o})()});