UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif

33 lines 668 kB
/** * math.js * https://github.com/josdejong/mathjs * * Math.js is an extensive math library for JavaScript and Node.js, * It features real and complex numbers, units, matrices, a large set of * mathematical functions, and a flexible expression parser. * * @version 10.0.0 * @date 2021-11-03 * * @license * Copyright (C) 2013-2021 Jos de Jong <wjosdejong@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=269)}([function(e,t,r){var n=r(129),i=r(40),a=r(206);n||i(Object.prototype,"toString",a,{unsafe:!0})},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,r(202))},function(e,t,r){var n=r(1),i=r(65).f,a=r(58),o=r(40),s=r(125),u=r(152),c=r(92);e.exports=function(e,t){var r,f,l,p,h,m=e.target,d=e.global,v=e.stat;if(r=d?n:v?n[m]||s(m,{}):(n[m]||{}).prototype)for(f in t){if(p=t[f],l=e.noTargetGet?(h=i(r,f))&&h.value:r[f],!c(d?f:m+(v?".":"#")+f,e.forced)&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(e.sham||l&&l.sham)&&a(p,"sham",!0),o(r,f,p,e)}}},,function(e,t,r){r(2)({target:"Array",stat:!0},{isArray:r(79)})},function(e,t,r){"use strict";var n=r(2),i=r(69).map;n({target:"Array",proto:!0,forced:!r(94)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t){var r=Function.prototype,n=r.bind,i=r.call,a=n&&n.bind(i);e.exports=n?function(e){return e&&a(i,e)}:function(e){return e&&function(){return i.apply(e,arguments)}}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(2),i=r(159);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},function(e,t,r){var n=r(1),i=r(160),a=r(161),o=r(159),s=r(58),u=function(e){if(e&&e.forEach!==o)try{s(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&u(n[c]&&n[c].prototype);u(a)},function(e,t,r){var n=r(6),i=r(40),a=Date.prototype,o=n(a.toString),s=n(a.getTime);"Invalid Date"!=String(new Date(NaN))&&i(a,"toString",(function(){var e=s(this);return e==e?o(this):"Invalid Date"}))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";var n=r(6),i=r(91).PROPER,a=r(40),o=r(25),s=r(56),u=r(29),c=r(11),f=r(133),l=RegExp.prototype,p=l.toString,h=n(f),m=c((function(){return"/a/b"!=p.call({source:"a",flags:"b"})})),d=i&&"toString"!=p.name;(m||d)&&a(RegExp.prototype,"toString",(function(){var e=o(this),t=u(e.source),r=e.flags;return"/"+t+"/"+u(void 0===r&&s(l,e)&&!("flags"in l)?h(e):r)}),{unsafe:!0})},function(e,t,r){"use strict";var n=r(2),i=r(114);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(e,t,r){"use strict";var n,i,a,o,s=r(2),u=r(89),c=r(1),f=r(51),l=r(27),p=r(240),h=r(40),m=r(184),d=r(132),v=r(98),y=r(134),g=r(57),x=r(18),b=r(23),w=r(145),N=r(107),M=r(143),E=r(146),S=r(169),A=r(187).set,O=r(241),_=r(244),C=r(245),T=r(189),I=r(246),k=r(48),z=r(92),R=r(19),q=r(247),B=r(115),D=r(75),j=R("species"),P=k.get,F=k.set,U=k.getterFor("Promise"),L=p&&p.prototype,$=p,H=L,G=c.TypeError,V=c.document,Z=c.process,W=T.f,Y=W,J=!!(V&&V.createEvent&&c.dispatchEvent),X=x(c.PromiseRejectionEvent),Q=!1,K=z("Promise",(function(){var e=N($),t=e!==String($);if(!t&&66===D)return!0;if(u&&!H.finally)return!0;if(D>=51&&/native code/.test(e))return!1;var r=new $((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[j]=n,!(Q=r.then((function(){}))instanceof n)||!t&&q&&!X})),ee=K||!E((function(e){$.all(e).catch((function(){}))})),te=function(e){var t;return!(!b(e)||!x(t=e.then))&&t},re=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;O((function(){for(var n=e.value,i=1==e.state,a=0;r.length>a;){var o,s,u,c=r[a++],f=i?c.ok:c.fail,p=c.resolve,h=c.reject,m=c.domain;try{f?(i||(2===e.rejection&&oe(e),e.rejection=1),!0===f?o=n:(m&&m.enter(),o=f(n),m&&(m.exit(),u=!0)),o===c.promise?h(G("Promise-chain cycle")):(s=te(o))?l(s,o,p,h):p(o)):h(n)}catch(e){m&&!u&&m.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ie(e)}))}},ne=function(e,t,r){var n,i;J?((n=V.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!X&&(i=c["on"+e])?i(n):"unhandledrejection"===e&&C("Unhandled promise rejection",r)},ie=function(e){l(A,c,(function(){var t,r=e.facade,n=e.value;if(ae(e)&&(t=I((function(){B?Z.emit("unhandledRejection",n,r):ne("unhandledrejection",r,n)})),e.rejection=B||ae(e)?2:1,t.error))throw t.value}))},ae=function(e){return 1!==e.rejection&&!e.parent},oe=function(e){l(A,c,(function(){var t=e.facade;B?Z.emit("rejectionHandled",t):ne("rejectionhandled",t,e.value)}))},se=function(e,t,r){return function(n){e(t,n,r)}},ue=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,re(e,!0))},ce=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw G("Promise can't be resolved itself");var n=te(t);n?O((function(){var r={done:!1};try{l(n,t,se(ce,r,e),se(ue,r,e))}catch(t){ue(r,t,e)}})):(e.value=t,e.state=1,re(e,!1))}catch(t){ue({done:!1},t,e)}}};if(K&&(H=($=function(e){w(this,H),g(e),l(n,this);var t=P(this);try{e(se(ce,t),se(ue,t))}catch(e){ue(t,e)}}).prototype,(n=function(e){F(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=m(H,{then:function(e,t){var r=U(this),n=r.reactions,i=W(S(this,$));return i.ok=!x(e)||e,i.fail=x(t)&&t,i.domain=B?Z.domain:void 0,r.parent=!0,n[n.length]=i,0!=r.state&&re(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=P(e);this.promise=e,this.resolve=se(ce,t),this.reject=se(ue,t)},T.f=W=function(e){return e===$||e===a?new i(e):Y(e)},!u&&x(p)&&L!==Object.prototype)){o=L.then,Q||(h(L,"then",(function(e,t){var r=this;return new $((function(e,t){l(o,r,e,t)})).then(e,t)}),{unsafe:!0}),h(L,"catch",H.catch,{unsafe:!0}));try{delete L.constructor}catch(e){}d&&d(L,H)}s({global:!0,wrap:!0,forced:K},{Promise:$}),v($,"Promise",!1,!0),y("Promise"),a=f("Promise"),s({target:"Promise",stat:!0,forced:K},{reject:function(e){var t=W(this);return l(t.reject,void 0,e),t.promise}}),s({target:"Promise",stat:!0,forced:u||K},{resolve:function(e){return _(u&&this===a?$:this,e)}}),s({target:"Promise",stat:!0,forced:ee},{all:function(e){var t=this,r=W(t),n=r.resolve,i=r.reject,a=I((function(){var r=g(t.resolve),a=[],o=0,s=1;M(e,(function(e){var u=o++,c=!1;s++,l(r,t,e).then((function(e){c||(c=!0,a[u]=e,--s||n(a))}),i)})),--s||n(a)}));return a.error&&i(a.value),r.promise},race:function(e){var t=this,r=W(t),n=r.reject,i=I((function(){var i=g(t.resolve);M(e,(function(e){l(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},function(e,t,r){var n=r(21),i=r(91).EXISTS,a=r(6),o=r(24).f,s=Function.prototype,u=a(s.toString),c=/^\s*function ([^ (]*)/,f=a(c.exec);n&&!i&&o(s,"name",{configurable:!0,get:function(){try{return f(c,u(this))[1]}catch(e){return""}}})},function(e,t,r){"use strict";var n=r(2),i=r(11),a=r(36),o=r(122);n({target:"Date",proto:!0,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=a(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},function(e,t,r){"use strict";var n=r(2),i=r(27);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},function(e,t){e.exports=function(e){return"function"==typeof e}},function(e,t,r){var n=r(1),i=r(104),a=r(28),o=r(105),s=r(123),u=r(150),c=i("wks"),f=n.Symbol,l=f&&f.for,p=u?f:f&&f.withoutSetter||o;e.exports=function(e){if(!a(c,e)||!s&&"string"!=typeof c[e]){var t="Symbol."+e;s&&a(f,e)?c[e]=f[e]:c[e]=u&&l?l(t):p(t)}return c[e]}},function(e,t,r){"use strict";var n=r(2),i=r(6),a=r(100),o=r(43),s=r(68),u=i([].join),c=a!=Object,f=s("join",",");n({target:"Array",proto:!0,forced:c||!f},{join:function(e){return u(o(this),void 0===e?",":e)}})},function(e,t,r){var n=r(11);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,r){"use strict";var n=r(2),i=r(1),a=r(79),o=r(111),s=r(23),u=r(109),c=r(49),f=r(43),l=r(96),p=r(19),h=r(94),m=r(70),d=h("slice"),v=p("species"),y=i.Array,g=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(e,t){var r,n,i,p=f(this),h=c(p),d=u(e,h),x=u(void 0===t?h:t,h);if(a(p)&&(r=p.constructor,(o(r)&&(r===y||a(r.prototype))||s(r)&&null===(r=r[v]))&&(r=void 0),r===y||void 0===r))return m(p,d,x);for(n=new(void 0===r?y:r)(g(x-d,0)),i=0;d<x;d++,i++)d in p&&l(n,i,p[d]);return n.length=i,n}})},function(e,t,r){var n=r(18);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},function(e,t,r){var n=r(1),i=r(21),a=r(151),o=r(25),s=r(101),u=n.TypeError,c=Object.defineProperty;t.f=i?c:function(e,t,r){if(o(e),t=s(t),o(r),a)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(1),i=r(23),a=n.String,o=n.TypeError;e.exports=function(e){if(i(e))return e;throw o(a(e)+" is not an object")}},function(e,t,r){"use strict";var n=r(2),i=r(1),a=r(11),o=r(79),s=r(23),u=r(36),c=r(49),f=r(96),l=r(128),p=r(94),h=r(19),m=r(75),d=h("isConcatSpreadable"),v=i.TypeError,y=m>=51||!a((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),g=p("concat"),x=function(e){if(!s(e))return!1;var t=e[d];return void 0!==t?!!t:o(e)};n({target:"Array",proto:!0,forced:!y||!g},{concat:function(e){var t,r,n,i,a,o=u(this),s=l(o,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(x(a=-1===t?o:arguments[t])){if(p+(i=c(a))>9007199254740991)throw v("Maximum allowed index exceeded");for(r=0;r<i;r++,p++)r in a&&f(s,p,a[r])}else{if(p>=9007199254740991)throw v("Maximum allowed index exceeded");f(s,p++,a)}return s.length=p,s}})},function(e,t){var r=Function.prototype.call;e.exports=r.bind?r.bind(r):function(){return r.apply(r,arguments)}},function(e,t,r){var n=r(6),i=r(36),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},function(e,t,r){var n=r(1),i=r(112),a=n.String;e.exports=function(e){if("Symbol"===i(e))throw TypeError("Cannot convert a Symbol value to a string");return a(e)}},function(e,t,r){"use strict";var n=r(2),i=r(69).find,a=r(141),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),n({target:"Array",proto:!0,forced:o},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("find")},function(e,t,r){var n=r(254),i=r(255),a=r(191),o=r(256);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";var n=r(2),i=r(6),a=r(155).indexOf,o=r(68),s=i([].indexOf),u=!!s&&1/s([1],1,-0)<0,c=o("indexOf");n({target:"Array",proto:!0,forced:u||!c},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return u?s(this,e,t)||0:a(this,e,t)}})},function(e,t,r){"use strict";var n=r(21),i=r(1),a=r(6),o=r(92),s=r(40),u=r(28),c=r(131),f=r(56),l=r(102),p=r(122),h=r(11),m=r(77).f,d=r(65).f,v=r(24).f,y=r(139),g=r(118).trim,x=i.Number,b=x.prototype,w=i.TypeError,N=a("".slice),M=a("".charCodeAt),E=function(e){var t=p(e,"number");return"bigint"==typeof t?t:S(t)},S=function(e){var t,r,n,i,a,o,s,u,c=p(e,"number");if(l(c))throw w("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=g(c),43===(t=M(c,0))||45===t){if(88===(r=M(c,2))||120===r)return NaN}else if(48===t){switch(M(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(a=N(c,2)).length,s=0;s<o;s++)if((u=M(a,s))<48||u>i)return NaN;return parseInt(a,n)}return+c};if(o("Number",!x(" 0o1")||!x("0b1")||x("+0x1"))){for(var A,O=function(e){var t=arguments.length<1?0:x(E(e)),r=this;return f(b,r)&&h((function(){y(r)}))?c(Object(t),r,O):t},_=n?m(x):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),C=0;_.length>C;C++)u(x,A=_[C])&&!u(O,A)&&v(O,A,d(x,A));O.prototype=b,b.constructor=O,s(i,"Number",O)}},function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n; /** * @license Complex.js v2.0.15 12/05/2020 * * Copyright (c) 2020, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/!function(r){"use strict";var i=function(e){return.5*(Math.exp(e)+Math.exp(-e))},a=function(e){return.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function s(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):Math.log(e/Math.cos(Math.atan2(t,e)))}function u(e,t){if(!(this instanceof u))return new u(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return u.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return u.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&o();for(var s=0;s<n.length;s++){var c=n[s];" "===c||"\t"===c||"\n"===c||("+"===c?i++:"-"===c?a++:"i"===c||"I"===c?(i+a===0&&o()," "===n[s+1]||isNaN(n[s+1])?r.im+=parseFloat((a%2?"-":"")+"1"):(r.im+=parseFloat((a%2?"-":"")+n[s+1]),s++),i=a=0):((i+a===0||isNaN(c))&&o(),"i"===n[s+1]||"I"===n[s+1]?(r.im+=parseFloat((a%2?"-":"")+c),s++):r.re+=parseFloat((a%2?"-":"")+c),i=a=0))}i+a>0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}u.prototype={re:0,im:0,sign:function(){var e=this.abs();return new u(this.re/e,this.im/e)},add:function(e,t){var r=new u(e,t);return this.isInfinite()&&r.isInfinite()?u.NAN:this.isInfinite()||r.isInfinite()?u.INFINITY:new u(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new u(e,t);return this.isInfinite()&&r.isInfinite()?u.NAN:this.isInfinite()||r.isInfinite()?u.INFINITY:new u(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new u(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?u.NAN:this.isInfinite()||r.isInfinite()?u.INFINITY:0===r.im&&0===this.im?new u(this.re*r.re,0):new u(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new u(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return u.NAN;if(this.isInfinite()||r.isZero())return u.INFINITY;if(this.isZero()||r.isInfinite())return u.ZERO;e=this.re,t=this.im;var n,i,a=r.re,o=r.im;return 0===o?new u(e/a,t/a):Math.abs(a)<Math.abs(o)?new u((e*(i=a/o)+t)/(n=a*i+o),(t*i-e)/n):new u((e+t*(i=o/a))/(n=o*i+a),(t-e*i)/n)},pow:function(e,t){var r=new u(e,t);if(e=this.re,t=this.im,r.isZero())return u.ONE;if(0===r.im){if(0===t&&e>0)return new u(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new u(Math.pow(t,r.re),0);case 1:return new u(0,Math.pow(t,r.re));case 2:return new u(-Math.pow(t,r.re),0);case 3:return new u(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return u.ZERO;var n=Math.atan2(t,e),i=s(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new u(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,i=this.abs();if(r>=0){if(0===n)return new u(Math.sqrt(r),0);e=.5*Math.sqrt(2*(i+r))}else e=Math.abs(n)/Math.sqrt(2*(i-r));return t=r<=0?.5*Math.sqrt(2*(i-r)):Math.abs(n)/Math.sqrt(2*(i+r)),new u(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new u(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new u(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new u(s(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r<n?(r=n,n=e/t):n=t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new u(Math.sin(e)*i(t),Math.cos(e)*a(t))},cos:function(){var e=this.re,t=this.im;return new u(Math.cos(e)*i(t),-Math.sin(e)*a(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+i(t);return new u(Math.sin(e)/r,a(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-i(t);return new u(-Math.sin(e)/r,a(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*i(2*t)+.5*Math.cos(2*e);return new u(Math.cos(e)*i(t)/r,Math.sin(e)*a(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*i(2*t)-.5*Math.cos(2*e);return new u(Math.sin(e)*i(t)/r,-Math.cos(e)*a(t)/r)},asin:function(){var e=this.re,t=this.im,r=new u(t*t-e*e+1,-2*e*t).sqrt(),n=new u(r.re-t,r.im+e).log();return new u(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new u(t*t-e*e+1,-2*e*t).sqrt(),n=new u(r.re-t,r.im+e).log();return new u(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new u(0,1/0);if(-1===t)return new u(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new u((1-t*t-e*e)/r,-2*e/r).log();return new u(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new u(Math.atan2(1,e),0);var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).atan():new u(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new u(0,1/0);var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).acos():new u(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new u(Math.PI/2,1/0);var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).asin():new u(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new u(a(e)*Math.cos(t),i(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new u(i(e)*Math.cos(t),a(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=i(e)+Math.cos(t);return new u(a(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=i(e)-Math.cos(t);return new u(a(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-i(2*e);return new u(-2*a(e)*Math.cos(t)/r,2*i(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+i(2*e);return new u(2*i(e)*Math.cos(t)/r,-2*a(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else{t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&0===t,n=1-e,i=1+e,a=n*n+t*t,o=0!==a?new u((i*n-t*t)/a,(t*n+i*t)/a):new u(-1!==e?e/0:0,0!==t?t/0:0),c=o.re;return o.re=s(o.re,o.im)/2,o.im=Math.atan2(o.im,c)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new u(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).atanh():new u(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new u(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).asinh():new u(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return u.INFINITY;var r=e*e+t*t;return 0!==r?new u(e/r,-t/r).acosh():new u(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return u.INFINITY;if(this.isInfinite())return u.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new u(e/r,-t/r)},conjugate:function(){return new u(this.re,-this.im)},neg:function(){return new u(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new u(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new u(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new u(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new u(e,t);return Math.abs(r.re-this.re)<=u.EPSILON&&Math.abs(r.im-this.im)<=u.EPSILON},clone:function(){return new u(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<u.EPSILON&&(e=0),Math.abs(t)<u.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},u.ZERO=new u(0,0),u.ONE=new u(1,0),u.I=new u(0,1),u.PI=new u(Math.PI,0),u.E=new u(Math.E,0),u.INFINITY=new u(1/0,1/0),u.NAN=new u(NaN,NaN),u.EPSILON=1e-15,void 0===(n=function(){return u}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){var n=r(1),i=r(47),a=n.Object;e.exports=function(e){return a(i(e))}},function(e,t,r){var n=r(2),i=r(36),a=r(127);n({target:"Object",stat:!0,forced:r(11)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},function(e,t,r){"use strict";var n=r(2),i=r(1),a=r(109),o=r(59),s=r(49),u=r(36),c=r(128),f=r(96),l=r(94)("splice"),p=i.TypeError,h=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!l},{splice:function(e,t){var r,n,i,l,d,v,y=u(this),g=s(y),x=a(e,g),b=arguments.length;if(0===b?r=n=0:1===b?(r=0,n=g-x):(r=b-2,n=m(h(o(t),0),g-x)),g+r-n>9007199254740991)throw p("Maximum allowed length exceeded");for(i=c(y,n),l=0;l<n;l++)(d=x+l)in y&&f(i,l,y[d]);if(i.length=n,r<n){for(l=x;l<g-n;l++)v=l+r,(d=l+n)in y?y[v]=y[d]:delete y[v];for(l=g;l>g-n+r;l--)delete y[l-1]}else if(r>n)for(l=g-n;l>x;l--)v=l+r-1,(d=l+n-1)in y?y[v]=y[d]:delete y[v];for(l=0;l<r;l++)y[l+x]=arguments[l+2];return y.length=g-n+r,i}})},function(e,t,r){"use strict";var n=r(43),i=r(141),a=r(97),o=r(48),s=r(142),u=o.set,c=o.getterFor("Array Iterator");e.exports=s(Array,"Array",(function(e,t){u(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},function(e,t,r){var n=r(1),i=r(18),a=r(28),o=r(58),s=r(125),u=r(107),c=r(48),f=r(91).CONFIGURABLE,l=c.get,p=c.enforce,h=String(String).split("String");(e.exports=function(e,t,r,u){var c,l=!!u&&!!u.unsafe,m=!!u&&!!u.enumerable,d=!!u&&!!u.noTargetGet,v=u&&void 0!==u.name?u.name:t;i(r)&&("Symbol("===String(v).slice(0,7)&&(v="["+String(v).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!a(r,"name")||f&&r.name!==v)&&o(r,"name",v),(c=p(r)).source||(c.source=h.join("string"==typeof v?v:""))),e!==n?(l?!d&&e[t]&&(m=!0):delete e[t],m?e[t]=r:o(e,t,r)):m?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return i(this)&&l(this).source||u(this)}))},function(e,t,r){var n=r(1),i=r(160),a=r(161),o=r(39),s=r(58),u=r(19),c=u("iterator"),f=u("toStringTag"),l=o.values,p=function(e,t){if(e){if(e[c]!==l)try{s(e,c,l)}catch(t){e[c]=l}if(e[f]||s(e,f,t),i[t])for(var r in o)if(e[r]!==o[r])try{s(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var h in i)p(n[h]&&n[h].prototype,h);p(a,"DOMTokenList")},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,r){var n=r(100),i=r(47);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=r(2),i=r(6),a=r(57),o=r(36),s=r(49),u=r(29),c=r(11),f=r(210),l=r(68),p=r(211),h=r(212),m=r(75),d=r(213),v=[],y=i(v.sort),g=i(v.push),x=c((function(){v.sort(void 0)})),b=c((function(){v.sort(null)})),w=l("sort"),N=!c((function(){if(m)return m<70;if(!(p&&p>3)){if(h)return!0;if(d)return d<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)v.push({k:t+n,v:r})}for(v.sort((function(e,t){return t.v-e.v})),n=0;n<v.length;n++)t=v[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:x||!b||!w||!N},{sort:function(e){void 0!==e&&a(e);var t=o(this);if(N)return void 0===e?y(t):y(t,e);var r,n,i=[],c=s(t);for(n=0;n<c;n++)n in t&&g(i,t[n]);for(f(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:u(t)>u(r)?1:-1}}(e)),r=i.length,n=0;n<r;)t[n]=i[n++];for(;n<c;)delete t[n++];return t}})},function(e,t,r){"use strict";var n=r(2),i=r(69).filter;n({target:"Array",proto:!0,forced:!r(94)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(6),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},function(e,t,r){var n=r(1).TypeError;e.exports=function(e){if(null==e)throw n("Can't call method on "+e);return e}},function(e,t,r){var n,i,a,o=r(204),s=r(1),u=r(6),c=r(23),f=r(58),l=r(28),p=r(124),h=r(108),m=r(90),d=s.TypeError,v=s.WeakMap;if(o||p.state){var y=p.state||(p.state=new v),g=u(y.get),x=u(y.has),b=u(y.set);n=function(e,t){if(x(y,e))throw new d("Object already initialized");return t.facade=e,b(y,e,t),t},i=function(e){return g(y,e)||{}},a=function(e){return x(y,e)}}else{var w=h("state");m[w]=!0,n=function(e,t){if(l(e,w))throw new d("Object already initialized");return t.facade=e,f(e,w,t),t},i=function(e){return l(e,w)?e[w]:{}},a=function(e){return l(e,w)}}e.exports={set:n,get:i,has:a,enforce:function(e){return a(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=i(t)).type!==e)throw d("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){var n=r(110);e.exports=function(e){return n(e.length)}},function(e,t,r){"use strict";var n=r(2),i=r(1),a=r(51),o=r(95),s=r(27),u=r(6),c=r(89),f=r(21),l=r(123),p=r(11),h=r(28),m=r(79),d=r(18),v=r(23),y=r(56),g=r(102),x=r(25),b=r(36),w=r(43),N=r(101),M=r(29),E=r(88),S=r(67),A=r(127),O=r(77),_=r(179),C=r(156),T=r(65),I=r(24),k=r(149),z=r(70),R=r(40),q=r(104),B=r(108),D=r(90),j=r(105),P=r(19),F=r(185),U=r(186),L=r(98),$=r(48),H=r(69).forEach,G=B("hidden"),V=P("toPrimitive"),Z=$.set,W=$.getterFor("Symbol"),Y=Object.prototype,J=i.Symbol,X=J&&J.prototype,Q=i.TypeError,K=i.QObject,ee=a("JSON","stringify"),te=T.f,re=I.f,ne=_.f,ie=k.f,ae=u([].push),oe=q("symbols"),se=q("op-symbols"),ue=q("string-to-symbol-registry"),ce=q("symbol-to-string-registry"),fe=q("wks"),le=!K||!K.prototype||!K.prototype.findChild,pe=f&&p((function(){return 7!=S(re({},"a",{get:function(){return re(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=te(Y,t);n&&delete Y[t],re(e,t,r),n&&e!==Y&&re(Y,t,n)}:re,he=function(e,t){var r=oe[e]=S(X);return Z(r,{type:"Symbol",tag:e,description:t}),f||(r.description=t),r},me=function(e,t,r){e===Y&&me(se,t,r),x(e);var n=N(t);return x(r),h(oe,n)?(r.enumerable?(h(e,G)&&e[G][n]&&(e[G][n]=!1),r=S(r,{enumerable:E(0,!1)})):(h(e,G)||re(e,G,E(1,{})),e[G][n]=!0),pe(e,n,r)):re(e,n,r)},de=function(e,t){x(e);var r=w(t),n=A(r).concat(xe(r));return H(n,(function(t){f&&!s(ve,r,t)||me(e,t,r[t])})),e},ve=function(e){var t=N(e),r=s(ie,this,t);return!(this===Y&&h(oe,t)&&!h(se,t))&&(!(r||!h(this,t)||!h(oe,t)||h(this,G)&&this[G][t])||r)},ye=function(e,t){var r=w(e),n=N(t);if(r!==Y||!h(oe,n)||h(se,n)){var i=te(r,n);return!i||!h(oe,n)||h(r,G)&&r[G][n]||(i.enumerable=!0),i}},ge=function(e){var t=ne(w(e)),r=[];return H(t,(function(e){h(oe,e)||h(D,e)||ae(r,e)})),r},xe=function(e){var t=e===Y,r=ne(t?se:w(e)),n=[];return H(r,(function(e){!h(oe,e)||t&&!h(Y,e)||ae(n,oe[e])})),n};(l||(R(X=(J=function(){if(y(X,this))throw Q("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?M(arguments[0]):void 0,t=j(e),r=function(e){this===Y&&s(r,se,e),h(this,G)&&h(this[G],t)&&(this[G][t]=!1),pe(this,t,E(1,e))};return f&&le&&pe(Y,t,{configurable:!0,set:r}),he(t,e)}).prototype,"toString",(function(){return W(this).tag})),R(J,"withoutSetter",(function(e){return he(j(e),e)})),k.f=ve,I.f=me,T.f=ye,O.f=_.f=ge,C.f=xe,F.f=function(e){return he(P(e),e)},f&&(re(X,"description",{configurable:!0,get:function(){return W(this).description}}),c||R(Y,"propertyIsEnumerable",ve,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:J}),H(A(fe),(function(e){U(e)})),n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=M(e);if(h(ue,t))return ue[t];var r=J(t);return ue[t]=r,ce[r]=t,r},keyFor:function(e){if(!g(e))throw Q(e+" is not a symbol");if(h(ce,e))return ce[e]},useSetter:function(){le=!0},useSimple:function(){le=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!f},{create:function(e,t){return void 0===t?S(e):de(S(e),t)},defineProperty:me,defineProperties:de,getOwnPropertyDescriptor:ye}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ge,getOwnPropertySymbols:xe}),n({target:"Object",stat:!0,forced:p((function(){C.f(1)}))},{getOwnPropertySymbols:function(e){return C.f(b(e))}}),ee)&&n({target:"JSON",stat:!0,forced:!l||p((function(){var e=J();return"[null]"!=ee([e])||"{}"!=ee({a:e})||"{}"!=ee(Object(e))}))},{stringify:function(e,t,r){var n=z(arguments),i=t;if((v(t)||void 0!==e)&&!g(e))return m(t)||(t=function(e,t){if(d(i)&&(t=s(i,this,e,t)),!g(t))return t}),n[1]=t,o(ee,null,n)}});if(!X[V]){var be=X.valueOf;R(X,V,(function(e){return s(be,this)}))}L(J,"Symbol"),D[G]=!0},function(e,t,r){var n=r(1),i=r(18),a=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(n[e]):n[e]&&n[e][t]}},function(e,t,r){var n=r(2),i=r(1),a=r(51),o=r(95),s=r(6),u=r(11),c=i.Array,f=a("JSON","stringify"),l=s(/./.exec),p=s("".charAt),h=s("".charCodeAt),m=s("".replace),d=s(1..toString),v=/[\uD800-\uDFFF]/g,y=/^[\uD800-\uDBFF]$/,g=/^[\uDC00-\uDFFF]$/,x=function(e,t,r){var n=p(r,t-1),i=p(r,t+1);return l(y,e)&&!l(g,i)||l(g,e)&&!l(y,n)?"\\u"+d(h(e,0),16):e},b=u((function(){return'"\\udf06\\ud834"'!==f("\udf06\ud834")||'"\\udead"'!==f("\udead")}));f&&n({target:"JSON",stat:!0,forced:b},{stringify:function(e,t,r){for(var n=0,i=arguments.length,a=c(i);n<i;n++)a[n]=arguments[n];var s=o(f,null,a);return"string"==typeof s?m(s,v,x):s}})},function(e,t,r){"use strict";var n=r(95),i=r(27),a=r(6),o=r(136),s=r(165),u=r(25),c=r(47),f=r(169),l=r(137),p=r(110),h=r(29),m=r(76),d=r(70),v=r(138),y=r(114),g=r(113),x=r(11),b=g.UNSUPPORTED_Y,w=Math.min,N=[].push,M=a(/./.exec),E=a(N),S=a("".slice);o("split",(function(e,t,r){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var a=h(c(this)),o=void 0===r?4294967295:r>>>0;if(0===o)return[];if(void 0===e)return[a];if(!s(e))return i(t,a,e,o);for(var u,f,l,p=[],m=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,g=new RegExp(e.source,m+"g");(u=i(y,g,a))&&!((f=g.lastIndex)>v&&(E(p,S(a,v,u.index)),u.length>1&&u.index<a.length&&n(N,p,d(u,1)),l=u[0].length,v=f,p.length>=o));)g.lastIndex===u.index&&g.lastIndex++;return v===a.length?!l&&M(g,"")||E(p,""):E(p,S(a,v)),p.length>o?d(p,0,o):p}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:i(t,this,e,r)}:t,[function(t,r){var n=c(this),o=null==t?void 0:m(t,e);return o?i(o,t,n,r):i(a,h(n),t,r)},function(e,n){var i=u(this),o=h(e),s=r(a,i,o,n,a!==t);if(s.done)return s.value;var c=f(i,RegExp),m=i.unicode,d=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(b?"g":"y"),y=new c(b?"^(?:"+i.source+")":i,d),g=void 0===n?4294967295:n>>>0;if(0===g)return[];if(0===o.length)return null===v(y,o)?[o]:[];for(var x=0,N=0,M=[];N<o.length;){y.lastIndex=b?0:N;var A,O=v(y,b?S(o,N):o);if(null===O||(A=w(p(y.lastIndex+(b?N:0)),o.length))===x)N=l(o,N,m);else{if(E(M,S(o,x,N)),M.length===g)return M;for(var _=1;_<=O.length-1;_++)if(E(M,O[_]),M.length===g)return M;N=x=A}}return E(M,S(o,x)),M}]}),!!x((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),b)},function(e,t,r){"use strict";r(13);var n,i,a=r(2),o=r(1),s=r(27),u=r(6),c=r(18),f=r(23),l=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),p=o.Error,h=u(/./.test);a({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=this.exec;if(!c(t))return h(this,e);var r=s(t,this,e);if(null!==r&&!f(r))throw new p("RegExp exec method returned something other than an Object or null");return!!r}})},function(e,t,r){"use strict";var n=r(170).charAt,i=r(29),a=r(48),o=r(142),s=a.set,u=a.getterFor("String Iterator");o(String,"String",(function(e){s(this,{type:"String Iterator",string:i(e),index:0})}),(function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},function(e,t,r){var n=r(6);e.exports=n({}.isPrototypeOf)},function(e,t,r){var n=r(1),i=r(18),a=r(103),o=n.TypeError;e.exports=function(e){if(i(e))return e;throw o(a(e)+" is not a function")}},function(e,t,r){var n=r(21),i=r(24),a=r(88);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){var t=+e;return t!=t||0===t?0:(t>0?n:r)(t)}},function(e,t,r){var n=r(2),i=r(21);n({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:r(24).f})},function(e,t,r){"use strict";var n=r(2),i=r(69).every;n({target:"Array",proto:!0,forced:!r(68)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(2),i=r(221);n({global:!0,forced:parseFloat!=i},{parseFloat:i})},function(e,t,r){"use strict";var n=r(2),i=r(21),a=r(1),o=r(6),s=r(28),u=r(18),c=r(56),f=r(29),l=r(24).f,p=r(152),h=a.Symbol,m=h&&h.prototype;if(i&&u(h)&&(!("description"in m)||void 0!==h().description)){var d={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=c(m,this)?new h(e):void 0===e?h():h(e);return""===e&&(d[t]=!0),t};p(v,h),v.prototype=m,m.constructor=v;var y="Symbol(test)"==String(h("test")),g=o(m.toString),x=o(m.valueOf),b=/^Symbol\((.*)\)[^)]+$/,w=o("".replace),N=o("".slice);l(m,"description",{configurable:!0,get:function(){var e=x(this),t=g(e);if(s(d,e))return"";var r=y?N(t,7,-1):w(t,b,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:v})}},function(e,t,r){e.exports=r(248)},function(e,t,r){var n=r(21),i=r(27),a=r(149),o=r(88),s=r(43),u=r(101),c=r(28),f=r(151),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=u(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},function(e,t,r){var n=r(51);e.exports=n("navigator","userAgent")||""},function(e,t,r){var n,i=r(25),a=r(157),o=r(126),s=r(90),u=r(158),c=r(106),f=r(108),l=f("IE_PROTO"),p=function(){},h=function(e){return"<script>"+e+"<\/script>"},m=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},d=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;d="undefined"!=typeof document?document.domain&&n?m(n):((t=c("iframe")).style.display="none",u.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):m(n);for(var r=o.length;r--;)delete d.prototype[o[r]];return d()};s[l]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(p.prototype=i(e),r=new p,p.prototype=null,r[l]=e):r=d(),void 0===t?r:a(r,t)}},function(e,t,r){"use strict";var n=r(11);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){throw 1},1)}))}},function(e,t,r){var n=r(78),i=r(6),a=r(100),o=r(36),s=r(49),u=r(128),c=i([].push),f=function(e){var t=1==e,r=2==e,i=3==e,f=4==e,l=6==e,p=7==e,h=5==e||l;return function(m,d,v,y){for(var g,x,b=o(m),w=a(b),N=n(d,v),M=s(w),E=0,S=y||u,A=t?S(m,M):r||p?S(m,0):void 0;M>E;E++)if((h||E in w)&&(x=N(g=w[E],E,b),e))if(t)A[E]=x;else if(x)switch(e){case 3:return!0;case 5:return g;case 6:return E;case 2:c(A,g)}else switch(e){case 4:return!1;case 7:c(A,g)}return l?-1:i||f?f:A}};e.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},function(e,t,r){var n=r(6);e.exports=n([].slice)},function(e,t,r){r(186)("iterator")},function(e,t,r){var n;!function(i){"use strict";var a,o,s,u=9e15,c="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",l="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-u,maxE:u,crypto:!1},h=!0,m="[DecimalError] Invalid argument: ",d="[object Decimal]",v=Math.floor,y=Math.pow,g=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,x=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,b=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,w=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,N=1e7,M=f.length-1,E=l.length-1,S={toStringTag:d};function A(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(a+=D(r)),a+=n;(r=7-(n=(o=e[t])+"").length)&&(a+=D(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function O(e,t,r){if(e!==~~e||e<t||e>r)throw Error(m+e)}function _(e,t,r,n){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),a=y(10,7-t),s=e[i]%a|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):o=(r<4&&s+1==a||r>3&&s+1==a/2)&&(e[i+1]/a/100|0)==y(10,t-2)-1||(s==a/2||0==s)&&0==(e[i+1]/a/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(n||r<4)&&9999==s||!n&&r>3&&4999==s):o=((n||r<4)&&s+1==a||!n&&r>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==y(10,t-3)-1,o}function C(e,t,r){for(var n,i,a=[0],o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=c.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),I(e)},S.ceil=function(){return I(new this.constructor(this),this.e+1,2)},S.clampedTo=S.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(m+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},S.comparedTo=S.cmp=function(e){var t,r,n,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,u=a.s,c=e.s;if(!o||!s)return u&&c?u!==c?u:o===s?0:!o^u<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?u:s[0]?-c:0;if(u!==c)return u;if(a.e!==e.e)return a.e>e.e^u<0?1:-1;for(t=0,r=(n=o.length)<(i=s.length)?n:i;t<r;++t)if(o[t]!==s[t])return o[t]>s[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},S.cosine=S.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?(r=Math.ceil(n/3),i=(1/Z(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10");e.precision+=r,t=V(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,W(n,r)),n.precision=e,n.rounding=t,I(2==s||3==s?r.neg():r,e,t,!0)):new n(1):new n(NaN)},S.cubeRoot=S.cbrt=function(){var e,t,r,n,i,a,o,s,u,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(h=!1,(a=f.s*y(f.s*f,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=A(f.d),(a=((e=f.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=y(r,1/3),e=v((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=f.s),o=(e=l.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(f),n=T(c.plus(f).times(s),c.plus(u),o+2,1),A(s.d).slice(0,o)===(r=A(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(I(n,e+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(I(s,e+1,0),s.times(s).times(s).eq(f))){n=s;break}o+=4,i=1}return h=!0,I(n,e,l.rounding,t)},S.decimalPlaces=S.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=7*((e=t.length-1)-v(this.e/7)),e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},S.dividedBy=S.div=function(e){return T(this,new this.constructor(e))},S.dividedToIntegerBy=S.divToInt=function(e){var t=this.constructor;return I(T(this,new t(e),0,1,1),t.precision,t.rounding)},S.equals=S.eq=function(e){return 0===this.cmp(e)},S.floor=function(){return I(new this.constructor(this),this.e+1,3)},S.greaterThan=S.gt=function(e){return this.cmp(e)>0},S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return 1==t||0===t},S.hyperbolicCosine=S.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/Z(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=V(o,1,a.times(t),new o(1),!0);for(var u,c=e,f=new o(8);c--;)u=a.times(a),a=s.minus(u.times(f.minus(u.times(f))));return I(a,o.precision=r,o.rounding=n,!0)},S.hyperbolicSine=S.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=V(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=V(a,2,i=i.times(1/Z(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(c))))}return a.precision=t,a.rounding=r,I(i,t,r,!0)},S.hyperbolicTangent=S.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,T(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},S.inverseCosine=S.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return-1!==n?0===n?t.isNeg()?q(r,i,a):new r(0):new r(NaN):t.isZero()?q(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=q(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))},S.inverseHyperbolicCosine=S.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,h=!1,r=r.times(r).minus(1).sqrt().plus(r),h=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},S.inverseHyperbolicSine=S.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,h=!1,r=r.times(r).plus(1).sqrt().plus(r),h=!0,n.precision=e,n.rounding=t,r.ln())},S.inverseHyperbolicTangent=S.atanh=function(){var e,t,r,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?I(new a(i),e,t,!0):(a.precision=r=n-i.e,i=T(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},S.inverseSine=S.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,-1!==t?0===t?((e=q(a,r+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))},S.inverseTangent=S.atan=function(){var e,t,r,n,i,a,o,s,u,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=E)return(o=q(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=E)return(o=q(f,l+4,p).times(.5)).s=c.s,o}for(f.precision=s=l+10,f.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(h=!1,t=Math.ceil(s/7),n=1,u=c.times(c),o=new f(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(n+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),h=!0,I(o,f.precision=l,f.rounding=p,!0)},S.isFinite=function(){return!!this.d},S.isInteger=S.isInt=function(){return!!this.d&&v(this.e/7)>this.d.length-2},S.isNaN=function(){return!this.s},S.isNegative=S.isNeg=function(){return this.s<0},S.isPositive=S.isPos=function(){return this.s>0},S.isZero=function(){return!!this.d&&0===this.d[0]},S.lessThan=S.lt=function(e){return this.cmp(e)<0},S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1},S.logarithm=S.log=function(e){var t,r,n,i,a,o,s,u,c=this.constructor,f=c.precision,l=c.rounding;if(null==e)e=new c(10),t=!0;else{if(r=(e=new c(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=this.d,this.s<0||!r||!r[0]||this.eq(1))return new c(r&&!r[0]?-1/0:1!=this.s?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10==0;)i/=10;a=1!==i}if(h=!1,o=L(this,s=f+5),n=t?R(c,s+10):L(e,s),_((u=T(o,n,s,1)).d,i=f,l))do{if(o=L(this,s+=10),n=t?R(c,s+10):L(e,s),u=T(o,n,s,1),!a){+A(u.d).slice(i+1,i+15)+1==1e14&&(u=I(u,f+1,0));break}}while(_(u.d,i+=10,l));return h=!0,I(u,f,l)},S.minus=S.sub=function(e){var t,r,n,i,a,o,s,u,c,f,l,p,m=this,d=m.constructor;if(e=new d(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new d(e.d||m.s!==e.s?m:NaN):e=new d(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,s=d.precision,u=d.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new d(3===u?-0:0);e=new d(m)}return h?I(e,s,u):e}if(r=v(e.e/7),f=v(m.e/7),c=c.slice(),a=f-r){for((l=a<0)?(t=c,a=-a,o=p.length):(t=p,r=f,o=c.length),a>(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((l=(n=c.length)<(o=p.length))&&(o=n),n=0;n<o;n++)if(c[n]!=p[n]){l=c