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 • 682 kB
JavaScript
/**
* 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.4.2
* @date 2022-03-29
*
* @license
* Copyright (C) 2013-2022 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=254)}([function(e,t,r){var n=r(110),i=r(36),a=r(192);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(188))},,function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=r(6),i=r(81).map;n({target:"Array",proto:!0,forced:!r(82)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(1),i=r(144),a=r(145),o=r(193),s=r(53),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(1),i=r(58).f,a=r(53),o=r(36),s=r(107),u=r(140),c=r(80);e.exports=function(e,t){var r,f,l,p,m,h=e.target,d=e.global,v=e.stat;if(r=d?n:v?n[h]||s(h,{}):(n[h]||{}).prototype)for(f in t){if(p=t[f],l=e.noTargetGet?(m=i(r,f))&&m.value:r[f],!c(d?f:h+(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){"use strict";var n=r(9),i=r(78).PROPER,a=r(36),o=r(21),s=r(52),u=r(34),c=r(8),f=r(116),l=RegExp.prototype,p=l.toString,m=n(f),h=c((function(){return"/a/b"!=p.call({source:"a",flags:"b"})})),d=i&&"toString"!=p.name;(h||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)?m(e):r)}),{unsafe:!0})},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){var n=r(86),i=Function.prototype,a=i.bind,o=i.call,s=n&&a.bind(o,o);e.exports=n?function(e){return e&&s(e)}:function(e){return e&&function(){return o.apply(e,arguments)}}},function(e,t,r){"use strict";var n=r(6),i=r(100);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(e,t,r){"use strict";var n,i,a,o,s=r(6),u=r(67),c=r(1),f=r(49),l=r(22),p=r(224),m=r(36),h=r(174),d=r(115),v=r(85),y=r(117),g=r(66),x=r(15),b=r(23),w=r(128),N=r(93),M=r(126),E=r(129),S=r(155),A=r(177).set,O=r(226),C=r(229),_=r(230),T=r(179),I=r(231),k=r(232),z=r(44),q=r(80),R=r(16),B=r(233),D=r(130),j=r(76),P=R("species"),F="Promise",U=z.getterFor(F),L=z.set,$=z.getterFor(F),H=p&&p.prototype,G=p,V=H,Z=c.TypeError,W=c.document,Y=c.process,J=T.f,X=J,Q=!!(W&&W.createEvent&&c.dispatchEvent),K=x(c.PromiseRejectionEvent),ee=!1,te=q(F,(function(){var e=N(G),t=e!==String(G);if(!t&&66===j)return!0;if(u&&!V.finally)return!0;if(j>=51&&/native code/.test(e))return!1;var r=new G((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[P]=n,!(ee=r.then((function(){}))instanceof n)||!t&&B&&!K})),re=te||!E((function(e){G.all(e).catch((function(){}))})),ne=function(e){var t;return!(!b(e)||!x(t=e.then))&&t},ie=function(e,t){var r,n,i,a=t.value,o=1==t.state,s=o?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(o||(2===t.rejection&&ce(t),t.rejection=1),!0===s?r=a:(f&&f.enter(),r=s(a),f&&(f.exit(),i=!0)),r===e.promise?c(Z("Promise-chain cycle")):(n=ne(r))?l(n,r,u,c):u(r)):c(a)}catch(e){f&&!i&&f.exit(),c(e)}},ae=function(e,t){e.notified||(e.notified=!0,O((function(){for(var r,n=e.reactions;r=n.get();)ie(r,e);e.notified=!1,t&&!e.rejection&&se(e)})))},oe=function(e,t,r){var n,i;Q?((n=W.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!K&&(i=c["on"+e])?i(n):"unhandledrejection"===e&&_("Unhandled promise rejection",r)},se=function(e){l(A,c,(function(){var t,r=e.facade,n=e.value;if(ue(e)&&(t=I((function(){D?Y.emit("unhandledRejection",n,r):oe("unhandledrejection",r,n)})),e.rejection=D||ue(e)?2:1,t.error))throw t.value}))},ue=function(e){return 1!==e.rejection&&!e.parent},ce=function(e){l(A,c,(function(){var t=e.facade;D?Y.emit("rejectionHandled",t):oe("rejectionhandled",t,e.value)}))},fe=function(e,t,r){return function(n){e(t,n,r)}},le=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,ae(e,!0))},pe=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw Z("Promise can't be resolved itself");var n=ne(t);n?O((function(){var r={done:!1};try{l(n,t,fe(pe,r,e),fe(le,r,e))}catch(t){le(r,t,e)}})):(e.value=t,e.state=1,ae(e,!1))}catch(t){le({done:!1},t,e)}}};if(te&&(V=(G=function(e){w(this,V),g(e),l(n,this);var t=U(this);try{e(fe(pe,t),fe(le,t))}catch(e){le(t,e)}}).prototype,(n=function(e){L(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new k,rejection:!1,state:0,value:void 0})}).prototype=h(V,{then:function(e,t){var r=$(this),n=J(S(this,G));return r.parent=!0,n.ok=!x(e)||e,n.fail=x(t)&&t,n.domain=D?Y.domain:void 0,0==r.state?r.reactions.add(n):O((function(){ie(n,r)})),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=U(e);this.promise=e,this.resolve=fe(pe,t),this.reject=fe(le,t)},T.f=J=function(e){return e===G||e===a?new i(e):X(e)},!u&&x(p)&&H!==Object.prototype)){o=H.then,ee||(m(H,"then",(function(e,t){var r=this;return new G((function(e,t){l(o,r,e,t)})).then(e,t)}),{unsafe:!0}),m(H,"catch",V.catch,{unsafe:!0}));try{delete H.constructor}catch(e){}d&&d(H,V)}s({global:!0,wrap:!0,forced:te},{Promise:G}),v(G,F,!1,!0),y(F),a=f(F),s({target:F,stat:!0,forced:te},{reject:function(e){var t=J(this);return l(t.reject,void 0,e),t.promise}}),s({target:F,stat:!0,forced:u||te},{resolve:function(e){return C(u&&this===a?G:this,e)}}),s({target:F,stat:!0,forced:re},{all:function(e){var t=this,r=J(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=J(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(18),i=r(78).EXISTS,a=r(9),o=r(20).f,s=Function.prototype,u=a(s.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,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(6),i=r(22);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},function(e,t,r){"use strict";var n=r(6),i=r(9),a=r(104),o=r(40),s=r(112),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){e.exports=function(e){return"function"==typeof e}},function(e,t,r){var n=r(1),i=r(90),a=r(26),o=r(91),s=r(105),u=r(137),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(6),i=r(1),a=r(97),o=r(98),s=r(23),u=r(79),c=r(45),f=r(40),l=r(71),p=r(16),m=r(82),h=r(123),d=m("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),m=c(p),d=u(e,m),x=u(void 0===t?m:t,m);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 h(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(8);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,r){"use strict";var n=r(6),i=r(1),a=r(8),o=r(97),s=r(23),u=r(35),c=r(45),f=r(71),l=r(111),p=r(82),m=r(16),h=r(76),d=m("isConcatSpreadable"),v=i.TypeError,y=h>=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,r){var n=r(1),i=r(18),a=r(138),o=r(139),s=r(21),u=r(87),c=n.TypeError,f=Object.defineProperty,l=Object.getOwnPropertyDescriptor;t.f=i?o?function(e,t,r){if(s(e),t=u(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=l(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return f(e,t,r)}:f:function(e,t,r){if(s(e),t=u(t),s(r),a)try{return f(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("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){var n=r(86),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},function(e,t,r){var n=r(15);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},function(e,t,r){"use strict";var n=r(6),i=r(81).find,a=r(124),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(240),i=r(241),a=r(181),o=r(242);e.exports=function(e){return n(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(9),i=r(35),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},function(e,t,r){"use strict";var n=r(40),i=r(124),a=r(84),o=r(44),s=r(20).f,u=r(125),c=r(67),f=r(18),l=o.set,p=o.getterFor("Array Iterator");e.exports=u(Array,"Array",(function(e,t){l(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=p(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");var m=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!c&&f&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},function(e,t,r){var n=r(6),i=r(35),a=r(109);n({target:"Object",stat:!0,forced:r(8)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},function(e,t,r){"use strict";var n=r(6),i=r(1),a=r(79),o=r(60),s=r(45),u=r(35),c=r(111),f=r(71),l=r(82)("splice"),p=i.TypeError,m=Math.max,h=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=h(m(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(18),i=r(1),a=r(9),o=r(80),s=r(36),u=r(26),c=r(114),f=r(52),l=r(88),p=r(136),m=r(8),h=r(68).f,d=r(58).f,v=r(20).f,y=r(160),g=r(161).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)&&m((function(){y(r)}))?c(Object(t),r,O):t},C=n?h(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(","),_=0;C.length>_;_++)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,r){var n=r(1),i=r(144),a=r(145),o=r(27),s=r(53),u=r(16),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 m in i)p(n[m]&&n[m].prototype,m);p(a,"DOMTokenList")},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.__esModule=!0,e.exports.default=e.exports,r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n;
/**
* @license Complex.js v2.1.0 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):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}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(96),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){var n=r(1),i=r(48),a=n.Object;e.exports=function(e){return a(i(e))}},function(e,t,r){var n=r(1),i=r(15),a=r(26),o=r(53),s=r(107),u=r(93),c=r(44),f=r(78).CONFIGURABLE,l=c.get,p=c.enforce,m=String(String).split("String");(e.exports=function(e,t,r,u){var c,l=!!u&&!!u.unsafe,h=!!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=m.join("string"==typeof v?v:""))),e!==n?(l?!d&&e[t]&&(h=!0):delete e[t],h?e[t]=r:o(e,t,r)):h?e[t]=r:s(t,r)})(Function.prototype,"toString",(function(){return i(this)&&l(this).source||u(this)}))},function(e,t,r){"use strict";var n=r(6),i=r(81).filter;n({target:"Array",proto:!0,forced:!r(82)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(6),i=r(1),a=r(49),o=r(83),s=r(22),u=r(9),c=r(67),f=r(18),l=r(105),p=r(8),m=r(26),h=r(97),d=r(15),v=r(23),y=r(52),g=r(88),x=r(21),b=r(35),w=r(40),N=r(87),M=r(34),E=r(75),S=r(70),A=r(109),O=r(68),C=r(169),_=r(143),T=r(58),I=r(20),k=r(152),z=r(135),q=r(123),R=r(36),B=r(90),D=r(94),j=r(77),P=r(91),F=r(16),U=r(175),L=r(176),$=r(85),H=r(44),G=r(81).forEach,V=D("hidden"),Z=F("toPrimitive"),W=H.set,Y=H.getterFor("Symbol"),J=Object.prototype,X=i.Symbol,Q=X&&X.prototype,K=i.TypeError,ee=i.QObject,te=a("JSON","stringify"),re=T.f,ne=I.f,ie=C.f,ae=z.f,oe=u([].push),se=B("symbols"),ue=B("op-symbols"),ce=B("string-to-symbol-registry"),fe=B("symbol-to-string-registry"),le=B("wks"),pe=!ee||!ee.prototype||!ee.prototype.findChild,me=f&&p((function(){return 7!=S(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=re(J,t);n&&delete J[t],ne(e,t,r),n&&e!==J&&ne(J,t,n)}:ne,he=function(e,t){var r=se[e]=S(Q);return W(r,{type:"Symbol",tag:e,description:t}),f||(r.description=t),r},de=function(e,t,r){e===J&&de(ue,t,r),x(e);var n=N(t);return x(r),m(se,n)?(r.enumerable?(m(e,V)&&e[V][n]&&(e[V][n]=!1),r=S(r,{enumerable:E(0,!1)})):(m(e,V)||ne(e,V,E(1,{})),e[V][n]=!0),me(e,n,r)):ne(e,n,r)},ve=function(e,t){x(e);var r=w(t),n=A(r).concat(be(r));return G(n,(function(t){f&&!s(ye,r,t)||de(e,t,r[t])})),e},ye=function(e){var t=N(e),r=s(ae,this,t);return!(this===J&&m(se,t)&&!m(ue,t))&&(!(r||!m(this,t)||!m(se,t)||m(this,V)&&this[V][t])||r)},ge=function(e,t){var r=w(e),n=N(t);if(r!==J||!m(se,n)||m(ue,n)){var i=re(r,n);return!i||!m(se,n)||m(r,V)&&r[V][n]||(i.enumerable=!0),i}},xe=function(e){var t=ie(w(e)),r=[];return G(t,(function(e){m(se,e)||m(j,e)||oe(r,e)})),r},be=function(e){var t=e===J,r=ie(t?ue:w(e)),n=[];return G(r,(function(e){!m(se,e)||t&&!m(J,e)||oe(n,se[e])})),n};(l||(R(Q=(X=function(){if(y(Q,this))throw K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?M(arguments[0]):void 0,t=P(e),r=function(e){this===J&&s(r,ue,e),m(this,V)&&m(this[V],t)&&(this[V][t]=!1),me(this,t,E(1,e))};return f&&pe&&me(J,t,{configurable:!0,set:r}),he(t,e)}).prototype,"toString",(function(){return Y(this).tag})),R(X,"withoutSetter",(function(e){return he(P(e),e)})),z.f=ye,I.f=de,k.f=ve,T.f=ge,O.f=C.f=xe,_.f=be,U.f=function(e){return he(F(e),e)},f&&(ne(Q,"description",{configurable:!0,get:function(){return Y(this).description}}),c||R(J,"propertyIsEnumerable",ye,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:X}),G(A(le),(function(e){L(e)})),n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=M(e);if(m(ce,t))return ce[t];var r=X(t);return ce[t]=r,fe[r]=t,r},keyFor:function(e){if(!g(e))throw K(e+" is not a symbol");if(m(fe,e))return fe[e]},useSetter:function(){pe=!0},useSimple:function(){pe=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!f},{create:function(e,t){return void 0===t?S(e):ve(S(e),t)},defineProperty:de,defineProperties:ve,getOwnPropertyDescriptor:ge}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:xe,getOwnPropertySymbols:be}),n({target:"Object",stat:!0,forced:p((function(){_.f(1)}))},{getOwnPropertySymbols:function(e){return _.f(b(e))}}),te)&&n({target:"JSON",stat:!0,forced:!l||p((function(){var e=X();return"[null]"!=te([e])||"{}"!=te({a:e})||"{}"!=te(Object(e))}))},{stringify:function(e,t,r){var n=q(arguments),i=t;if((v(t)||void 0!==e)&&!g(e))return h(t)||(t=function(e,t){if(d(i)&&(t=s(i,this,e,t)),!g(t))return t}),n[1]=t,o(te,null,n)}});if(!Q[Z]){var we=Q.valueOf;R(Q,Z,(function(e){return s(we,this)}))}$(X,"Symbol"),j[V]=!0},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,r){var n=r(104),i=r(48);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=r(6),i=r(9),a=r(66),o=r(35),s=r(45),u=r(34),c=r(8),f=r(197),l=r(112),p=r(198),m=r(199),h=r(76),d=r(200),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(h)return h<70;if(!(p&&p>3)){if(m)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(156).charAt,i=r(34),a=r(44),o=r(125),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(9),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},function(e,t,r){var n,i,a,o=r(190),s=r(1),u=r(9),c=r(23),f=r(53),l=r(26),p=r(106),m=r(94),h=r(77),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=m("state");h[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(95);e.exports=function(e){return n(e.length)}},function(e,t,r){var n=r(6),i=r(1),a=r(49),o=r(83),s=r(9),u=r(8),c=i.Array,f=a("JSON","stringify"),l=s(/./.exec),p=s("".charAt),m=s("".charCodeAt),h=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(m(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?h(s,v,x):s}})},function(e,t,r){"use strict";r(10);var n,i,a=r(6),o=r(1),s=r(22),u=r(9),c=r(15),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,m=u(/./.test);a({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=this.exec;if(!c(t))return m(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){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=r(1),i=r(15),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){"use strict";var n=r(83),i=r(22),a=r(9),o=r(119),s=r(149),u=r(21),c=r(48),f=r(155),l=r(120),p=r(95),m=r(34),h=r(65),d=r(121),v=r(122),y=r(100),g=r(99),x=r(8),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=m(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=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),v=0,g=new RegExp(e.source,h+"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:h(t,e);return o?i(o,t,n,r):i(a,m(n),t,r)},function(e,n){var i=u(this),o=m(e),s=r(a,i,o,n,a!==t);if(s.done)return s.value;var c=f(i,RegExp),h=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,h);else{if(E(M,S(o,x,N)),M.length===g)return M;for(var C=1;C<=O.length-1;C++)if(E(M,O[C]),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";var n=r(6),i=r(18),a=r(1),o=r(9),s=r(26),u=r(15),c=r(52),f=r(34),l=r(20).f,p=r(140),m=a.Symbol,h=m&&m.prototype;if(i&&u(m)&&(!("description"in h)||void 0!==m().description)){var d={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=c(h,this)?new m(e):void 0===e?m():m(e);return""===e&&(d[t]=!0),t};p(v,m),v.prototype=h,h.constructor=v;var y="Symbol(test)"==String(m("test")),g=o(h.toString),x=o(h.valueOf),b=/^Symbol\((.*)\)[^)]+$/,w=o("".replace),N=o("".slice);l(h,"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){var n=r(9);e.exports=n({}.isPrototypeOf)},function(e,t,r){var n=r(18),i=r(20),a=r(75);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,r){r(176)("iterator")},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(237),i=r(238),a=r(181),o=r(239);e.exports=function(e,t){return n(e)||i(e,t)||a(e,t)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){e.exports=r(234)},function(e,t,r){var n=r(18),i=r(22),a=r(135),o=r(75),s=r(40),u=r(87),c=r(26),f=r(138),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(49);e.exports=n("navigator","userAgent")||""},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(6),i=r(221);n({target:"Array",stat:!0,forced:!r(129)((function(e){Array.from(e)}))},{from:i})},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},m=!0,h="[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(h+e)}function C(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 _(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(h+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(m=!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 m=!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()?R(r,i,a):new r(0):new r(NaN):t.isZero()?R(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=R(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,m=!1,r=r.times(r).minus(1).sqrt().plus(r),m=!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,m=!1,r=r.times(r).plus(1).sqrt().plus(r),m=!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=R(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=R(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=E)return(o=R(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(m=!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)),m=!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(m=!1,o=L(this,s=f+5),n=t?q(c,s+10):L(e,s),C((u=T(o,n,s,1)).d,i=f,l))do{if(o=L(this,s+=10),n=t?q(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(C(u.d,i+=10,l));return m=!0,I(u,f,l)},S.minus=S.sub=function(e){var t,r,n,i,a,o,s,u,c,f,l,p,h=this,d=h.constructor;if(e=new d(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new d(e.d||h.s!==e.s?h:NaN):e=new d(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.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(h)}return m?I(e,s,u):e}if(r=v(e.e/7),f=v(h.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[n]<p[n];break}a=0}for(l&&(t=c,c=p,p=t,e.s=-e.s),o=c.length,n=p.length-o;n>0;--n)c[o++]=0;for(n=p.length;n>a;){if(c[--n]<p[n]){for(i=n;i&&0===c[--i];)c[i]=N-1;--c[i],c[n]+=N}c[n]-=p[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=z(c,r),m?I(e,s,u):e):new d(3===u?-0:0)},S.modulo=S.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?I(new n(r),n.precision,n.rounding):(m=!1,9==n.modulo?(t=T(r,e.abs(),0,3,1)).s*=e.s:t=T(r,e,0,n.modulo,1),t=t.times(e),m=!0,r.minus(t))},S.naturalExponential=S.exp=function(){return U(this)},S.naturalLogarithm=S.ln=function(){return L(this)},S.negated=S.neg=function(){var e=new this.constructor(this);return e.s=-e.s,I(e)},S.plus=S.add=function(e){var t,r,n,i,a,o,s,u,c,f,l=this,p=l.constructor;if(e=new p(e),!l.d||!e.d)return l.s&&e.s?l.d||(e=new p(e.d||l.s===e.s?l:NaN)):e=new p(NaN),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,s=p.precision,u=p.rounding,!c[0]||!f[0])return f[0]||(e=new p(l)),m?I(e,s,u):e;if(a=v(l.e/7),n=v(e.e/7),c=c.slice(),i=a-n){for(i<0?(r=c,i=-i,o=f.length):(r=f,n=a,o=c.length),i>(o=(a=Math.ceil(s/7))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=f.length)<0&&(i=o,r=f,f=c,c=r),t=0;i;)t=(c[--i]=c[i]+f[i]+t)/N|0,c[i]%=N;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=z(c,n),m?I(e,s,u):e},S.precision=S.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(h+e);return r.d?(t=B(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},S.round=function(){var e=this,t=e.constructor;return I(new t(e),e.e+1,t.rounding)},S.sine=S.sin=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+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:V(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/Z(5,r)),t=V(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,W(n,r)),n.precision=e,n.round