webpackJsonp([113],{"0uF+":function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,"\n#AlarmDevicePrompt[data-v-ad75825a] {\n width: 100%;\n height: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 2rem 1rem 1rem;\n}\n",""])},"1NyH":function(e,t,r){"use strict";t.b=a,r.d(t,"a",function(){return o}),r.d(t,"c",function(){return s});var n=r("GvVl"),i=r("hN2E");function a(e){var t;if(Object(n.i)(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:Object(i.a)(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*a(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,u=r*e,c=u*e,l=c*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*u)-571/(2488320*c)+163879/(209018880*l)+5246819/(75246796800*l*e))}--e,t=s[0];for(var f=1;f>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var d=Object.keys(e);"alpha"in e&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var h=d.sort().join("");if(!(h in s))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=s[h];var g=i[this.model].labels,y=[];for(r=0;rr?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return c.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r=(r+e)%360)<0?360+r:r,t.color[0]=r,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var r=e.rgb(),n=this.rgb(),i=void 0===t?.5:t,a=2*i-1,o=r.alpha()-n.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return c.rgb(s*r.red()+u*n.red(),s*r.green()+u*n.green(),s*r.blue()+u*n.blue(),r.alpha()*i+n.alpha()*(1-i))}},Object.keys(i).forEach(function(e){if(-1===o.indexOf(e)){var t=i[e].channels;c.prototype[e]=function(){if(this.model===e)return new c(this);if(arguments.length)return new c(arguments,e);var r,n="number"==typeof arguments[t]?t:this.valpha;return new c((r=i[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(n),e)},c[e]=function(r){return"number"==typeof r&&(r=p(a.call(arguments),t)),new c(r,e)}}}),e.exports=c},BOzM:function(e,t,r){var n;!function(r){"use strict";var i=2e3,a={s:1,n:0,d:1};function o(e){function t(){var t=Error.apply(this,arguments);t.name=this.name=e,this.stack=t.stack,this.message=t.message}function r(){}return r.prototype=Error.prototype,t.prototype=new r,t}var s=m.DivisionByZero=o("DivisionByZero"),u=m.InvalidParameter=o("InvalidParameter");function c(e,t){return isNaN(e=parseInt(e,10))&&l(),e*t}function l(){throw new u}var f=function(e,t){var r,n=0,i=1,o=1,u=0,f=0,p=0,m=1,d=1,h=0,g=1,y=1,v=1,b=1e7;if(void 0===e||null===e);else if(void 0!==t)o=(n=e)*(i=t);else switch(typeof e){case"object":"d"in e&&"n"in e?(n=e.n,i=e.d,"s"in e&&(n*=e.s)):0 in e?(n=e[0],1 in e&&(i=e[1])):l(),o=n*i;break;case"number":if(e<0&&(o=e,e=-e),e%1==0)n=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));g<=b&&v<=b;){if(e===(r=(h+y)/(g+v))){g+v<=b?(n=h+y,i=g+v):v>g?(n=y,i=v):(n=h,i=g);break}e>r?(h+=y,g+=v):(y+=h,v+=g),g>b?(n=y,i=v):(n=h,i=g)}n*=d}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(g=e.match(/\d+|./g))&&l(),"-"===g[h]?(o=-1,h++):"+"===g[h]&&h++,g.length===h+1?f=c(g[h++],o):"."===g[h+1]||"."===g[h]?("."!==g[h]&&(u=c(g[h++],o)),(++h+1===g.length||"("===g[h+1]&&")"===g[h+3]||"'"===g[h+1]&&"'"===g[h+3])&&(f=c(g[h],o),m=Math.pow(10,g[h].length),h++),("("===g[h]&&")"===g[h+2]||"'"===g[h]&&"'"===g[h+2])&&(p=c(g[h+1],o),d=Math.pow(10,g[h+1].length)-1,h+=3)):"/"===g[h+1]||":"===g[h+1]?(f=c(g[h],o),m=c(g[h+2],1),h+=3):"/"===g[h+3]&&" "===g[h+1]&&(u=c(g[h],o),f=c(g[h+2],o),m=c(g[h+4],1),h+=5),g.length<=h){o=n=p+(i=m*d)*u+d*f;break}default:l()}if(0===i)throw new s;a.s=o<0?-1:1,a.n=Math.abs(n),a.d=Math.abs(i)};function p(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function m(e,t){if(!(this instanceof m))return new m(e,t);f(e,t),e=m.REDUCE?p(a.d,a.n):1,this.s=a.s,this.n=a.n/e,this.d=a.d/e}m.REDUCE=1,m.prototype={s:1,n:0,d:1,abs:function(){return new m(this.n,this.d)},neg:function(){return new m(-this.s*this.n,this.d)},add:function(e,t){return f(e,t),new m(this.s*this.n*a.d+a.s*this.d*a.n,this.d*a.d)},sub:function(e,t){return f(e,t),new m(this.s*this.n*a.d-a.s*this.d*a.n,this.d*a.d)},mul:function(e,t){return f(e,t),new m(this.s*a.s*this.n*a.n,this.d*a.d)},div:function(e,t){return f(e,t),new m(this.s*a.s*this.n*a.d,this.d*a.n)},clone:function(){return new m(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new m(NaN):void 0===e?new m(this.s*this.n%this.d,1):(f(e,t),0===a.n&&0===this.d&&m(0,0),new m(this.s*(a.d*this.n)%(a.n*this.d),a.d*this.d))},gcd:function(e,t){return f(e,t),new m(p(a.n,this.n)*p(a.d,this.d),a.d*this.d)},lcm:function(e,t){return f(e,t),0===a.n&&0===this.n?new m:new m(a.n*this.n,p(a.n,this.n)*p(a.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):new m(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):new m(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new m(NaN):new m(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new m(this.s*this.d,this.n)},pow:function(e){return e<0?new m(Math.pow(this.s*this.d,-e),Math.pow(this.n,-e)):new m(Math.pow(this.s*this.n,e),Math.pow(this.d,e))},equals:function(e,t){return f(e,t),this.s*this.n*a.d==a.s*a.n*this.d},compare:function(e,t){f(e,t);var r=this.s*this.n*a.d-a.s*a.n*this.d;return(00&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(this.n)||isNaN(this.d))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t,r=this.n,n=this.d;if(isNaN(r)||isNaN(n))return"NaN";m.REDUCE||(r/=t=p(r,n),n/=t),e=e||15;var a=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>i)return 0;return n}(0,n),o=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),a=0;a<300;a++){if(n===i)return a;n=10*n%t,i=10*i%t}return 0}(0,n,a),s=-1===this.s?"-":"";if(s+=r/n|0,r%=n,(r*=10)&&(s+="."),a){for(var u=o;u--;)s+=r/n|0,r%=n,r*=10;s+="(";for(u=a;u--;)s+=r/n|0,r%=n,r*=10;s+=")"}else for(u=e;r&&u--;)s+=r/n|0,r%=n,r*=10;return s}},void 0===(n=function(){return m}.apply(t,[]))||(e.exports=n)}()},CF6e:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAKo0lEQVR4Xu2dT6icVx2Gf2eycCFKNkKRLsWCLgrtxriQZJWFqLhowS5K8R8q3syZmxbBjbcroa33O1M1olgLdlHUjYoIlkKuBESKaI0K4qqgILgq2E3k5p4yISk10OaZy3xzvnv6zPqd85153rx9ppNFUvham0DO+TMppU/XWs9ExN1rH7DdN7wSEVdSSr8dhuGZ7T765D8tnfyPsN1PkHN+MiIe3e5TN/a0X5ZSPrWx094BBzmQNUrOOT8dETtrvGWK0YdLKc9N8WJTvJMDga1cuHDh/tls9gcYn3Ss1nrvcrm8OulLTuRyDgQWsVgsvlRr/R6MTzqWUtodhmGY9CUncjkHAovIOT8bEY/A+NRjz5dSHpr6JadwPwcCW8g5X46IszA+9dhBKeXc1C85hfs5ENiCA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOos5EFioA4GgOov930Dm8/n5lNKZiLgvIt4z8c/6ckT88fTp0z/Z29v739h3dSBjE57m+W8MJOf85Yi4NM1rvu2tXpzNZp/d39//55h3dyBj0p3u2TcGknPeiYinp3vNt79ZSulP165d+9ilS5deG+szOJCxyE773LRYLD5wdHR0JaV017SvesfbfbOU8vU7po4ZcCDHBHfC35Zyzk9GxKMn/HPcuv77Syn/HuOzOJAxqE7/zNVALkfE2elf9c43nM1mn9jf3//VnZPrJ3riFBEHpZRz61N4571jNZDa0cd+vJSyN8bncSBjUJ3+mQ4EduRAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjOYg4EFupAIKjbYru7ux88Ojq6PyLuOd4JW3vXq0dHRy8dHh5effM/J+5AIH8HAkG9KbZYLJ6qtV5c/51N3/GviPhGKeVHq1s4ENiFA4GgbsZO+j8OW2t9cLlc/syBwN4dCAQVETnn70fEF/k7ppmstd7lQGA3DoSB2tnZed+pU6f+w9LTTqWUvuVAYEcOhIHKOZ+NiMssPfnUgQOBHTkQBmqxWCxqrfssPfnUfx0I7MiBMFA5573Vr0AsPf2UA4EdORAGyoEwTq1Sj5dSVv8F2/jLgTCkDoRxapVyIIz8QSnlHIuul3Ig6/HadtqBMOIOhHHyb9Ihp9Vffq1+ulz9hNnDy4HAFv2fdAjKgTBQfsVinFql/IrFyGsQxsmvWJCTX7EgKA0CQTWKaRAGXoMwThoEctIgEJQGgaAaxTQIA69BGCcNAjlpEAhKg0BQjWIahIHXIIyTBoGcNAgEpUEgqEYxDcLAaxDGSYNAThoEgtIgEFSjmAZh4DUI46RBICcNAkFpEAiqUUyDMPAahHHSIJCTBoGgNAgE1SimQRh4DcI4aRDISYNAUBoEgmoU0yAMvAZhnDQI5KRBICgNAkE1imkQBl6DME4aBHLSIBCUBoGgGsU0CAOvQRgnDQI5aRAISoNAUI1iGoSB1yCMkwaBnDQIBKVBIKhGMQ3CwGsQxkmDQE4aBILSIBBUo5gGYeA1COOkQSAnDQJBaRAIqlFMgzDwGoRx0iCQkwaBoDQIBNUopkEYeA3COGkQyEmDQFAaBIJqFNMgDLwGYZw0COSkQSAoDQJBNYppEAZegzBOGgRy0iAQlAaBoBrFNAgDr0EYJw0COWkQCEqDQFCNYhqEgdcgjJMGgZw0CASlQSCoRjENwsBrEMZJg0BOGgSC0iAQVKOYBmHgNQjjpEEgJw0CQWkQCKpRTIMw8BqEcdIgkJMGgaA0CATVKKZBGHgNwjhpEMhJg0BQGgSCahTTIAy8BmGcNAjkpEEgKA0CQTWKaRAGXoMwThoEctIgEJQGgaAaxTQIA69BGCcNAjlpEAhKg0BQjWIahIHXIIyTBoGcNAgEpUEgqEYxDcLAaxDGSYNAThoEgtIgEFSjmAZh4DUI46RBICcNAkFpEAiqUUyDMPAahHHSIJCTBoGgNAgE1SimQRh4DcI4aRDISYNAUBoEgmoU0yAMvAZhnDQI5KRBICgNAkE1imkQBl6DME4aBHLSIBCUBoGgGsU0CAOvQRgnDQI5aRAISoNAUI1iGoSB1yCMkwaBnDQIBKVBIKhGMQ3CwGsQxkmDQE4aBILSIBBUo5gGYeA1COOkQSAnDQJBaRAIqlFMgzDwGoRx0iCQkwaBoDQIBNUopkEYeA3COGkQyEmDQFAaBIJqFNMgDLwGYZw0COSkQSAoDQJBNYppEAZegzBOGgRy0iAQlAaBoBrFNAgDr0EYJw0COWkQCEqDQFCNYhqEgdcgjJMGgZw0CASlQSCoRjENwsBrEMbphkH+GhEfhvmpxx4upTw3xiXn8/l3U0pfGePsbZ+ZUnpmGIbPj/Hc+Xz+QErpp2Oc3eDMf6wG8mxEPNLg4Rt/ZK313uVyeXXjB0fEfD7/QkrpB2Ocve0zU0o7wzB8Z4znXrx48UPXr1//2xhnNzjz+bRYLD5Xa/1hg4dv+pEvlFLOb/rQW+flnO+LiN9FxLvGesaWzn0tpfTRYRj+Mtbzcs4rTmfGOn+L5z6UVg/LOf8iIj65xQdv/FFj2uPWZefz+VdTSt/e+OW3eGBK6fwwDC+M+cj5fH5PSunvYz5jC2c/VUp57MZAVq/FYvFErfWxLTx4jEd8rZTyxBgH337mCf+OPdqPGLdzuvlV66WIePc2etnkM1JKvx6G4eOrM98YyE2T7EXER27q8b2bfOgIZ71ca/19RPx8uVz+ZoTz3/LI1Uhms9kDtdbV14i7t/nsYzzrlYi4Umt9cblc/vgY7z/2W1YjOTw83E0prf5MTf2HoFcj4iAi/lxKWe3gxut1ZUA5PcTf4LMAAAAASUVORK5CYII="},"D+q9":function(e,t,r){var n=r("phPW");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("42994501",n,!0)},DIpC:function(e,t){Number.isFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Number.isNaN=Number.isNaN||function(e){return e!=e}},DeSa:function(e,t,r){var n;!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)))}var u=function(e,t){var r={re:0,im:0};if(void 0===e||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 c.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 c.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;s0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r};function c(e,t){if(!(this instanceof c))return new c(e,t);var r=u(e,t);this.re=r.re,this.im=r.im}c.prototype={re:0,im:0,sign:function(){var e=this.abs();return new c(this.re/e,this.im/e)},add:function(e,t){var r=new c(e,t);return this.isInfinite()&&r.isInfinite()?c.NAN:this.isInfinite()||r.isInfinite()?c.INFINITY:new c(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new c(e,t);return this.isInfinite()&&r.isInfinite()?c.NAN:this.isInfinite()||r.isInfinite()?c.INFINITY:new c(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new c(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?c.NAN:this.isInfinite()||r.isInfinite()?c.INFINITY:0===r.im&&0===this.im?new c(this.re*r.re,0):new c(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new c(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return c.NAN;if(this.isInfinite()||r.isZero())return c.INFINITY;if(this.isZero()||r.isInfinite())return c.ZERO;e=this.re,t=this.im;var n,i,a=r.re,o=r.im;return 0===o?new c(e/a,t/a):Math.abs(a)=0)return new c(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new c(Math.pow(t,r.re),0);case 1:return new c(0,Math.pow(t,r.re));case 2:return new c(-Math.pow(t,r.re),0);case 3:return new c(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return c.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 c(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 c(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 c(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new c(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new c(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(e<-t||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(1/24+r*(-1/720+r*(1/40320+r*(-1/3628800+r*(1/4790014600+r*(-1/87178291200+r*(1/20922789888e3)))))))-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new c(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):(r1&&0===t,n=1-e,i=1+e,a=n*n+t*t,o=0!==a?new c((i*n-t*t)/a,(t*n+i*t)/a):new c(-1!==e?e/0:0,0!==t?t/0:0),u=o.re;return o.re=s(o.re,o.im)/2,o.im=Math.atan2(o.im,u)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new c(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new c(e/r,-t/r).atanh():new c(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 c(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new c(e/r,-t/r).asinh():new c(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return c.INFINITY;var r=e*e+t*t;return 0!==r?new c(e/r,-t/r).acosh():new c(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new c(e/r,-t/r)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new c(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new c(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new c(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new c(e,t);return Math.abs(r.re-this.re)<=c.EPSILON&&Math.abs(r.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==e&&(r+=e),0!==t&&(0!==e?r+=t<0?" - ":" + ":t<0&&(r+="-"),1!==(t=Math.abs(t))&&(r+=t),r+="i"),r||"0")},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.re&&-0!==this.re||0!==this.im&&-0!==this.im)},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},c.ZERO=new c(0,0),c.ONE=new c(1,0),c.I=new c(0,1),c.PI=new c(Math.PI,0),c.E=new c(Math.E,0),c.INFINITY=new c(1/0,1/0),c.NAN=new c(NaN,NaN),c.EPSILON=1e-16,void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},ESMD:function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=t.preserveFormatting,s=void 0!==r&&r,u=t.escapeMapFn,c=void 0===u?o:u,l=String(e),f="",p=c(n({},i),s?n({},a):{}),m=Object.keys(p),d=function(){var e=!1;m.forEach(function(t,r){e||l.length>=t.length&&l.slice(0,t.length)===t&&(f+=p[m[r]],l=l.slice(t.length,l.length),e=!0)}),e||(f+=l.slice(0,1),l=l.slice(1,l.length))};l;)d();return f}},FN2H:function(e,t,r){var n=r("HaQL");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("64a37192",n,!0)},FPcK:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAGTUlEQVR4Xu3dwa1UWRAE0cHjZwIm4DEjDGCRm9TN4rBO6daPIHat7h/f9/3+78C/X79+/TjwZ/gTHiPwQyCPGXHOUwQE8pQOx7xGQCCvGXHPUwQE8pQOx7xGQCCvGXHPUwQE8pQOx7xGQCCvGXHPUwQE8pQOx7xGQCCvGXHPUwQE8pQOx7xGQCCvGXHPUwQEEuj4vu9nMDc9QEAggcQrn1sL/uR/fiqQ4L+AQAJYR6YCCUQKJIB1ZCqQQKRAAlhHpgIJRAokgHVkKpBApEACWEemAglECiSAdWQqkECkQAJYR6YCCUQKJIB1ZCqQQKRAAlhHpgIJRAokgHVkKpBApEACWEemAglECiSAdWQqkECkQAJYR6YCCUQKJIB1ZCqQQKRAAlhHpgIJRAokgHVkKpBApEACWEemAglECiSAdWQqkECkQAJYR6YCCUQKJIB1ZCqQQKRAAlhHpgIJRAokgHVkKpBApEACWEemAglE/uWL4/78CKofEA04Lk0FsmTLrXUCAqkj9+ASAYEs2XJrnYBA6sg9uERAIEu23FonIJA6cg8uERDIki231gkIpI7cg0sEBLJky611AgKpI/fgEgGBLNlya52AQOrIPbhEwIfslmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSB25B5cICGTJllvrBARSR+7BJQICWbLl1joBgdSRe3CJgECWbLm1TkAgdeQeXCIgkCVbbq0TEEgduQeXCAhkyZZb6wQEUkfuwSUCAlmy5dY6AYHUkXtwiYBAlmy5tU7ANyvWkXtwiYBAlmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSID8+76fwdz0AAGBBBK/7/sdzE0PEBBIIFEgAawjU4EEIgUSwDoyFUggUiABrCNTgQQiBRLAOjIVSCBSIAGsI1OBBCIFEsA6MhVIIFIgAawjU4EEIgUSwDoyFUggUiABrCNTgQQiBRLAOjIVSCBSIAGsI1OBBCIFEsA6MhVIIFIgAawjU4EEIgUSwDoyFUggUiABrCNTgQQiBRLAOjIVSCBSIAGsI1OBBCIFEsA6MhVIIFIgAawjU4EEIgUSwDoyFUggUiABrCNTgQQiBRLAOjIVSCBSIAGsI1OBBCL/8sVxf74ry68FBxyXpgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSB25B5cICGTJllvrBARSR+7BJQICWbLl1joBgdSRe3CJgECWbLm1TkAgdeQeXCLgQ3ZLttxaJyCQOnIPLhEQyJItt9YJCKSO3INLBASyZMutdQICqSP34BIBgSzZcmudgEDqyD24REAgS7bcWicgkDpyDy4REMiSLbfWCQikjtyDSwQEsmTLrXUCAqkj9+ASAYEs2XJrnYBA6sg9uERAIEu23FonIJA6cg8uERDIki231gkIpI7cg0sEBLJky611AgKpI/fgEgGBLNlya52AQOrIPbhEQCBLttxaJ+CbFevIPbhEQCBLttxaJyCQOnIPLhEQyJItt9YJCKSO3INLBASyZMutdQICqSP34BIBgSzZcmudgEDqyD24REAgS7bcWicgkDpyDy4REMiSLbfWCQgkQP59389gbnqAgEACid/3/Q7mpgcICCSQKJAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkX/54rg/35Xl14IDjktTgSzZcmudgEDqyD24REAgS7bcWicgkDpyDy4REMiSLbfWCQikjtyDSwQEsmTLrXUCAqkj9+ASAYEs2XJrnYBA6sg9uERAIEu23FonIJA6cg8uEfgf8fsNDgf3c78AAAAASUVORK5CYII="},GNQq:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,"\n#OverallMonitor[data-v-51f4d41c] {\n width: 100%;\n height: 100%;\n}\n#OverallMonitor .today-data-container[data-v-51f4d41c] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 28.75rem;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n#OverallMonitor .device-work-container[data-v-51f4d41c] {\n margin-top: 1.25rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n height: 38.125rem;\n margin-bottom: 1.25rem;\n}\n#OverallMonitor .device-work-container .all[data-v-51f4d41c] {\n margin-right: 0.625rem;\n height: 100%;\n width: 55%;\n}\n#OverallMonitor .device-work-container .all .legend[data-v-51f4d41c] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box[data-v-51f4d41c] {\n font-size: .8rem;\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n height: 100%;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin-right: 1rem;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box[data-v-51f4d41c]:last-child {\n margin-right: 2rem;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box .block[data-v-51f4d41c] {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n --size: 1rem;\n height: var(--size);\n width: var(--size);\n border-radius: 0.3125rem;\n margin-right: .5rem;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box .error[data-v-51f4d41c] {\n background: #f34a4a;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box .warn[data-v-51f4d41c] {\n background: #FE9835;\n}\n#OverallMonitor .device-work-container .all .legend .legend-box .normal[data-v-51f4d41c] {\n background: #27C093;\n}\n#OverallMonitor .device-work-container .drill-down[data-v-51f4d41c] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n margin-left: 0.625rem;\n height: 100%;\n}\n#OverallMonitor .alarm-device-container[data-v-51f4d41c] {\n margin-top: 1.25rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n height: 610px;\n margin-bottom: 1.25rem;\n}\n#OverallMonitor .alarm-device-container .prompt[data-v-51f4d41c] {\n margin-right: 0.625rem;\n height: 100%;\n width: 55%;\n}\n#OverallMonitor .alarm-device-container .equipment-distribution[data-v-51f4d41c] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n margin-left: 0.625rem;\n height: 100%;\n}\n#OverallMonitor .system-health-overview[data-v-51f4d41c] {\n margin-top: 1.25rem;\n height: auto;\n width: 100%;\n}\n#OverallMonitor .system-health-overview[data-v-51f4d41c] .box-content {\n overflow: hidden;\n}\n",""])},GvVl:function(e,t,r){"use strict";t.i=function(e){if("boolean"==typeof e)return!0;return!!isFinite(e)&&e===Math.round(e)},r.d(t,"n",function(){return a}),r.d(t,"l",function(){return o}),r.d(t,"j",function(){return s}),r.d(t,"k",function(){return u}),r.d(t,"d",function(){return c}),r.d(t,"g",function(){return l}),t.h=function(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r,a="auto";t&&(t.notation&&(a=t.notation),Object(i.y)(t)?r=t:Object(i.y)(t.precision)&&(r=t.precision));switch(a){case"fixed":return p(e,r);case"exponential":return m(e,r);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=h(f(e),t),n=r.exponent,a=r.coefficients,o=n%3==0?n:n<0?n-3-n%3:n-n%3;if(Object(i.y)(t))for(;t>a.length||n-o+1>a.length;)a.push(0);else for(var s=n>=0?n:Math.abs(o);a.length-10;)c++,u--;var l=a.slice(c).join(""),p=Object(i.y)(t)&&l.length||l.match(/[1-9]/)?"."+l:"",m=a.slice(0,c).join("")+p+"e"+(n>=0?"+":"")+o.toString();return r.sign+m}(e,r);case"auto":if(t&&t.exponential&&(void 0!==t.exponential.lower||void 0!==t.exponential.upper)){var o=Object(n.i)(t,function(e){return e});return o.exponential=void 0,void 0!==t.exponential.lower&&(o.lowerExp=Math.round(Math.log(t.exponential.lower)/Math.LN10)),void 0!==t.exponential.upper&&(o.upperExp=Math.round(Math.log(t.exponential.upper)/Math.LN10)),d(e,r,o)}return d(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw new Error('Unknown notation "'+a+'". Choose "auto", "exponential", or "fixed".')}},t.q=p,t.f=function(e){return e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length},t.m=function(e,t,r){if(null===r||void 0===r)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n0?1:e<0?-1:0},o=Math.log2||function(e){return Math.log(e)/Math.LN2},s=Math.log10||function(e){return Math.log(e)/Math.LN10},u=Math.log1p||function(e){return Math.log(e+1)},c=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t},l=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function f(e){var t=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function p(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=f(e),n="number"==typeof t?h(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function d(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=r&&void 0!==r.lowerExp?r.lowerExp:-3,i=r&&void 0!==r.upperExp?r.upperExp:5,a=f(e),o=t?h(a,t):a;if(o.exponent=i)return m(e,t);var s=o.coefficients,u=o.exponent;s.length0?u:0;return ct&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function g(e){for(var t=[],r=0;r0}function o(e){return 0===e}function s(e){return Number.isNaN(e)}i.signature=n,a.signature=n,o.signature=n,s.signature=n},KAAS:function(e,t,r){e.exports=r.p+"static/img/WarnLogo.ebe1b4e.png"},KTDi:function(e,t,r){"use strict";t.b=i,t.c=a,t.d=o,t.a=s;var n="number, number";function i(e){return!e}function a(e,t){return!(!e&&!t)}function o(e,t){return!!e!=!!t}function s(e,t){return!(!e||!t)}i.signature="number",a.signature=n,o.signature=n,s.signature=n},LuJ9:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,"\n@charset \"UTF-8\";\n#IndividualMonitor[data-v-b1c32450] {\n width: 100%;\n height: 100%;\n}\n#IndividualMonitor .equipment-monitoring[data-v-b1c32450] {\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n#IndividualMonitor .equipment-monitoring .equipment-title[data-v-b1c32450] {\n width: 100%;\n height: 2rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n font-size: 1.1rem;\n margin-bottom: 1.25rem;\n}\n#IndividualMonitor .equipment-monitoring .content[data-v-b1c32450] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n background: #fff;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 1.25rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n overflow: hidden;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box[data-v-b1c32450] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 1rem;\n height: 2.5rem;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box[data-v-b1c32450] .el-input__inner {\n border-color: #dcdfe6;\n border-radius: 0;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box[data-v-b1c32450] .el-input-group__append {\n border-radius: 0;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .search[data-v-b1c32450] {\n width: 20rem;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .label-select[data-v-b1c32450] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n position: relative;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .label-select[data-v-b1c32450] .el-input__inner {\n opacity: 0;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .label-select[data-v-b1c32450] .el-tag {\n visibility: hidden;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .label-select[data-v-b1c32450] .el-input__suffix {\n z-index: 10000;\n}\n#IndividualMonitor .equipment-monitoring .content .search-box .label-select[data-v-b1c32450] .el-select::after {\n content: '\\5B57\\6BB5\\663E\\793A';\n position: absolute;\n top: 0;\n left: 0;\n color: #ccc;\n font-size: .8rem;\n background-color: #fff;\n border-radius: 4px;\n border: 1px solid #dcdfe6;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 0 15px;\n}\n#IndividualMonitor .equipment-monitoring .content .table-box[data-v-b1c32450] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 2rem 1rem 1rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n overflow: hidden;\n}\n#IndividualMonitor .equipment-monitoring .content .table-box .table[data-v-b1c32450] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n overflow: auto;\n}\n#IndividualMonitor .equipment-monitoring .content .table-box footer[data-v-b1c32450] {\n position: relative;\n}\n#IndividualMonitor .equipment-monitoring .content .table-box footer .now[data-v-b1c32450] {\n position: absolute;\n left: 0;\n bottom: 0;\n font-size: .8rem;\n line-height: 32px;\n}\n#IndividualMonitor .equipment-monitoring .content .table-box .pagination[data-v-b1c32450] {\n text-align: right;\n margin-top: 1rem;\n}\n",""])},NPXF:function(e,t){e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},NgKi:function(e,t,r){"use strict";t.a=function e(t){var r=i(t);if("number"===r||"string"===r||"boolean"===r||null===t||void 0===t)return t;if("function"==typeof t.clone)return t.clone();if(Array.isArray(t))return t.map(function(t){return e(t)});if(t instanceof Date)return new Date(t.valueOf());if(Object(n.e)(t))return t;if(t instanceof RegExp)throw new TypeError("Cannot clone "+t);return a(t,e)},t.i=a,t.e=function(e,t){for(var r in t)o(t,r)&&(e[r]=t[r]);return e},t.b=function e(t,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(var n in r)if(o(r,n))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError("Arrays are not supported by deepExtend");t[n]=r[n]}return t},t.d=function e(t,r){var n,i,a;if(Array.isArray(t)){if(!Array.isArray(r))return!1;if(t.length!==r.length)return!1;for(i=0,a=t.length;i0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function N(e,t){var r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function M(e){return Object(n.n)(e)}function A(e){return e*e}function O(e,t){var r,i,a,o=0,s=1,u=1,c=0;if(!Object(n.i)(e)||!Object(n.i)(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)a=e-(i=Math.floor(e/t))*t,r=o,o=s-i*o,s=r,r=u,u=c-i*u,c=r,e=t,t=a;return e<0?[-e,-s,-c]:[e,e?s:0,c]}function E(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(Object(n.q)(e,t))}o.signature=i,s.signature=a,u.signature=a,c.signature=i,l.signature=i,f.signature=i,p.signature=i,m.signature=i,d.signature=i,h.signature=i,g.signature=a,y.signature=a,v.signature=i,b.signature=i,x.signature=i,w.signature=a,N.signature=a,M.signature=i,A.signature=i,O.signature=a,E.signature=a,S.signature=a},SSDC:function(e,t,r){"use strict";var n,i,a;i=[],void 0===(a="function"==typeof(n=function(){function e(){return!0}function t(){return!1}function r(){}return function n(){var i=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:function(e){return"object"==typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],a={name:"any",test:e},o=[],s=[],u={types:i,conversions:s,ignore:o};function c(e){var t=z(u.types,function(t){return t.name===e});if(t)return t;if("any"===e)return a;var r=z(u.types,function(t){return t.name.toLowerCase()===e.toLowerCase()});throw new TypeError('Unknown type "'+e+'"'+(r?'. Did you mean "'+r.name+'"?':""))}function l(e){return e===a?999:u.types.indexOf(e)}function f(e){var t=z(u.types,function(t){return t.test(e)});if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+e)}function p(e){return e.map(function(e){var t=e.types.map(x);return(e.restParam?"...":"")+t.join("|")}).join(",")}function m(e,t){var r=0===e.indexOf("..."),n=(r?e.length>3?e.slice(3):"any":e).split("|").map(I).filter(T).filter(k),i=function(e,t){var r={};return e.forEach(function(e){-1!==t.indexOf(e.from)||-1===t.indexOf(e.to)||r[e.from]||(r[e.from]=e)}),Object.keys(r).map(function(e){return r[e]})}(t,n),a=n.map(function(e){var t=c(e);return{name:e,typeIndex:l(t),test:t.test,conversion:null,conversionIndex:-1}}),o=i.map(function(e){var r=c(e.from);return{name:e.from,typeIndex:l(r),test:r.test,conversion:e,conversionIndex:t.indexOf(e)}});return{types:a.concat(o),restParam:r}}function d(e){var t=D(e);return!!t&&t.restParam}function h(e){return e.types.some(function(e){return null!=e.conversion})}function g(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){var r=c(t.types[0].name).test,n=c(t.types[1].name).test;return function(e){return r(e)||n(e)}}var i=t.types.map(function(e){return c(e.name).test});return function(e){for(var t=0;t=a+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=g(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=g(e[0]),n=g(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(g),function(e){for(var r=0;r=i:s?i>=a:i===a}(t,e)});if(t)throw new TypeError('Conflicting signatures "'+p(t.params)+'" and "'+p(e.params)+'".');i.push(e)});var a=F(i,function(e){return(e?C(e.params,!1):[]).map(function(t){return{params:t,fn:e.fn}})}).filter(B);a.sort(E);var o=a[0]&&a[0].params.length<=2&&!d(a[0].params),s=a[1]&&a[1].params.length<=2&&!d(a[1].params),c=a[2]&&a[2].params.length<=2&&!d(a[2].params),l=a[3]&&a[3].params.length<=2&&!d(a[3].params),x=a[4]&&a[4].params.length<=2&&!d(a[4].params),w=a[5]&&a[5].params.length<=2&&!d(a[5].params),M=o&&s&&c&&l&&x&&w,A=a.map(function(e){return y(e.params)}),O=o?g(a[0].params[0]):t,j=s?g(a[1].params[0]):t,k=c?g(a[2].params[0]):t,T=l?g(a[3].params[0]):t,D=x?g(a[4].params[0]):t,U=w?g(a[5].params[0]):t,P=o?g(a[0].params[1]):t,L=s?g(a[1].params[1]):t,Q=c?g(a[2].params[1]):t,H=l?g(a[3].params[1]):t,G=x?g(a[4].params[1]):t,J=w?g(a[5].params[1]):t,Z=a.map(function(e){return function(e,t){var r=t;if(e.some(h)){var n=d(e),i=e.map(S);r=function(){for(var e=[],r=n?arguments.length-1:arguments.length,a=0;a0){var c=f(t[a]);return(n=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+c+", index: "+a+")")).data={category:"wrongType",fn:o,index:a,actual:c,expected:i},n}}else s=u}var l=s.map(function(e){return d(e.params)?1/0:e.params.length});if(t.lengthp?((n=new TypeError("Too many arguments in function "+o+" (expected: "+p+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:p},n):((n=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+o+".")).data={category:"mismatch",actual:t.map(f)},n)}(e,arguments,a)},ce=function(e,t){return arguments.length===ee&&O(e)&&P(t)?W.apply(null,arguments):arguments.length===te&&j(e)&&L(t)?Y.apply(null,arguments):arguments.length===re&&k(e)&&Q(t)?K.apply(null,arguments):arguments.length===ne&&T(e)&&H(t)?V.apply(null,arguments):arguments.length===ie&&D(e)&&G(t)?$.apply(null,arguments):arguments.length===ae&&U(e)&&J(t)?X.apply(null,arguments):ue.apply(null,arguments)};try{Object.defineProperty(ce,"name",{value:e})}catch(e){}return ce.signatures=function(e){var t={};return e.forEach(function(e){e.params.some(h)||C(e.params,!0).forEach(function(r){t[p(r)]=e.fn})}),t}(a),ce}function k(e){return-1===u.ignore.indexOf(e)}function I(e){return e.trim()}function T(e){return!!e}function B(e){return null!==e}function _(e){return 0===e.types.length}function D(e){return e[e.length-1]}function q(e,t,r){return Array.prototype.slice.call(e,t,r)}function R(e,t){for(var r=0;r=s;)e/=2,t/=2,n>>>=1;return(e+n)/t}},e.exports.resetGlobal=function(){Math.random=c},l(Math.random(),n)}).call(t,r("DuR2"))},WreF:function(e,t){function r(){}r.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n1&&(i-=1)),[360*i,100*a,100*c]},o.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[o.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,n))),100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},o.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,i=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-i)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var t=i[e];if(t)return t;var r,a,o,s=1/0;for(var u in n)if(n.hasOwnProperty(u)){var c=n[u],l=(a=e,o=c,Math.pow(a[0]-o[0],2)+Math.pow(a[1]-o[1],2)+Math.pow(a[2]-o[2],2));l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),r=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,u=e[2]/100;if(0===s)return[a=255*u,a,a];t=2*u-(r=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-1))<0&&n++,n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c]=255*a;return i},o.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,i=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=a<=1?a:2-a,[t,100*(0===n?2*i/(a+i):2*r/(n+r)),100*((n+r)/2)]},o.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*a),u=255*n*(1-r*(1-a));switch(n*=255,i){case 0:return[n,u,o];case 1:return[s,n,o];case 2:return[o,n,u];case 3:return[o,s,n];case 4:return[u,o,n];case 5:return[n,o,s]}},o.hsv.hsl=function(e){var t,r,n,i=e[0],a=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return n=(2-a)*o,r=a*s,[i,100*(r=(r/=(t=(2-a)*s)<=1?t:2-t)||0),100*(n/=2)]},o.hwb.rgb=function(e){var t,r,n,i,a,o,s,u=e[0]/360,c=e[1]/100,l=e[2]/100,f=c+l;switch(f>1&&(c/=f,l/=f),r=1-l,n=6*u-(t=Math.floor(6*u)),0!=(1&t)&&(n=1-n),i=c+n*(r-c),t){default:case 6:case 0:a=r,o=i,s=c;break;case 1:a=i,o=r,s=c;break;case 2:a=c,o=r,s=i;break;case 3:a=c,o=i,s=r;break;case 4:a=i,o=c,s=r;break;case 5:a=r,o=c,s=i}return[255*a,255*o,255*s]},o.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},o.xyz.rgb=function(e){var t,r,n,i=e[0]/100,a=e[1]/100,o=e[2]/100;return r=-.9689*i+1.8758*a+.0415*o,n=.0557*i+-.204*a+1.057*o,t=(t=3.2406*i+-1.5372*a+-.4986*o)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},o.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},o.lab.xyz=function(e){var t,r,n,i=e[0],a=e[1],o=e[2];t=a/500+(r=(i+16)/116),n=r-o/200;var s=Math.pow(r,3),u=Math.pow(t,3),c=Math.pow(n,3);return r=s>.008856?s:(r-16/116)/7.787,t=u>.008856?u:(t-16/116)/7.787,n=c>.008856?c:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},o.lab.lch=function(e){var t,r=e[0],n=e[1],i=e[2];return(t=360*Math.atan2(i,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+i*i),t]},o.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],r=e[1],n=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===i&&(a+=60),a},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},o.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map(function(e){return e+e}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},o.rgb.hcg=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.max(Math.max(n,i),a),s=Math.min(Math.min(n,i),a),u=o-s;return t=u<1?s/(1-u):0,r=u<=0?0:o===n?(i-a)/u%6:o===i?2+(a-n)/u:4+(n-i)/u+4,r/=6,[360*(r%=1),100*u,100*t]},o.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,i=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},o.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},o.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var i,a=[0,0,0],o=t%1*6,s=o%1,u=1-s;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=u,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=u,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=u}return i=(1-r)*n,[255*(r*a[0]+i),255*(r*a[1]+i),255*(r*a[2]+i)]},o.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},o.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},o.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},o.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},ZKZJ:function(e,t,r){var n=r("LuJ9");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("f9bcf0cc",n,!0)},ZfM2:function(e,t,r){"use strict";t.a=a,t.b=o,t.c=s,t.d=u,t.e=c,t.f=l,t.g=f,t.h=p,t.i=m,t.j=d,t.k=h,t.l=g,t.m=y,t.n=v,t.o=b,t.p=x;var n=r("GvVl"),i="number";function a(e){return Object(n.a)(e)}function o(e){return Math.atan(1/e)}function s(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function u(e){return Math.asin(1/e)}function c(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function l(e){return Math.acos(1/e)}function f(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function p(e){return Object(n.b)(e)}function m(e){return Object(n.c)(e)}function d(e){return 1/Math.tan(e)}function h(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function g(e){return 1/Math.sin(e)}function y(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Object(n.n)(e)}function v(e){return 1/Math.cos(e)}function b(e){return 2/(Math.exp(e)+Math.exp(-e))}function x(e){return Object(n.o)(e)}a.signature=i,o.signature=i,s.signature=i,u.signature=i,c.signature=i,l.signature=i,f.signature=i,p.signature=i,m.signature=i,d.signature=i,h.signature=i,g.signature=i,y.signature=i,v.signature=i,b.signature=i,x.signature=i},aqL2:function(e,t,r){var n=r("wa1U");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("8fbd3062",n,!0)},bMbF:function(e,t,r){var n=r("72Lu"),i=r("on7W"),a={};for(var o in n)n.hasOwnProperty(o)&&(a[n[o]]=o);var s=e.exports={to:{},get:{}};function u(e,t,r){return Math.min(Math.max(t,e),r)}function c(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}s.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=s.get.hsl(e),r="hsl";break;case"hwb":t=s.get.hwb(e),r="hwb";break;default:t=s.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},s.get.rgb=function(e){if(!e)return null;var t,r,i,a=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=t[2],t=t[1],r=0;r<3;r++){var o=2*r;a[r]=parseInt(t.slice(o,o+2),16)}i&&(a[3]=Math.round(parseInt(i,16)/255*100)/100)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(i=(t=t[1])[3],r=0;r<3;r++)a[r]=parseInt(t[r]+t[r],16);i&&(a[3]=Math.round(parseInt(i+i,16)/255*100)/100)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(r=0;r<3;r++)a[r]=parseInt(t[r+1],0);t[4]&&(a[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(t=e.match(/(\D+)/))?"transparent"===t[1]?[0,0,0,0]:(a=n[t[1]])?(a[3]=1,a):null:null;for(r=0;r<3;r++)a[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(a[3]=parseFloat(t[4]))}for(r=0;r<3;r++)a[r]=u(a[r],0,255);return a[3]=u(a[3],0,1),a},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},s.to.hex=function(){var e=i(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},s.to.rgb=function(){var e=i(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},s.to.rgb.percent=function(){var e=i(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},s.to.hsl=function(){var e=i(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},s.to.hwb=function(){var e=i(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},s.to.keyword=function(e){return a[e.slice(0,3)]}},cFq8:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,"\n#AlarmDeviceDistributed[data-v-4c1b1e8d] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 100%;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n#AlarmDeviceDistributed .chart-header[data-v-4c1b1e8d] {\n height: 3.5rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n padding-left: 3.5rem;\n padding-right: 5.5rem;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n#AlarmDeviceDistributed .chart-header .before[data-v-4c1b1e8d] {\n margin-right: 1rem;\n color: #aaa;\n font-size: 0.875rem;\n}\n#AlarmDeviceDistributed .chart-box[data-v-4c1b1e8d] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 1rem;\n}\n#AlarmDeviceDistributed .chart-box .chart-target[data-v-4c1b1e8d] {\n width: 100%;\n height: 100%;\n}\n",""])},eTOm:function(e,t){e.exports=function e(t,r){"use strict";var n,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},f=l(t).replace(o,"")||"",p=l(r).replace(o,"")||"",m=f.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(f.match(u),16)||1!==m.length&&f.match(s)&&Date.parse(f),g=parseInt(p.match(u),16)||h&&p.match(s)&&Date.parse(p)||null;if(g){if(hg)return 1}for(var y=0,v=Math.max(m.length,d.length);yi)return 1}return 0}},fWIo:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,"\n#DrillingDistribution[data-v-7a2d8d65] {\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n}\n#DrillingDistribution .dimension-box[data-v-7a2d8d65] {\n width: 100%;\n height: 4rem;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding-right: 5.5rem;\n}\n#DrillingDistribution .dimension-box .title[data-v-7a2d8d65] {\n margin-right: 1rem;\n}\n#DrillingDistribution .dimension-box .dimension[data-v-7a2d8d65] {\n width: 9rem;\n}\n#DrillingDistribution .charts[data-v-7a2d8d65] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n overflow: auto;\n overflow-x: hidden;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0 2rem;\n}\n#DrillingDistribution .charts .dimension-chart[data-v-7a2d8d65] {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n width: calc(100% / 3);\n height: 50%;\n}\n#DrillingDistribution .charts .dimension-chart .total[data-v-7a2d8d65] {\n font-size: 1.5rem;\n}\n#DrillingDistribution footer[data-v-7a2d8d65] {\n height: .9rem;\n}\n",""])},h6SL:function(e,t,r){var n=r("GNQq");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("a94d3908",n,!0)},hN2E:function(e,t,r){"use strict";t.a=function e(t,r){if(r>1;return e(t,n)*e(n+1,r)}},kEzi:function(e,t,r){"use strict";t.a=a;var n=r("GvVl"),i=r("hN2E");function a(e,t){if(!Object(n.i)(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Object(n.i)(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");var r=e-t;return t=0?"+":"")+n.toString()}(e,r);case"auto":if(t&&t.exponential&&(void 0!==t.exponential.lower||void 0!==t.exponential.upper)){var i=Object(w.i)(t,function(e){return e});return i.exponential=void 0,void 0!==t.exponential.lower&&(i.lowerExp=Math.round(Math.log(t.exponential.lower)/Math.LN10)),void 0!==t.exponential.upper&&(i.upperExp=Math.round(Math.log(t.exponential.upper)/Math.LN10)),I(e,i)}var a=t&&void 0!==t.lowerExp?t.lowerExp:-3,o=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var s=e.toSignificantDigits(r),u=s.e;return(u>=a&&u/g,">")}function R(e,t){if(!Object(S.I)(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Object(S.M)(e)+", index: 0)");if(!Object(S.I)(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Object(S.M)(t)+", index: 1)");return e===t?0:e>t?1:-1}function z(e,t,r){if(!(this instanceof z))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function F(e,t,r){if(!(this instanceof F))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function U(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function P(e,t){if(0===t.length){if(Array.isArray(e))throw new z(e.length,0)}else!function e(t,r,n){var i,a=t.length;if(a!==r[n])throw new z(a,r[n]);if(n")}(e,t,0)}function L(e,t){if(!Object(S.y)(e)||!Object(k.i)(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new F(e,t)}function Q(e,t,r){if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!Object(S.y)(e)||!Object(k.i)(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+_(t)+")")}),function e(t,r,n,i){var a;var o;var s=t.length;var u=r[n];var c=Math.min(s,u);t.length=u;if(n15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||ce(e),new r(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return r||ce(e),new r(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||ce(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||le(e);var t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||ue(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||le(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||ce(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||ue(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||le(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],a});function ue(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function ce(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function le(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var fe=ne("ResultSet",[],function(){function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0}),pe=r("wbDN"),me=r.n(pe),de=ne("BigNumber",["?on","config"],function(e){var t=e.on,r=e.config,n=me.a.clone({precision:r.precision});return n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})}),n},{isClass:!0}),he=r("DeSa"),ge=r.n(he);function ye(e){"@babel/helpers - typeof";return(ye="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)}var ve=ne("Complex",[],function(){return ge.a.prototype.type="Complex",ge.a.prototype.isComplex=!0,ge.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},ge.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},ge.a.prototype.format=function(e){var t=this.im,r=this.re,n=Object(k.h)(this.re,e),i=Object(k.h)(this.im,e),a=Object(S.y)(e)?e:e?e.precision:null;if(null!==a){var o=Math.pow(10,-a);Math.abs(r/t)t.re?1:e.ret.im?1:e.im0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,i=0;if(r>0)for(;tn;)e(t,[i],this),t+=r,i++},e.prototype.map=function(e){var t=[];return this.forEach(function(r,n,i){t[n[0]]=e(r,n,i)}),t},e.prototype.toArray=function(){var e=[];return this.forEach(function(t,r){e[r[0]]=t}),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=Object(k.h)(this.start,e);return 1!==this.step&&(t+=":"+Object(k.h)(this.step,e)),t+=":"+Object(k.h)(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e},{isClass:!0}),Me=ne("Matrix",[],function(){function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.storage=function(e){throw new Error("Matrix.storage is deprecated since v6.0.0. Use the factory function math.matrix instead.")},e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0}),Ae=ne("DenseMatrix",["Matrix"],function(e){var t=e.Matrix;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!Object(S.I)(t))throw new Error("Invalid datatype: "+t);if(Object(S.v)(e))"DenseMatrix"===e.type?(this._data=Object(w.a)(e._data),this._size=Object(w.a)(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&Object(S.b)(e.data)&&Object(S.b)(e.size))this._data=e.data,this._size=e.size,P(this._data,this._size),this._datatype=t||e.datatype;else if(Object(S.b)(e))this._data=function e(t){for(var r=0,n=t.length;ri[o]&&(i[o]=t[o],a=!0);a&&n(e,i,r)}return r.prototype=new t,r.prototype.createDenseMatrix=function(e,t){return new r(e,t)},r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return te(this._data,S.M)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.subset=function(e,t,n){switch(arguments.length){case 1:return function(e,t){if(!Object(S.t)(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n=t.size();if(n.length!==e._size.length)throw new z(n.length,e._size.length);for(var i=t.min(),a=t.max(),o=0,s=e._size.length;o");var l=t.max().map(function(e){return e+1});i(e,l,n);var f=o.length;!function e(t,r,n,i,a){var o=a===i-1;var s=r.dimension(a);o?s.forEach(function(e,r){L(e),t[e]=n[r[0]]}):s.forEach(function(o,s){L(o),e(t[o],r,n[s[0]],i,a+1)})}(e._data,t,r,f,0)}return e}(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!Object(S.b)(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new z(e.length,this._size.length);for(var t=0;t0?e:0,n=e<0?-e:0,i=this._size[0],a=this._size[1],o=Math.min(i-n,a-t),s=[],u=0;u0?n:0,s=n<0?-n:0,u=e[0],c=e[1],l=Math.min(u-s,c-o);if(Object(S.b)(t)){if(t.length!==l)throw new Error("Invalid value array length");a=function(e){return t[e]}}else if(Object(S.v)(t)){var f=t.size();if(1!==f.length||f[0]!==l)throw new Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};i||(i=Object(S.e)(a(0))?a(0).mul(0):0);var p=[];if(e.length>0){p=Q(p,e,i);for(var m=0;m=n.length)throw new F(t,n.length);return Object(S.v)(e)?e.create(ke(e.valueOf(),t,r)):ke(e,t,r)}function ke(e,t,r){var n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r0&&!isNaN(Number(e))},any:function(e){return r(e)}})}),ze=ne("isPositive",["typed"],function(e){var t=(0,e.typed)("isPositive",{number:_e.isPositiveNumber,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:function(e){return t(e.value)},"Array | Matrix":function(e){return Ce(e,t)}});return t}),Fe=ne("isZero",["typed"],function(e){var t=(0,e.typed)("isZero",{number:_e.isZeroNumber,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:function(e){return t(e.value)},"Array | Matrix":function(e){return Ce(e,t)}});return t}),Ue=ne("isNaN",["typed"],function(e){return(0,e.typed)("isNaN",{number:_e.isNaNNumber,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return Ce(e,Number.isNaN)}})}),Pe=(Te={},function(){for(var e=arguments.length,t=new Array(e),r=0;r0){var c=0;do{e._ptr.push(e._index.length);for(var l=0;ld){for(l=d;lm){if(p){var h=0;for(l=0;ln-1&&(e._values.splice(f,1),e._index.splice(f,1),y++)}e._ptr[l]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function c(e,t,r,n,i){var a,o,s=n[0],u=n[1],c=[];for(a=0;a");for(var c=t.min()[0],l=t.min()[1],f=i[0],p=i[1],m=0;ml-1||c>f-1)&&(u(this,Math.max(a+1,l),Math.max(c+1,f),i),l=this._size[0],f=this._size[1]),L(a,l),L(c,f);var d=o(a,this._ptr[c],this._ptr[c+1],this._index);return d=n&&x<=a&&h(e._values[b],x-n,g-o)}else{for(var w={},N=y;N "+(this._values?_(this._values[u],e):"X")}return i},i.prototype.toString=function(){return _(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(Object(S.e)(e)&&(e=e.toNumber()),!Object(S.y)(e)||!Object(k.i)(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],a=this._size[1],o=Math.min(n-r,a-t),s=[],u=[],c=[];c[0]=0;for(var l=t;l0?a:0,p=a<0?-a:0,m=e[0],d=e[1],h=Math.min(m-p,d-f);if(Object(S.b)(n)){if(n.length!==h)throw new Error("Invalid value array length");l=function(e){return n[e]}}else if(Object(S.v)(n)){var g=n.size();if(1!==g.length||g[0]!==h)throw new Error("Invalid matrix length");l=function(e){return n.get([e])}}else l=function(){return n};for(var y=[],v=[],b=[],x=0;x=0&&w=c||i[f]!==t)){var m=n?n[l]:void 0;i.splice(f,0,t),n&&n.splice(f,0,m),i.splice(f<=l?l+1:l,1),n&&n.splice(f<=l?l+1:l,1)}else if(f=c||i[l]!==e)){var d=n?n[f]:void 0;i.splice(l,0,e),n&&n.splice(l,0,d),i.splice(l<=f?f+1:f,1),n&&n.splice(l<=f?f+1:f,1)}}},i},{isClass:!0})),Ze=ne("number",["typed"],function(e){var t=(0,e.typed)("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=Number(e);if(isNaN(t))throw new SyntaxError('String "'+e+'" is no valid number');return t},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return Ce(e,t)}});return t}),We=ne("string",["typed"],function(e){var t=(0,e.typed)("string",{"":function(){return""},number:k.h,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return Ce(e,t)},any:function(e){return String(e)}});return t}),Ye=ne("boolean",["typed"],function(e){var t=(0,e.typed)("boolean",{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;var r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":function(e){return Ce(e,t)}});return t}),Ke=ne("bignumber",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){return new r(e)},BigNumber:function(e){return e},Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Ve=ne("complex",["typed","Complex"],function(e){var t=e.typed,r=e.Complex,n=t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return Ce(e,n)}});return n}),$e=ne("fraction",["typed","Fraction"],function(e){var t=e.typed,r=e.Fraction,n=t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},Fraction:function(e){return e},Object:function(e){return new r(e)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Xe=ne("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,r=(e.Matrix,e.DenseMatrix),n=e.SparseMatrix;return t("matrix",{"":function(){return i([])},string:function(e){return i([],e)},"string, string":function(e,t){return i([],e,t)},Array:function(e){return i(e)},Matrix:function(e){return i(e,e.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(e,t,i){if("dense"===t||"default"===t||void 0===t)return new r(e,i);if("sparse"===t)return new n(e,i);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}),et=ne("splitUnit",["typed"],function(e){return(0,e.typed)("splitUnit",{"Unit, Array":function(e,t){return e.splitUnit(t)}})}),tt=ne("unaryMinus",["typed"],function(e){var t=(0,e.typed)("unaryMinus",{number:_e.unaryMinusNumber,Complex:function(e){return e.neg()},BigNumber:function(e){return e.neg()},Fraction:function(e){return e.neg()},Unit:function(e){var r=e.clone();return r.value=t(e.value),r},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),rt=ne("unaryPlus",["typed","config","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.BigNumber,i=t("unaryPlus",{number:_e.unaryPlusNumber,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return Ce(e,i,!0)},"boolean | string":function(e){return"BigNumber"===r.number?new n(+e):+e}});return i}),nt=ne("abs",["typed"],function(e){var t=(0,e.typed)("abs",{number:_e.absNumber,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},Fraction:function(e){return e.abs()},"Array | Matrix":function(e){return Ce(e,t,!0)},Unit:function(e){return e.abs()}});return t}),it=ne("apply",["typed","isInteger"],function(e){var t=e.typed,r=e.isInteger;return t("apply",{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?U(e):e.size();if(t<0||t>=i.length)throw new F(t,i.length);return Object(S.v)(e)?e.create(at(e.valueOf(),t,n)):at(e,t,n)}})});function at(e,t,r){var n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r0?i(e):n(e)},Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},BigNumber:function(e){return e.isNegative()?n(e):i(e)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Array | Matrix":function(e){return Ce(e,a,!0)}});return a}),mt=ne("floor",["typed","config","round"],function(e){var t=e.typed,r=e.config,n=e.round,i=t("floor",{number:function(e){return Object(k.m)(e,n(e),r.epsilon)?n(e):Math.floor(e)},Complex:function(e){return e.floor()},BigNumber:function(e){return He(e,n(e),r.epsilon)?n(e):e.floor()},Fraction:function(e){return e.floor()},"Array | Matrix":function(e){return Ce(e,i,!0)}});return i}),dt=ne("algorithm01",["typed"],function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,s=e._datatype,u=r._values,c=r._index,l=r._ptr,f=r._size,p=r._datatype;if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,d,h=o[0],g=o[1],y="string"==typeof s&&s===p?s:void 0,v=y?t.find(n,[y,y]):n,b=[];for(m=0;m0?function e(t,r,n,i,a,o){var s=[];if(r===n.length-1)for(var u=0;u0?function e(t,r,n,i,a,o,s){var u=[];if(r===n.length-1)for(var c=0;c=0||r.predictable?Object(_e.log10Number)(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return Ce(e,i)}});return i}),Ot=ne("log2",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=t("log2",{number:function(e){return e>=0||r.predictable?Object(_e.log2Number)(e):a(new n(e,0))},Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):a(new n(e.toNumber(),0))},"Array | Matrix":function(e){return Ce(e,i)}});function a(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}return i}),Et=ne("algorithm03",["typed"],function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,s=e._datatype,u=r._values,c=r._index,l=r._ptr,f=r._size,p=r._datatype;if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,d=o[0],h=o[1],g=0,y=n;"string"==typeof s&&s===p&&(m=s,g=t.convert(0,m),y=t.find(n,[m,m]));for(var v=[],b=0;bE)for(var C=0,j=0;j=0||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}return i}),Dt=ne("square",["typed"],function(e){var t=(0,e.typed)("square",{number:_e.squareNumber,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return Ce(e,t,!0)},Unit:function(e){return e.pow(2)}});return t}),qt=ne("subtract",["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.addScalar,a=e.unaryMinus,o=e.DenseMatrix,s=dt({typed:t}),u=Et({typed:t}),c=St({typed:t,equalScalar:n}),l=gt({typed:t,DenseMatrix:o}),f=yt({typed:t}),p=vt({typed:t}),m=t("subtract",{"number, number":function(e,t){return e-t},"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":function(e,t){if(null===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var r=e.clone();return r.value=m(r.value,t.value),r.fixPrefix=!1,r},"SparseMatrix, SparseMatrix":function(e,t){return Rt(e,t),c(e,t,m)},"SparseMatrix, DenseMatrix":function(e,t){return Rt(e,t),u(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return Rt(e,t),s(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return Rt(e,t),f(e,t,m)},"Array, Array":function(e,t){return m(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return m(r(e),t)},"Matrix, Array":function(e,t){return m(e,r(t))},"SparseMatrix, any":function(e,t){return l(e,a(t),i)},"DenseMatrix, any":function(e,t){return p(e,t,m)},"any, SparseMatrix":function(e,t){return l(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(r(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(r(t),e,m,!0).valueOf()}});return m});function Rt(e,t){var r=e.size(),n=t.size();if(r.length!==n.length)throw new z(r.length,n.length)}var zt=ne("xgcd",["typed","config","matrix","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t("xgcd",{"number, number":function(e,t){var i=Object(_e.xgcdNumber)(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){var a,o,s,u,c=new i(0),l=new i(1),f=c,p=l,m=l,d=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),s=e.mod(t),a=f,f=p.minus(o.times(f)),p=a,a=m,m=d.minus(o.times(m)),d=a,e=t,t=s;u=e.lt(c)?[e.neg(),p.neg(),d.neg()]:[e,e.isZero()?0:p,d];return"Array"===r.matrix?u:n(u)}})}),Ft=ne("algorithm09",["typed","equalScalar"],function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype;if(u.length!==m.length)throw new z(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");var h,g=u[0],y=u[1],v=r,b=0,x=i;"string"==typeof c&&c===d&&(h=c,v=t.find(r,[h,h]),b=t.convert(0,h),x=t.find(i,[h,h]));var w,N,M,A,O,E=a&&l?[]:void 0,S=[],C=[],j=E?[]:void 0,k=[];for(N=0;N0;)r(a[--m],o[--d])===h&&(g=g.plus(y)),y=y.times(v);for(;d>0;)r(s,o[--d])===h&&(g=g.plus(y)),y=y.times(v);return u.config({precision:b}),0===h&&(g.s=-g.s),g}function Gt(e){for(var t=e.d,r=t[0]+"",n=1;n0)if(++s>c)for(s-=c;s--;)u+="0";else s1&&(null!==l[m+1]&&void 0!==l[m+1]||(l[m+1]=0),l[m+1]+=l[m]>>1,l[m]&=1)}return l.reverse()}function Jt(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?Lt(t):t.eq(n)?Lt(e):e.isFinite()&&t.isFinite()?Ht(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function Zt(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function Wt(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Yt=ne("bitAnd",["typed","matrix","equalScalar"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=xt({typed:t,equalScalar:n}),a=wt({typed:t,equalScalar:n}),o=Nt({typed:t,equalScalar:n}),s=yt({typed:t}),u=vt({typed:t}),c=t("bitAnd",{"number, number":_e.bitAndNumber,"BigNumber, BigNumber":Pt,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,c,!1)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,c,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,c,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,c)},"Array, Array":function(e,t){return c(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return c(r(e),t)},"Matrix, Array":function(e,t){return c(e,r(t))},"SparseMatrix, any":function(e,t){return o(e,t,c,!1)},"DenseMatrix, any":function(e,t){return u(e,t,c,!1)},"any, SparseMatrix":function(e,t){return o(t,e,c,!0)},"any, DenseMatrix":function(e,t){return u(t,e,c,!0)},"Array, any":function(e,t){return u(r(e),t,c,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,c,!0).valueOf()}});return c}),Kt=ne("bitNot",["typed"],function(e){var t=(0,e.typed)("bitNot",{number:_e.bitNotNumber,BigNumber:Lt,"Array | Matrix":function(e){return Ce(e,t)}});return t}),Vt=ne("bitOr",["typed","matrix","equalScalar","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=dt({typed:t}),o=ht({typed:t,equalScalar:n}),s=gt({typed:t,DenseMatrix:i}),u=yt({typed:t}),c=vt({typed:t}),l=t("bitOr",{"number, number":_e.bitOrNumber,"BigNumber, BigNumber":Qt,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,l)},"Array, Array":function(e,t){return l(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return l(r(e),t)},"Matrix, Array":function(e,t){return l(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,l,!1)},"DenseMatrix, any":function(e,t){return c(e,t,l,!1)},"any, SparseMatrix":function(e,t){return s(t,e,l,!0)},"any, DenseMatrix":function(e,t){return c(t,e,l,!0)},"Array, any":function(e,t){return c(r(e),t,l,!1).valueOf()},"any, Array":function(e,t){return c(r(t),e,l,!0).valueOf()}});return l}),$t=ne("algorithm07",["typed","DenseMatrix"],function(e){var t=e.typed,r=e.DenseMatrix;return function(e,i,a){var o=e._size,s=e._datatype,u=i._size,c=i._datatype;if(o.length!==u.length)throw new z(o.length,u.length);if(o[0]!==u[0]||o[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+u+")");var l,f,p,m=o[0],d=o[1],h=0,g=a;"string"==typeof s&&s===c&&(l=s,h=t.convert(0,l),g=t.find(a,[l,l]));var y=[];for(f=0;f0&&o>i)throw new F(o,i+1)}else{var l=Object(w.a)(c).valueOf(),f=U(l);if(u[t]=l,i=o,o=f.length-1,t>0&&o!==i)throw new z(i+1,o+1)}}if(0===u.length)throw new SyntaxError("At least one matrix expected");for(var p=u.shift();u.length;)p=ur(p,u.shift(),o,0);return s?r(p):p},"...string":function(e){return e.join("")}})});function ur(e,t,r,n){if(n1?[s]:s}}),fr=ne("diag",["typed","matrix","DenseMatrix","SparseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.SparseMatrix;return t("diag",{Array:function(e){return a(e,0,U(e),null)},"Array, number":function(e,t){return a(e,t,U(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),U(e),null)},"Array, string":function(e,t){return a(e,0,U(e),t)},"Array, number, string":function(e,t,r){return a(e,t,U(e),r)},"Array, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),U(e),r)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return a(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),e.size(),r)}});function a(e,t,a,o){if(!Object(k.i)(t))throw new TypeError("Second parameter in function diag must be an integer");var s=t>0?t:0,u=t<0?-t:0;switch(a.length){case 1:return function(e,t,r,a,o,s){var u=[a+o,a+s];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError("Unknown matrix type ".concat(r,'"'));var c="sparse"===r?i.diagonal(u,e,t):n.diagonal(u,e,t);return null!==r?c:c.valueOf()}(e,t,o,a[0],u,s);case 2:return function(e,t,n,i,a,o){if(Object(S.v)(e)){var s=e.diagonal(t);return null!==n?n!==s.storage()?r(s,n):s:s.valueOf()}for(var u=Math.min(i[0]-a,i[1]-o),c=[],l=0;l2||U(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var r=[],i=[];return e.map(function(e){return t.map(function(t){return i=[],r.push(i),e.map(function(e){return t.map(function(t){return i.push(n(e,t))})})})})&&r}}),Ar=ne("map",["typed"],function(e){return(0,e.typed)("map",{"Array, function":Or,"Matrix, function":function(e,t){return e.map(t)}})});function Or(e,t){var r=hr(t);return function n(i,a){return Array.isArray(i)?i.map(function(e,t){return n(e,a.concat(t))}):1===r?t(i):2===r?t(i,a):t(i,a,e)}(e,[])}var Er=ne("ones",["typed","config","matrix","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t("ones",{"":function(){return"Array"===r.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){return"string"==typeof e[e.length-1]?a(e,e.pop()):"Array"===r.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var r=function(e){var t=!1;return e.forEach(function(e,r,n){Object(S.e)(e)&&(t=!0,n[r]=e.toNumber())}),t}(e)?new i(1):1;if(function(e){e.forEach(function(e){if("number"!=typeof e||!Object(k.i)(e)||e<0)throw new Error("Parameters in function ones must be positive integers")})}(e),t){var a=n(t);return e.length>0?a.resize(e,r):a}var o=[];return e.length>0?Q(o,e,r):o}});function Sr(){throw new Error('No "bignumber" implementation available')}function Cr(){throw new Error('No "fraction" implementation available')}function jr(){throw new Error('No "matrix" implementation available')}var kr=ne("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,s=e.larger,u=e.largerEq;return t("range",{string:l,"string, boolean":l,"number, number":function(e,t){return c(f(e,t,1))},"number, number, number":function(e,t,r){return c(f(e,t,r))},"number, number, boolean":function(e,t,r){return c(r?p(e,t,1):f(e,t,1))},"number, number, number, boolean":function(e,t,r,n){return c(n?p(e,t,r):f(e,t,r))},"BigNumber, BigNumber":function(e,t){return c(m(e,t,new(0,e.constructor)(1)))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return c(m(e,t,r))},"BigNumber, BigNumber, boolean":function(e,t,r){var n=e.constructor;return c(r?d(e,t,new n(1)):m(e,t,new n(1)))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return c(n?d(e,t,r):m(e,t,r))}});function c(e){return"Matrix"===r.matrix?n?n(e):jr():e}function l(e,t){var n=function(e){var t=e.split(":").map(function(e){return Number(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===i&&Sr(),c((t?d:m)(i(n.start),i(n.end),i(n.step)))):c((t?p:f)(n.start,n.end,n.step))}function f(e,t,r){var n=[],i=e;if(r>0)for(;a(i,t);)n.push(i),i+=r;else if(r<0)for(;s(i,t);)n.push(i),i+=r;return n}function p(e,t,r){var n=[],i=e;if(r>0)for(;o(i,t);)n.push(i),i+=r;else if(r<0)for(;u(i,t);)n.push(i),i+=r;return n}function m(e,t,r){var n=i(0),o=[],u=e;if(r.gt(n))for(;a(u,t);)o.push(u),u=u.plus(r);else if(r.lt(n))for(;s(u,t);)o.push(u),u=u.plus(r);return o}function d(e,t,r){var n=i(0),a=[],s=e;if(r.gt(n))for(;o(s,t);)a.push(s),s=s.plus(r);else if(r.lt(n))for(;u(s,t);)a.push(s),s=s.plus(r);return a}}),Ir=ne("reshape",["typed","isInteger","matrix"],function(e){var t=e.typed,r=e.isInteger,n=e.matrix;return t("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):n(H(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach(function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)}),H(e,t)}})});function Tr(e,t,r,n){if(!(this instanceof Tr))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(void 0!==n&&null!==n?"-"+n:"")+" expected)",this.stack=(new Error).stack}Tr.prototype=new Error,Tr.prototype.constructor=Error,Tr.prototype.name="ArgumentsError",Tr.prototype.isArgumentsError=!0;var Br=ne("resize",["config","matrix"],function(e){var t=e.config,r=e.matrix;return function(e,n,i){if(2!==arguments.length&&3!==arguments.length)throw new Tr("resize",arguments.length,2,3);if(Object(S.v)(n)&&(n=n.valueOf()),Object(S.e)(n[0])&&(n=n.map(function(e){return Object(S.e)(e)?e.toNumber():e})),Object(S.v)(e))return e.resize(n,i,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new z(t.length,1);var n=t[0];if("number"!=typeof n||!Object(k.i)(n))throw new TypeError("Invalid size, must contain positive integers (size: "+_(t)+")");if(e.length>n)return e.substring(0,n);if(e.lengtha)for(var u=a-1,c=o.length;u0?a.resize(e,r):a}var o=[];return e.length>0?Q(o,e,r):o}}),Xr=ne("erf",["typed"],function(e){var t=(0,e.typed)("name",{number:function(e){var t=Math.abs(e);return t>=an?Object(k.n)(e):t<=en?Object(k.n)(e)*function(e){var t,r=e*e,n=rn[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+rn[0][t])*r,i=(i+nn[0][t])*r;return e*(n+rn[0][3])/(i+nn[0][3])}(t):t<=4?Object(k.n)(e)*(1-function(e){var t,r=rn[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+rn[1][t])*e,n=(n+nn[1][t])*e;var i=(r+rn[1][7])/(n+nn[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):Object(k.n)(e)*(1-function(e){var t,r=1/(e*e),n=rn[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+rn[2][t])*r,i=(i+nn[2][t])*r;var a=r*(n+rn[2][4])/(i+nn[2][4]);a=(tn-a)/e,r=parseInt(16*e)/16;var o=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-o)*a}(t))},"Array | Matrix":function(e){return Ce(e,t)}});return t}),en=.46875,tn=.5641895835477563,rn=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],nn=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],an=Math.pow(2,53),on=ne("mode",["typed","isNaN","isNumeric"],function(e){var t=e.typed,r=e.isNaN,n=e.isNumeric;return t("mode",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=Z(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},i=[],a=0,o=0;oa&&(a=t[s],i=[s])}return i}});function sn(e,t,r){var n;return-1!==String(e).indexOf("Unexpected type")?(n=arguments.length>2?" (type: "+Object(S.M)(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):-1!==String(e).indexOf("complex numbers")?(n=arguments.length>2?" (type: "+Object(S.M)(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var un=ne("prod",["typed","multiply"],function(e){var t=e.typed,r=e.multiply;return t("prod",{"Array | Matrix":n,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return n(e)}});function n(e){var t;if(Se(e,function(e){try{t=void 0===t?e:r(t,e)}catch(t){throw sn(t,"prod",e)}}),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}}),cn=ne("format",["typed"],function(e){return(0,e.typed)("format",{any:_,"any, Object | function | number":_})}),ln=ne("print",["typed"],function(e){return(0,e.typed)("print",{"string, Object | Array":fn,"string, Object | Array, number | Object":fn})});function fn(e,t,r){return e.replace(/\$([\w.]+)/g,function(e,n){for(var i=n.split("."),a=t[i.shift()];i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?Object(S.I)(a)?a:_(a,r):e})}var pn=ne("to",["typed","matrix"],function(e){var t=e.typed,r=e.matrix,n=yt({typed:t}),i=vt({typed:t}),a=t("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return n(e,t,a)},"Array, Array":function(e,t){return a(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return a(r(e),t)},"Matrix, Array":function(e,t){return a(e,r(t))},"Matrix, any":function(e,t){return i(e,t,a,!1)},"any, Matrix":function(e,t){return i(t,e,a,!0)},"Array, any":function(e,t){return i(r(e),t,a,!1).valueOf()},"any, Array":function(e,t){return i(r(t),e,a,!0).valueOf()}});return a}),mn=ne("isPrime",["typed"],function(e){var t=(0,e.typed)("isPrime",{number:function(e){if(0*e!=0)return!1;if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t==0||e%(t+2)==0)return!1;return!0},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;for(var t=5;e.gte(t*t);t+=6)if(e.mod(t).eq(0)||e.mod(t+2).eq(0))return!1;return!0},"Array | Matrix":function(e){return Ce(e,t)}});return t}),dn=ne("numeric",["number","?bignumber","?fraction"],function(e){var t=e.number,r=e.bignumber,n=e.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:function(e){return t(e)},BigNumber:r?function(e){return r(e)}:Sr,Fraction:n?function(e){return n(e)}:Cr};return function(e,t){var r=Object(S.M)(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===r?e:a[t](e)}}),hn=ne("divideScalar",["typed","numeric"],function(e){var t=e.typed,r=e.numeric,n=t("divideScalar",{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Fraction | BigNumber":function(e,t){var i=e.clone(),a=r(1,Object(S.M)(t));return i.value=n(null===i.value?i._normalize(a):i.value,t),i},"number | Fraction | BigNumber, Unit":function(e,t){var i=t.clone();i=i.pow(-1);var a=r(1,Object(S.M)(e));return i.value=n(e,null===t.value?t._normalize(a):t.value),i},"Unit, Unit":function(e,t){return e.divide(t)}});return n}),gn=ne("pow",["typed","config","identity","multiply","matrix","fraction","number","Complex"],function(e){var t=e.typed,r=e.config,n=e.identity,i=e.multiply,a=e.matrix,o=e.number,s=e.fraction,u=e.Complex;return t("pow",{"number, number":c,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new u(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){if(1!==t.d){if(r.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return c(e.valueOf(),t.valueOf())}return e.pow(t)},"Array, number":l,"Array, BigNumber":function(e,t){return l(e,t.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,t){return f(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function c(e,t){if(r.predictable&&!Object(k.i)(t)&&e<0)try{var n=s(t),i=o(n);if((t===i||Math.abs((t-i)/t)<1e-14)&&n.d%2==1)return(n.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:Object(k.i)(t)||e>=0||r.predictable?Object(_e.powNumber)(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new u(e,0).pow(t,0)}function l(e,t){if(!Object(k.i)(t)||t<0)throw new TypeError("For A^b, b must be a positive integer (value is "+t+")");var r=U(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");for(var a=n(r[0]).valueOf(),o=e;t>=1;)1==(1&t)&&(a=i(o,a)),t>>=1,o=i(o,o);return a}function f(e,t){return a(l(e.valueOf(),t))}});function yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bn="Number of decimals in function round must be an integer",xn=ne("round",["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.BigNumber,o=e.DenseMatrix,s=Nt({typed:t,equalScalar:n}),u=Ct({typed:t,DenseMatrix:o}),c=vt({typed:t}),l=t("round",function(e){for(var t=1;t15)throw new Error("Number of decimals in function round must be in te range of 0-15");return Object(_e.roundNumber)(e,t)}},Nn=ne("log",["config","typed","divideScalar","Complex"],function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.Complex,a=t("log",{number:function(e){return e>=0||r.predictable?Object(_e.logNumber)(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new i(e.toNumber(),0).log()},"Array | Matrix":function(e){return Ce(e,a)},"any, any":function(e,t){return n(a(e),a(t))}});return a}),Mn=ne("log1p",["typed","config","divideScalar","log","Complex"],function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.log,a=e.Complex,o=t("log1p",{number:function(e){return e>=-1||r.predictable?Object(k.k)(e):s(new a(e,0))},Complex:s,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():s(new a(e.toNumber(),0))},"Array | Matrix":function(e){return Ce(e,o)},"any, any":function(e,t){return n(o(e),i(t))}});function s(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}return o}),An=ne("nthRoots",["config","typed","divideScalar","Complex"],function(e){var t=e.typed,r=(e.config,e.divideScalar,e.Complex),n=[function(e){return new r(e,0)},function(e){return new r(0,e)},function(e){return new r(-e,0)},function(e){return new r(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new r(0,0)];var i,a="number"==typeof e;(a||0===e.re||0===e.im)&&(i=a?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),s=e.abs(),u=[],c=Math.pow(s,1/t),l=0;ly&&(x.push(m[c]),w.push(r));if(o(b,0))throw new Error("Linear system cannot be solved since matrix is singular");var M=n(v,b);for(c=0,N=w.length;c=0;y--){var v=l[y][0]||0;if(o(v,0))g[y]=[0];else{var b=0,x=[],w=[],N=h[y],M=h[y+1];for(c=M-1;c>=N;c--)(r=d[c])===y?b=m[c]:r=0;m--){var d=r[m][0]||0,h=void 0;if(o(d,0))h=0;else{var g=p[m][m];if(o(g,0))throw new Error("Linear system cannot be solved since matrix is singular");h=n(d,g);for(var y=m-1;y>=0;y--)r[y]=[a(r[y][0]||0,i(h,p[y][m]))]}f[m]=[h]}return new s({data:f,size:[c,1]})}}),kn=ne("algorithm08",["typed","equalScalar"],function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,f=n._index,p=n._ptr,m=n._size,d=n._datatype;if(u.length!==m.length)throw new z(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");if(!a||!l)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var h,g=u[0],y=u[1],v=r,b=0,x=i;"string"==typeof c&&c===d&&(h=c,v=t.find(r,[h,h]),b=t.convert(0,h),x=t.find(i,[h,h]));for(var w,N,M,A,O=[],E=[],S=[],C=[],j=[],k=0;kt?1:-1},"number, number":function(e,t){return Object(k.m)(e,t,r.epsilon)?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return He(e,t,r.epsilon)?new a(0):new a(e.cmp(t))},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return m(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return c(e,t,m)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,m)},"Array, Array":function(e,t){return m(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return m(i(e),t)},"Matrix, Array":function(e,t){return m(e,i(t))},"SparseMatrix, any":function(e,t){return l(e,t,m,!1)},"DenseMatrix, any":function(e,t){return p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return l(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(i(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,m,!0).valueOf()}});return m}),qn=r("eTOm"),Rn=r.n(qn),zn=ne("compareNatural",["typed","compare"],function(e){var t=e.typed,r=e.compare,n=r.signatures["boolean,boolean"],i=t("compareNatural",{"any, any":function(e,t){var o,s=Object(S.M)(e),u=Object(S.M)(t);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==u&&"BigNumber"!==u&&"Fraction"!==u))return"0"!==(o=r(e,t)).toString()?o>0?1:-1:Rn()(s,u);if("Array"===s||"Matrix"===s||"Array"===u||"Matrix"===u)return 0!==(o=function e(t,r){if(Object(S.H)(t)&&Object(S.H)(r))return a(t.toJSON().values,r.toJSON().values);if(Object(S.H)(t))return e(t.toArray(),r);if(Object(S.H)(r))return e(t,r.toArray());if(Object(S.n)(t))return e(t.toJSON().data,r);if(Object(S.n)(r))return e(t,r.toJSON().data);if(!Array.isArray(t))return e([t],r);if(!Array.isArray(r))return e(t,[r]);return a(t,r)}(e,t))?o:Rn()(s,u);if(s!==u)return Rn()(s,u);if("Complex"===s)return function(e,t){if(e.re>t.re)return 1;if(e.ret.im)return 1;if(e.imt.length?1:e.lengtht},"number, number":function(e,t){return e>t&&!Object(k.m)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!He(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return l(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,l)},"Array, Array":function(e,t){return l(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return l(n(e),t)},"Matrix, Array":function(e,t){return l(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,l,!1)},"DenseMatrix, any":function(e,t){return c(e,t,l,!1)},"any, SparseMatrix":function(e,t){return s(t,e,l,!0)},"any, DenseMatrix":function(e,t){return c(t,e,l,!0)},"Array, any":function(e,t){return c(n(e),t,l,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,l,!0).valueOf()}});return l}),Gn=ne("largerEq",["typed","config","matrix","DenseMatrix"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=Et({typed:t}),o=$t({typed:t,DenseMatrix:i}),s=Ct({typed:t,DenseMatrix:i}),u=yt({typed:t}),c=vt({typed:t}),l=t("largerEq",{"boolean, boolean":function(e,t){return e>=t},"number, number":function(e,t){return e>=t||Object(k.m)(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gte(t)||He(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return l(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,l)},"Array, Array":function(e,t){return l(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return l(n(e),t)},"Matrix, Array":function(e,t){return l(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,l,!1)},"DenseMatrix, any":function(e,t){return c(e,t,l,!1)},"any, SparseMatrix":function(e,t){return s(t,e,l,!0)},"any, DenseMatrix":function(e,t){return c(t,e,l,!0)},"Array, any":function(e,t){return c(n(e),t,l,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,l,!0).valueOf()}});return l}),Jn=ne("deepEqual",["typed","equal"],function(e){var t=e.typed,r=e.equal;return t("deepEqual",{"any, any":function(e,t){return function e(t,n){if(Array.isArray(t)){if(Array.isArray(n)){var i=t.length;if(i!==n.length)return!1;for(var a=0;a1)throw new Error("Only one dimensional matrices supported");return u(e.valueOf(),t,r)}if(Array.isArray(e))return u(e,t,r)}function u(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a=0){var f=e[c];e[c]=e[u],e[u]=f,--c}else++u;i(e[u],l)>0&&--u,t<=u?s=u:o=u+1}return e[t]}})),Yn=ne("sort",["typed","matrix","compare","compareNatural"],function(e){var t=e.typed,r=e.matrix,n=e.compare,i=e.compareNatural,a=n,o=function(e,t){return-n(e,t)};return t("sort",{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return c(e),r(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(s(t))},"Matrix, string":function(e,t){return c(e),r(e.toArray().sort(s(t)),e.storage())}});function s(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==U(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}}),Kn=ne("max",["typed","larger"],function(e){var t=e.typed,r=e.larger;return t("max",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return je(e,t.valueOf(),n)},"...":function(e){if(Ee(e))throw new TypeError("Scalar values expected in function max");return i(e)}});function n(e,t){try{return r(e,t)?e:t}catch(e){throw sn(e,"max",t)}}function i(e){var t;if(Se(e,function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||r(e,t))&&(t=e)}catch(t){throw sn(t,"max",e)}}),void 0===t)throw new Error("Cannot calculate max of an empty array");return t}}),Vn=ne("min",["typed","smaller"],function(e){var t=e.typed,r=e.smaller;return t("min",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){return je(e,t.valueOf(),n)},"...":function(e){if(Ee(e))throw new TypeError("Scalar values expected in function min");return i(e)}});function n(e,t){try{return r(e,t)?e:t}catch(e){throw sn(e,"min",t)}}function i(e){var t;if(Se(e,function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||r(e,t))&&(t=e)}catch(t){throw sn(t,"min",e)}}),void 0===t)throw new Error("Cannot calculate min of an empty array");return t}}),$n=ne("ImmutableDenseMatrix",["smaller","DenseMatrix"],function(e){var t=e.smaller,r=e.DenseMatrix;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!Object(S.I)(t))throw new Error("Invalid datatype: "+t);if(Object(S.v)(e)||Object(S.b)(e)){var i=new r(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&Object(S.b)(e.data)&&Object(S.b)(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+Object(S.M)(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:var t=r.prototype.subset.call(this,e);return Object(S.v)(t)?new n({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Object(w.a)(this._data),size:Object(w.a)(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){var e=null;this.forEach(function(r){(null===e||t(r,e))&&(e=r)}),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){var e=null;this.forEach(function(r){(null===e||t(e,r))&&(e=r)}),this._max=null!==e?e:void 0}return this._max},n},{isClass:!0}),Xn=ne("Index",["ImmutableDenseMatrix"],function(e){var t=e.ImmutableDenseMatrix;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var t=0,i=arguments.length;t0;){var u=s.right;s.left.right=s.right,s.right.left=s.left,s.left=i,s.right=i.right,i.right=s,s.right.left=s,s.parent=null,s=u,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,s=Math.floor(Math.log(i)*n)+1,u=new Array(s),c=0,l=e;if(l)for(c++,l=l.right;l!==e;)c++,l=l.right;for(;c>0;){for(var f=l.degree,p=l.right;a=u[f];){if(r(l.key,a.key)){var m=a;a=l,l=m}o(a,l),u[f]=null,f++}u[f]=l,l=p,c--}e=null;for(var d=0;d=e&&(r(s.value,0)||n(s.key,s.value,this)),(s=i.extractMinimum())&&o.push(s);for(var u=0;u="0"&&e<="9"}function E(){r++,n=t.charAt(r)}function C(e){r=e,n=t.charAt(r)}function j(){var e="",t=r;if("+"===n?E():"-"===n&&(e+=n,E()),!function(e){return e>="0"&&e<="9"||"."===e}(n))return C(t),null;if("."===n){if(e+=n,E(),!O(n))return C(t),null}else{for(;O(n);)e+=n,E();"."===n&&(e+=n,E())}for(;O(n);)e+=n,E();if("E"===n||"e"===n){var i="",a=r;if(i+=n,E(),"+"!==n&&"-"!==n||(i+=n,E()),!O(n))return C(a),e;for(e+=i;O(n);)e+=n,E()}return e}function k(){for(var e="",i=t.charCodeAt(r);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122;)e+=n,E(),i=t.charCodeAt(r);return((i=e.charCodeAt(0))>=65&&i<=90||i>=97&&i<=122)&&e||null}function I(e){return n===e?(E(),e):null}function T(e){if(Object(w.f)(F,e)){var t=F[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in F)if(Object(w.f)(F,r)&&(u=r,void 0,void 0,c=(s=e).length-u.length,l=s.length,s.substring(c,l)===u)){var n=F[r],i=e.length-r.length,a=e.substring(0,i),o=Object(w.f)(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}var s,u,c,l;return null}function B(e){return e.equalBase(q.NONE)&&null!==e.value&&!a.predictable?e.value:e}M.prototype.type="Unit",M.prototype.isUnit=!0,M.parse=function(e,i){if(i=i||{},r=-1,n="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var o=new M;o.units=[];var s=1,u=!1;E(),A();var c=j(),l=null;if(c){if("BigNumber"===a.number)l=new b(c);else if("Fraction"===a.number)try{l=new x(c)}catch(e){l=parseFloat(c)}else l=parseFloat(c);A(),I("*")?(s=1,u=!0):I("/")&&(s=-1,u=!0)}for(var f=[],p=1;;){for(A();"("===n;)f.push(s),p*=s,s=1,E(),A();var m=void 0;if(!n)break;var d=n;if(null===(m=k()))throw new SyntaxError('Unexpected "'+d+'" in "'+t+'" at index '+r.toString());var h=T(m);if(null===h)throw new SyntaxError('Unit "'+m+'" not found.');var g=s*p;if(A(),I("^")){A();var y=j();if(null===y)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');g*=y}o.units.push({unit:h.unit,prefix:h.prefix,power:g});for(var v=0;v1||Math.abs(this.units[0].power-1)>1e-15)},M.prototype._normalize=function(e){var t,r,n,i,a;if(null===e||void 0===e||0===this.units.length)return e;if(this._isDerived()){var s=e;a=M._getNumberConverter(Object(S.M)(e));for(var c=0;c1e-12)return!1;return!0},M.prototype.equalBase=function(e){for(var t=0;t1e-12)return!1;return!0},M.prototype.equals=function(e){return this.equalBase(e)&&d(this.value,e.value)},M.prototype.multiply=function(e){for(var t=this.clone(),r=0;r1e-12&&(Object(w.f)(Q,s)?n.push({unit:Q[s].unit,prefix:Q[s].prefix,power:r.dimensions[o]||0}):a=!0)}n.length1e-12){if(!Object(w.f)(L.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:L.si[n].unit,prefix:L.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},M.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i0?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(n>0)for(var a=0;a0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+=t},M.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&Object(S.j)(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=F.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=F.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),a=null!==t.value?g(i,e||{}):"",o=t.formatUnits();return t.value&&Object(S.j)(t.value)&&(a="("+a+")"),o.length>0&&a.length>0&&(a+=" "),a+=o},M.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?f(this.value):0,t=f(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return r;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(Object(w.f)(a,o)){var s=a[o];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*t,n))/Math.LN10-1.2);(u0&&!(n(r)||(i=r,i>="0"&&i<="9")))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}var i}(e);var n,i,a,o=null,s=[],u=0;if(t&&"Unit"===t.type)o=t.clone();else if("string"==typeof t)""!==t&&(n=t);else{if("object"!==si(t))throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');n=t.definition,i=t.prefixes,u=t.offset,a=t.baseName,t.aliases&&(s=t.aliases.valueOf())}if(s)for(var c=0;c1e-12){m=!1;break}if(m){f=!0,l.base=q[p];break}}if(!f){a=a||e+"_STUFF";var h={dimensions:o.dimensions.slice(0)};h.key=a,q[a]=h,Q[a]={unit:l,prefix:_.NONE[""]},l.base=q[a]}}else{if(a=a||e+"_STUFF",D.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var g in D.push(a),q)Object(w.f)(q,g)&&(q[g].dimensions[D.length-1]=0);for(var y={dimensions:[]},v=0;v=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return Ce(e,i)}});return i}),di=ne("acosh",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=t("acosh",{number:function(e){return e>=1||r.predictable?Object(_e.acoshNumber)(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return Ce(e,i)}});return i}),hi=ne("acot",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("acot",{number:_e.acotNumber,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()},"Array | Matrix":function(e){return Ce(e,n)}});return n}),gi=ne("acoth",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber,a=t("acoth",{number:function(e){return e>=1||e<=-1||r.predictable?Object(_e.acothNumber)(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()},"Array | Matrix":function(e){return Ce(e,a)}});return a}),yi=ne("acsc",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber,a=t("acsc",{number:function(e){return e<=-1||e>=1||r.predictable?Object(_e.acscNumber)(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()},"Array | Matrix":function(e){return Ce(e,a)}});return a}),vi=ne("acsch",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("acsch",{number:_e.acschNumber,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()},"Array | Matrix":function(e){return Ce(e,n)}});return n}),bi=ne("asec",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber,a=t("asec",{number:function(e){return e<=-1||e>=1||r.predictable?Object(_e.asecNumber)(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()},"Array | Matrix":function(e){return Ce(e,a)}});return a}),xi=ne("asech",["typed","config","Complex","BigNumber"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber,a=t("asech",{number:function(e){if(e<=1&&e>=-1||r.predictable){var t=1/e;if(t>0||r.predictable)return Object(_e.asechNumber)(e);var i=Math.sqrt(t*t-1);return new n(Math.log(i-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()},"Array | Matrix":function(e){return Ce(e,a)}});return a}),wi=ne("asin",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=t("asin",{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return Ce(e,i,!0)}});return i}),Ni=ne("asinh",["typed"],function(e){var t=(0,e.typed)("asinh",{number:_e.asinhNumber,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),Mi=ne("atan",["typed"],function(e){var t=(0,e.typed)("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),Ai=ne("atan2",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,a=e.DenseMatrix,o=xt({typed:t,equalScalar:n}),s=Et({typed:t}),u=Ft({typed:t,equalScalar:n}),c=Nt({typed:t,equalScalar:n}),l=Ct({typed:t,DenseMatrix:a}),f=yt({typed:t}),p=vt({typed:t}),m=t("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,m)},"Array, Array":function(e,t){return m(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return m(r(e),t)},"Matrix, Array":function(e,t){return m(e,r(t))},"SparseMatrix, number | BigNumber":function(e,t){return c(e,t,m,!1)},"DenseMatrix, number | BigNumber":function(e,t){return p(e,t,m,!1)},"number | BigNumber, SparseMatrix":function(e,t){return l(t,e,m,!0)},"number | BigNumber, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, number | BigNumber":function(e,t){return p(r(e),t,m,!1).valueOf()},"number | BigNumber, Array":function(e,t){return p(r(t),e,m,!0).valueOf()}});return m}),Oi=ne("atanh",["typed","config","Complex"],function(e){var t=e.typed,r=e.config,n=e.Complex,i=t("atanh",{number:function(e){return e<=1&&e>=-1||r.predictable?Object(_e.atanhNumber)(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return Ce(e,i,!0)}});return i}),Ei=ne("cos",["typed"],function(e){var t=(0,e.typed)("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t)}});return t}),Si=ne("cosh",["typed"],function(e){var t=(0,e.typed)("cosh",{number:k.e,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t)}});return t}),Ci=ne("cot",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("cot",{number:_e.cotNumber,Complex:function(e){return e.cot()},BigNumber:function(e){return new r(1).div(e.tan())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),ji=ne("coth",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("coth",{number:_e.cothNumber,Complex:function(e){return e.coth()},BigNumber:function(e){return new r(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),ki=ne("csc",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("csc",{number:_e.cscNumber,Complex:function(e){return e.csc()},BigNumber:function(e){return new r(1).div(e.sin())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Ii=ne("csch",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("csch",{number:_e.cschNumber,Complex:function(e){return e.csch()},BigNumber:function(e){return new r(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Ti=ne("sec",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("sec",{number:_e.secNumber,Complex:function(e){return e.sec()},BigNumber:function(e){return new r(1).div(e.cos())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Bi=ne("sech",["typed","BigNumber"],function(e){var t=e.typed,r=e.BigNumber,n=t("sech",{number:_e.sechNumber,Complex:function(e){return e.sech()},BigNumber:function(e){return new r(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return n(e.value)},"Array | Matrix":function(e){return Ce(e,n)}});return n}),_i=ne("sin",["typed"],function(e){var t=(0,e.typed)("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),Di=ne("sinh",["typed"],function(e){var t=(0,e.typed)("sinh",{number:_e.sinhNumber,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),qi=ne("tan",["typed"],function(e){var t=(0,e.typed)("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),Ri=ne("tanh",["typed"],function(e){var t=(0,e.typed)("tanh",{number:k.p,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return t(e.value)},"Array | Matrix":function(e){return Ce(e,t,!0)}});return t}),zi=ne("setCartesian",["typed","size","subset","compareNatural","Index","DenseMatrix"],function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t("setCartesian",{"Array | Matrix, Array | Matrix":function(e,t){var s=[];if(0!==n(r(e),new a(0))&&0!==n(r(t),new a(0))){var u=Z(Array.isArray(e)?e:e.toArray()).sort(i),c=Z(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(var l=0;l0;r--)for(var n=0;ne[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(s)}});function o(e,t){for(var r=[],n=0;n0)for(var c=0;cc)break}return u}throw new RangeError("Matrix must be square (size: "+_(a)+")")},DenseMatrix:i,any:w.a});function i(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return Object(w.a)(r[0]);throw new RangeError("Matrix must be square (size: "+_(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o)'),t+this.index.toHTML(e)},i.prototype._toTex=function(e){var t=this.object.toTex(e);return a(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},i.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},i.fromJSON=function(e){return new i(e.object,e.index)},i},{isClass:!0,isNode:!0}),sa=ne("ArrayNode",["Node"],function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(S.w))throw new TypeError("Array containing Nodes expected");var t=function(){throw new Error("Property `ArrayNode.nodes` is deprecated, use `ArrayNode.items` instead")};Object.defineProperty(this,"nodes",{get:t,set:t})}return r.prototype=new t,r.prototype.type="ArrayNode",r.prototype.isArrayNode=!0,r.prototype._compile=function(e,t){var r=W(this.items,function(r){return r._compile(e,t)});if("Array"!==e.config.matrix){var n=e.matrix;return function(e,t,i){return n(W(r,function(r){return r(e,t,i)}))}}return function(e,t,n){return W(r,function(r){return r(e,t,n)})}},r.prototype.forEach=function(e){for(var t=0;t['+this.items.map(function(t){return t.toHTML(e)}).join(',')+']'},r.prototype._toTex=function(e){var t="\\begin{bmatrix}";return this.items.forEach(function(r){r.items?t+=r.items.map(function(t){return t.toTex(e)}).join("&"):t+=r.toTex(e),t+="\\\\"}),t+="\\end{bmatrix}"},r},{isClass:!0,isNode:!0});function ua(e){"@babel/helpers - typeof";return(ua="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)}var ca=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function la(e,t){var r=e;"keep"!==t&&(r=e.getContent());for(var n=r.getIdentifier(),i=0;i)'),t+r+'='+n},o.prototype._toTex=function(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return s(this,e&&e.parenthesis)&&(n="\\left(".concat(n,"\\right)")),t+r+":="+n},o},{isClass:!0,isNode:!0}),da=ne("BlockNode",["ResultSet","Node"],function(e){var t=e.ResultSet,r=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map(function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!Object(S.w)(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}})}return n.prototype=new r,n.prototype.type="BlockNode",n.prototype.isBlockNode=!0,n.prototype._compile=function(e,r){var n=W(this.blocks,function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}});return function(e,r,i){var a=[];return Y(n,function(t){var n=t.evaluate(e,r,i);t.visible&&a.push(n)}),new t(a)}},n.prototype.forEach=function(e){for(var t=0;t;')}).join('
')},n.prototype._toTex=function(e){return this.blocks.map(function(t){return t.node.toTex(e)+(t.visible?"":";")}).join("\\;\\;\n")},n},{isClass:!0,isNode:!0}),ha=ne("ConditionalNode",["Node"],function(e){var t=e.Node;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Object(S.w)(e))throw new TypeError("Parameter condition must be a Node");if(!Object(S.w)(t))throw new TypeError("Parameter trueExpr must be a Node");if(!Object(S.w)(n))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=n}return r.prototype=new t,r.prototype.type="ConditionalNode",r.prototype.isConditionalNode=!0,r.prototype._compile=function(e,t){var r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(Object(S.e)(e))return!e.isZero();if(Object(S.j)(e))return!(!e.re&&!e.im);if(Object(S.L)(e))return!!e.value}if(null===e||void 0===e)return!1;throw new TypeError('Unsupported type of condition "'+Object(S.M)(e)+'"')}(r(e,t,a))?n(e,t,a):i(e,t,a)}},r.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},r.prototype.map=function(e){return new r(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},r.prototype.clone=function(){return new r(this.condition,this.trueExpr,this.falseExpr)},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=la(this,t),n=this.condition.toString(e),i=la(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=la(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=la(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s="("+s+")"),n+" ? "+a+" : "+s},r.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},r.fromJSON=function(e){return new r(e.condition,e.trueExpr,e.falseExpr)},r.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=la(this,t),n=this.condition.toHTML(e),i=la(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='('+n+')');var a=this.trueExpr.toHTML(e),o=la(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a='('+a+')');var s=this.falseExpr.toHTML(e),u=la(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s='('+s+')'),n+'?'+a+':'+s},r.prototype._toTex=function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"},r},{isClass:!0,isNode:!0}),ga=r("ESMD"),ya=r.n(ga),va={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},ba={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},xa={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(ba.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(ba.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(ba.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(ba.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(ba.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(ba.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(ba.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(ba.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(ba.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(ba.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(ba.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(ba.bitAnd,"${args[1]}\\right)")},bitNot:{1:ba.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(ba.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(ba.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(ba.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(ba.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(ba.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(ba.and,"${args[1]}\\right)")},not:{1:ba.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(ba.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(ba.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(ba.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},sqrtm:{1:"{${args[0]}}".concat(ba.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(ba.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(ba.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(ba.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(ba.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(ba.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(ba.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(ba.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(ba.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(ba.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(va.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},wa={deg:"^\\circ"};function Na(e){return ya()(e,{preserveFormatting:!0})}function Ma(e,t){return(t=void 0!==t&&t)?Object(w.f)(wa,e)?wa[e]:"\\mathrm{"+Na(e)+"}":Object(w.f)(va,e)?va[e]:Na(e)}var Aa=ne("ConstantNode",["Node"],function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(2===arguments.length)throw new SyntaxError("new ConstantNode(valueStr, valueType) is not supported anymore since math v4.0.0. Use new ConstantNode(value) instead, where value is a non-stringified value.");this.value=e}return r.prototype=new t,r.prototype.type="ConstantNode",r.prototype.isConstantNode=!0,r.prototype._compile=function(e,t){var r=this.value;return function(){return r}},r.prototype.forEach=function(e){},r.prototype.map=function(e){return this.clone()},r.prototype.clone=function(){return new r(this.value)},r.prototype._toString=function(e){return _(this.value,e)},r.prototype.toHTML=function(e){var t=this._toString(e);switch(Object(S.M)(this.value)){case"number":case"BigNumber":case"Fraction":return''+t+"";case"string":return''+t+"";case"boolean":return''+t+"";case"null":return''+t+"";case"undefined":return''+t+"";default:return''+t+""}},r.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},r.fromJSON=function(e){return new r(e.value)},r.prototype._toTex=function(e){var t=this._toString(e);switch(Object(S.M)(this.value)){case"string":return"\\mathtt{"+Na(t)+"}";case"number":case"BigNumber":var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},r},{isClass:!0,isNode:!0}),Oa=ne("FunctionAssignmentNode",["typed","Node"],function(e){var t=e.typed,r=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Object(S.w)(r))throw new TypeError('Node expected for parameter "expr"');if(e in ea)throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||"any"}),this.expr=r}function i(e,t){var r=la(e,t),n=la(e.expr,t);return"all"===t||null!==n&&n<=r}return n.prototype=new r,n.prototype.type="FunctionAssignmentNode",n.prototype.isFunctionAssignmentNode=!0,n.prototype._compile=function(e,r){var n=Object.create(r);Y(this.params,function(e){n[e]=!0});var i=this.expr._compile(e,n),a=this.name,o=this.params,s=$(this.types,","),u=a+"("+$(this.params,", ")+")";return function(e,r,n){var c={};c[s]=function(){for(var t=Object.create(r),a=0;a'+q(this.params[n])+"");var a=this.expr.toHTML(e);return i(this,t)&&(a='('+a+')'),''+q(this.name)+'('+r.join(',')+')='+a},n.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return i(this,t)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Ma).join(",")+"\\right):="+r},n},{isClass:!0,isNode:!0});function Ea(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t.'+q(this.getObjectProperty())+"":'['+t.join(',')+']'},i.prototype._toTex=function(e){var t=this.dimensions.map(function(t){return t.toTex(e)});return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},i},{isClass:!0,isNode:!0});function Ca(e){"@babel/helpers - typeof";return(Ca="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)}var ja=ne("ObjectNode",["Node"],function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==Ca(e)||!Object.keys(e).every(function(t){return Object(S.w)(e[t])})))throw new TypeError("Object containing Nodes expected")}return r.prototype=new t,r.prototype.type="ObjectNode",r.prototype.isObjectNode=!0,r.prototype._compile=function(e,t){var r={};for(var n in this.properties)if(Object(w.f)(this.properties,n)){var i=D(n),a=JSON.parse(i);if(!Ur(this.properties,a))throw new Error('No access to property "'+a+'"');r[a]=this.properties[n]._compile(e,t)}return function(e,t,n){var i={};for(var a in r)Object(w.f)(r,a)&&(i[a]=r[a](e,t,n));return i}},r.prototype.forEach=function(e){for(var t in this.properties)Object(w.f)(this.properties,t)&&e(this.properties[t],"properties["+D(t)+"]",this)},r.prototype.map=function(e){var t={};for(var n in this.properties)Object(w.f)(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+D(n)+"]",this)));return new r(t)},r.prototype.clone=function(){var e={};for(var t in this.properties)Object(w.f)(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)},r.prototype._toString=function(e){var t=[];for(var r in this.properties)Object(w.f)(this.properties,r)&&t.push(D(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"},r.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},r.fromJSON=function(e){return new r(e.properties)},r.prototype.toHTML=function(e){var t=[];for(var r in this.properties)Object(w.f)(this.properties,r)&&t.push(''+q(r)+':'+this.properties[r].toHTML(e));return'{'+t.join(',')+'}'},r.prototype._toTex=function(e){var t=[];for(var r in this.properties)Object(w.f)(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},r},{isClass:!0,isNode:!0}),ka=ne("OperatorNode",["Node"],function(e){var t=e.Node;function r(e,t,n,i){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(n)||!n.every(S.w))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.op=e,this.fn=t,this.args=n||[]}function n(e,t,r,n,i){var a,o=la(e,t),s=fa(e,t);if("all"===t||n.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return n.map(function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(n.length){case 0:a=[];break;case 1:var u=la(n[0],t);if(i&&null!==u){var c,l;if("keep"===t?(c=n[0].getIdentifier(),l=e.getIdentifier()):(c=n[0].getContent().getIdentifier(),l=e.getContent().getIdentifier()),!1===ca[o][l].latexLeftParens){a=[!1];break}if(!1===ca[u][c].latexParens){a=[!1];break}}if(null===u){a=[!1];break}if(u<=o){a=[!0];break}a=[!1];break;case 2:var f,p,m=la(n[0],t),d=pa(e,n[0],t);f=null!==m&&(m===o&&"right"===s&&!d||m=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===r&&(a=n.map(function(e,t){var r="ParenthesisNode"===e.getIdentifier();return!(!a[t]&&!r)})),a}return r.prototype=new t,r.prototype.type="OperatorNode",r.prototype.isOperatorNode=!0,r.prototype._compile=function(e,t){if("string"!=typeof this.fn||!Pr(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var r=zr(e,this.fn),n=W(this.args,function(r){return r._compile(e,t)});if(1===n.length){var i=n[0];return function(e,t,n){return r(i(e,t,n))}}if(2===n.length){var a=n[0],o=n[1];return function(e,t,n){return r(a(e,t,n),o(e,t,n))}}return function(e,t,i){return r.apply(null,W(n,function(r){return r(e,t,i)}))}},r.prototype.forEach=function(e){for(var t=0;t2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var f=i.map(function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t});return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?f.join(" "):f.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},r.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit}},r.fromJSON=function(e){return new r(e.op,e.fn,e.args,e.implicit)},r.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,t,r,i,!1);if(1===i.length){var o=fa(this,t),s=i[0].toHTML(e);return a[0]&&(s='('+s+')'),"right"===o?''+q(this.op)+""+s:s+''+q(this.op)+""}if(2===i.length){var u=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(u='('+u+')'),a[1]&&(c='('+c+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?u+''+c:u+''+q(this.op)+""+c}var l=i.map(function(t,r){return t=t.toHTML(e),a[r]&&(t='('+t+')'),t});return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?l.join(''):l.join(''+q(this.op)+""):''+q(this.fn)+'('+l.join(',')+')'},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,t,r,i,!0),o=ba[this.fn];if(o=void 0===o?this.op:o,1===i.length){var s=fa(this,t),u=i[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s?o+u:u+o}if(2===i.length){var c=i[0],l=c.toTex(e);a[0]&&(l="\\left(".concat(l,"\\right)"));var f,p=i[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),f="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+l+"}{"+p+"}";case"OperatorNode:pow":switch(l="{"+l+"}",p="{"+p+"}",f){case"ConditionalNode":case"OperatorNode:divide":l="\\left(".concat(l,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===r)return l+"~"+p}return l+o+p}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=i.map(function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t});return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?m.join("~"):m.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map(function(t){return t.toTex(e)}).join(",")+"\\right)"},r.prototype.getIdentifier=function(){return this.type+":"+this.fn},r},{isClass:!0,isNode:!0}),Ia=ne("ParenthesisNode",["Node"],function(e){var t=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Object(S.w)(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return r.prototype=new t,r.prototype.type="ParenthesisNode",r.prototype.isParenthesisNode=!0,r.prototype._compile=function(e,t){return this.content._compile(e,t)},r.prototype.getContent=function(){return this.content.getContent()},r.prototype.forEach=function(e){e(this.content,"content",this)},r.prototype.map=function(e){return new r(e(this.content,"content",this))},r.prototype.clone=function(){return new r(this.content)},r.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},r.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},r.fromJSON=function(e){return new r(e.content)},r.prototype.toHTML=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)},r.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},r},{isClass:!0,isNode:!0}),Ta=ne("RangeNode",["Node"],function(e){var t=e.Node;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Object(S.w)(e))throw new TypeError("Node expected");if(!Object(S.w)(t))throw new TypeError("Node expected");if(n&&!Object(S.w)(n))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=n||null}function n(e,t){var r=la(e,t),n={},i=la(e.start,t);if(n.start=null!==i&&i<=r||"all"===t,e.step){var a=la(e.step,t);n.step=null!==a&&a<=r||"all"===t}var o=la(e.end,t);return n.end=null!==o&&o<=r||"all"===t,n}return r.prototype=new t,r.prototype.type="RangeNode",r.prototype.isRangeNode=!0,r.prototype.needsEnd=function(){return this.filter(function(e){return Object(S.J)(e)&&"end"===e.name}).length>0},r.prototype._compile=function(e,t){var r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return r(n(e,t,a),i(e,t,a))}},r.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},r.prototype.map=function(e){return new r(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},r.prototype.clone=function(){return new r(this.start,this.end,this.step&&this.step)},r.prototype._toString=function(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep"),i=this.start.toString(e);if(r.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);r.step&&(a="("+a+")"),t+=":"+a}var o=this.end.toString(e);return r.end&&(o="("+o+")"),t+=":"+o},r.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},r.fromJSON=function(e){return new r(e.start,e.end,e.step)},r.prototype.toHTML=function(e){var t,r=n(this,e&&e.parenthesis?e.parenthesis:"keep"),i=this.start.toHTML(e);if(r.start&&(i='('+i+')'),t=i,this.step){var a=this.step.toHTML(e);r.step&&(a='('+a+')'),t+=':'+a}var o=this.end.toHTML(e);return r.end&&(o='('+o+')'),t+=':'+o},r.prototype._toTex=function(e){var t=n(this,e&&e.parenthesis?e.parenthesis:"keep"),r=this.start.toTex(e);if(t.start&&(r="\\left(".concat(r,"\\right)")),this.step){var i=this.step.toTex(e);t.step&&(i="\\left(".concat(i,"\\right)")),r+=":"+i}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),r+=":"+a},r},{isClass:!0,isNode:!0}),Ba=ne("RelationalNode",["Node"],function(e){var t=e.Node;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}return r.prototype=new t,r.prototype.type="RelationalNode",r.prototype.isRelationalNode=!0,r.prototype._compile=function(e,t){var r=this,n=this.params.map(function(r){return r._compile(e,t)});return function(t,i,a){for(var o,s=n[0](t,i,a),u=0;u",smallerEq:"<=",largerEq:">="},a=n[0],o=0;o('+n.toHTML(e)+')':n.toHTML(e)}),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},a=n[0],o=0;o'+q(i[this.conditionals[o]])+""+n[o+1];return a},r.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=la(this,t),n=this.params.map(function(n,i){var a=la(n,t);return"all"===t||null!==a&&a<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)}),i=n[0],a=0;a'+t+"":"i"===t?''+t+"":"Infinity"===t?''+t+"":"NaN"===t?''+t+"":"null"===t?''+t+"":"undefined"===t?''+t+"":''+t+""},a.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},a.fromJSON=function(e){return new a(e.name)},a.prototype._toTex=function(e){var r=!1;void 0===t[this.name]&&i(this.name)&&(r=!0);var n=Ma(this.name,r);return"\\"===n[0]?n:" "+n},a},{isClass:!0,isNode:!0});function Da(e){"@babel/helpers - typeof";return(Da="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)}function qa(){return(qa=Object.assign||function(e){for(var t=1;t'+q(this.fn)+'('+t.join(',')+')'};var s=i.prototype.toTex;return i.prototype.toTex=function(e){var t;return e&&"object"===Da(e.handler)&&Object(w.f)(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:s.call(this,e)},i.prototype._toTex=function(e){var r,n,i=this.args.map(function(t){return t.toTex(e)});switch(xa[this.name]&&(r=xa[this.name]),!t[this.name]||"function"!=typeof t[this.name].toTex&&"object"!==Da(t[this.name].toTex)&&"string"!=typeof t[this.name].toTex||(r=t[this.name].toTex),Da(r)){case"function":n=r(this,e);break;case"string":n=o(r,this,e);break;case"object":switch(Da(r[i.length])){case"function":n=r[i.length](this,e);break;case"string":n=o(r[i.length],this,e)}}return void 0!==n?n:o("\\mathrm{${name}}\\left(${args}\\right)",this,e)},i.prototype.getIdentifier=function(){return this.type+":"+this.name},i},{isClass:!0,isNode:!0});function za(){return(za=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return Ce(e,function(e){if("string"!=typeof e)throw new TypeError("String expected");return R(e,r)})}var N={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},M={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},A={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},O={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"];function C(e,t){return e.expression.substr(e.index,t)}function j(e){return C(e,1)}function k(e){e.index++}function I(e){return e.expression.charAt(e.index-1)}function T(e){return e.expression.charAt(e.index+1)}function B(e){for(e.tokenType=N.NULL,e.token="",e.comment="";b.isWhitespace(j(e),e.nestingLevel);)k(e);if("#"===j(e))for(;"\n"!==j(e)&&""!==j(e);)e.comment+=j(e),k(e);if(""!==j(e)){if("\n"===j(e)&&!e.nestingLevel)return e.tokenType=N.DELIMITER,e.token=j(e),void k(e);var t=j(e),r=C(e,2),n=C(e,3);if(3===n.length&&M[n])return e.tokenType=N.DELIMITER,e.token=n,k(e),k(e),void k(e);if(2===r.length&&M[r])return e.tokenType=N.DELIMITER,e.token=r,k(e),void k(e);if(M[t])return e.tokenType=N.DELIMITER,e.token=t,void k(e);if(b.isDigitDot(t)){if(e.tokenType=N.NUMBER,"."===j(e))e.token+=j(e),k(e),b.isDigit(j(e))||(e.tokenType=N.DELIMITER);else{for(;b.isDigit(j(e));)e.token+=j(e),k(e);b.isDecimalMark(j(e),T(e))&&(e.token+=j(e),k(e))}for(;b.isDigit(j(e));)e.token+=j(e),k(e);if("E"===j(e)||"e"===j(e))if(b.isDigit(T(e))||"-"===T(e)||"+"===T(e)){if(e.token+=j(e),k(e),"+"!==j(e)&&"-"!==j(e)||(e.token+=j(e),k(e)),!b.isDigit(j(e)))throw ie(e,'Digit expected, got "'+j(e)+'"');for(;b.isDigit(j(e));)e.token+=j(e),k(e);if(b.isDecimalMark(j(e),T(e)))throw ie(e,'Digit expected, got "'+j(e)+'"')}else if("."===T(e))throw k(e),ie(e,'Digit expected, got "'+j(e)+'"')}else{if(!b.isAlpha(j(e),I(e),T(e))){for(e.tokenType=N.UNKNOWN;""!==j(e);)e.token+=j(e),k(e);throw ie(e,'Syntax error in part "'+e.token+'"')}for(;b.isAlpha(j(e),I(e),T(e))||b.isDigit(j(e));)e.token+=j(e),k(e);Object(w.f)(A,e.token)?e.tokenType=N.DELIMITER:e.tokenType=N.SYMBOL}}else e.tokenType=N.DELIMITER}function _(e){do{B(e)}while("\n"===e.token)}function D(e){e.nestingLevel++}function q(e){e.nestingLevel--}function R(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:N.NULL,nestingLevel:0,conditionalLevel:null};za(r,{expression:e,extraNodes:t}),B(r);var n=function(e){var t,r,n=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&((t=z(e)).comment=e.comment);for(;"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),B(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((t=z(e)).comment=e.comment,r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new s(n):(t||((t=new c(void 0)).comment=e.comment),t)}(r);if(""!==r.token)throw r.tokenType===N.DELIMITER?ae(r,"Unexpected operator "+r.token):ie(r,'Unexpected part "'+r.token+'"');return n}function z(e){var t,r,n,i,a=function(e){var t=function(e){var t=F(e);for(;"or"===e.token;)_(e),t=new d("or","or",[t,F(e)]);return t}(e);for(;"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,_(e);var n=t,i=z(e);if(":"!==e.token)throw ie(e,"False part of conditional expression expected");e.conditionalLevel=null,_(e);var a=z(e);t=new u(n,i,a),e.conditionalLevel=r}return t}(e);if("="===e.token){if(Object(S.J)(a))return t=a.name,_(e),n=z(e),new o(new v(t),n);if(Object(S.a)(a))return _(e),n=z(e),new o(a.object,a.index,n);if(Object(S.r)(a)&&Object(S.J)(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach(function(e,t){Object(S.J)(e)?r[t]=e.name:i=!1}),i))return _(e),n=z(e),new l(t,r,n);throw ie(e,"Invalid left hand side of assignment operator =")}return a}function F(e){for(var t=U(e);"xor"===e.token;)_(e),t=new d("xor","xor",[t,U(e)]);return t}function U(e){for(var t=P(e);"and"===e.token;)_(e),t=new d("and","and",[t,P(e)]);return t}function P(e){for(var t=L(e);"|"===e.token;)_(e),t=new d("|","bitOr",[t,L(e)]);return t}function L(e){for(var t=Q(e);"^|"===e.token;)_(e),t=new d("^|","bitXor",[t,Q(e)]);return t}function Q(e){for(var t=H(e);"&"===e.token;)_(e),t=new d("&","bitAnd",[t,H(e)]);return t}function H(e){for(var t=[G(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Object(w.f)(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),_(e),t.push(G(e))}return 1===t.length?t[0]:2===t.length?new d(r[0].name,r[0].fn,t):new y(r.map(function(e){return e.fn}),t)}function G(e){var t,r,n,i;t=J(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Object(w.f)(a,e.token);)n=a[r=e.token],_(e),i=[t,J(e)],t=new d(r,n,i);return t}function J(e){var t,r,n,i;t=Z(e);for(var a={to:"to",in:"to"};Object(w.f)(a,e.token);)n=a[r=e.token],_(e),"in"===r&&""===e.token?t=new d("*","multiply",[t,new v("in")],!0):(i=[t,Z(e)],t=new d(r,n,i));return t}function Z(e){var t,r=[];if(t=":"===e.token?new c(1):W(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)_(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new v("end")):r.push(W(e));t=3===r.length?new g(r[0],r[2],r[1]):new g(r[0],r[1])}return t}function W(e){var t,r,n,i;t=Y(e);for(var a={"+":"add","-":"subtract"};Object(w.f)(a,e.token);)n=a[r=e.token],_(e),i=[t,Y(e)],t=new d(r,n,i);return t}function Y(e){var t,r,n,i;r=t=K(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};Object(w.f)(a,e.token);)i=a[n=e.token],_(e),r=K(e),t=new d(n,i,[t,r]);return t}function K(e){var t,r;for(r=t=V(e);e.tokenType===N.SYMBOL||"in"===e.token&&Object(S.l)(t)||!(e.tokenType!==N.NUMBER||Object(S.l)(r)||Object(S.B)(r)&&"!"!==r.op)||"("===e.token;)r=V(e),t=new d("*","multiply",[t,r],!0);return t}function V(e){for(var t=$(e),r=t,n=[];"/"===e.token&&Object(S.l)(r);){if(n.push(za({},e)),_(e),e.tokenType!==N.NUMBER){za(e,n.pop());break}if(n.push(za({},e)),_(e),e.tokenType!==N.SYMBOL&&"("!==e.token){n.pop(),za(e,n.pop());break}za(e,n.pop()),n.pop(),r=$(e),t=new d("/","divide",[t,r])}return t}function $(e){var t,i,o,s={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Object(w.f)(s,e.token)?(o=s[e.token],t=e.token,_(e),i=[$(e)],new d(t,o,i)):function(e){var t,i,o,s;t=function(e){var t,i,o;t=function(e){var t=[];if(e.tokenType===N.SYMBOL&&Object(w.f)(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(B(e),"("===e.token){if(t=[],D(e),B(e),")"!==e.token)for(t.push(z(e));","===e.token;)B(e),t.push(z(e));if(")"!==e.token)throw ie(e,"Parenthesis ) expected");q(e),B(e)}return new i(t)}return function(e){var t,i;return e.tokenType===N.SYMBOL||e.tokenType===N.DELIMITER&&e.token in A?(i=e.token,B(e),t=Object(w.f)(O,i)?new c(O[i]):-1!==E.indexOf(i)?new c(r(i,"number")):new v(i),t=X(e,t)):function(e){var t,i;return'"'===e.token?(i=ee(e),t=new c(i),t=X(e,t)):function(e){var t,i;return"'"===e.token?(i=te(e),t=new c(i),t=X(e,t)):function(e){var t,i,o,s;if("["===e.token){if(D(e),B(e),"]"!==e.token){var u=re(e);if(";"===e.token){for(o=1,i=[u];";"===e.token;)B(e),i[o]=re(e),o++;if("]"!==e.token)throw ie(e,"End of matrix ] expected");q(e),B(e),s=i[0].items.length;for(var l=1;l0},b.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},b.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},b.isDigit=function(e){return e>="0"&&e<="9"},b}),Ua=ne("compile",["typed","parse"],function(e){var t=e.typed,r=e.parse;return t("compile",{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return Ce(e,function(e){return r(e).compile()})}})}),Pa=ne("evaluate",["typed","parse"],function(e){var t=e.typed,r=e.parse;return t("evaluate",{string:function(e){return r(e).compile().evaluate({})},"string, Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t={};return Ce(e,function(e){return r(e).compile().evaluate(t)})},"Array | Matrix, Object":function(e,t){return Ce(e,function(e){return r(e).compile().evaluate(t)})}})}),La=ne("eval",["evaluate"],function(e){var t=e.evaluate;return function(){Pe('Function "eval" has been renamed to "evaluate" in v6.0.0, please use the new function instead.');for(var e=arguments.length,r=new Array(e),n=0;n0)for(t=0;t0&&e.forEach(0,r-1,function(t,r){p._forEachRow(t,v,b,x,function(n,i){n>t&&e.accumulate(n,l(o(i,r)))})});var C,j,k,I,T=r,B=e.get(r),_=n(B);e.forEach(r+1,s-1,function(e,t){var r=n(t);u(r,_)&&(T=e,_=r,B=t)}),r!==T&&(p._swapRows(r,T,w[1],v,b,x),p._swapRows(r,T,O[1],N,M,A),e.swap(r,T),j=T,k=S[C=r],I=S[j],E[k]=j,E[I]=C,S[C]=I,S[j]=k),e.forEach(0,s-1,function(e,t){e<=r?(N.push(t),M.push(e)):(t=a(t,B),c(t,0)||(v.push(t),b.push(e)))})};for(r=0;r0)for(var n="Complex"===r[0][0].type?h(0):0,i=0;i=0;){var u=r[o+s],c=r[n+u];-1===c?(s--,a[t++]=u):(r[n+u]=r[i+c],r[o+ ++s]=c)}return t}function Ya(e){return-e-2}var Ka=ne("csAmd",["add","multiply","transpose"],function(e){var t=e.add,r=e.multiply,n=e.transpose;return function(e,o){if(!o||e<=0||e>3)return null;var s=o._size,u=s[0],c=s[1],l=0,f=Math.max(16,10*Math.sqrt(c)),p=function(e,i,a,o,s){var u=n(i);if(1===e&&o===a)return t(i,u);if(2===e){for(var c=u._index,l=u._ptr,f=0,p=0;ps))for(var d=l[p+1];mo)r[s+p]=0,r[i+p]=-1,f++,t[p]=Ya(e),r[s+e]++;else{var d=r[u+m];-1!==d&&(c[d]=p),r[l+p]=r[u+m],r[u+m]=p}}return f}(c,k,B,z,R,F,f,_,q,P,D),H=0;QG?(v=h,b=W,x=B[0+h]-G):(b=k[v=j[W++]],x=B[0+v]),y=1;y<=x;y++)(w=B[_+(m=j[b++])])<=0||(Z+=w,B[_+m]=-w,j[K++]=m,-1!==B[D+m]&&(P[B[D+m]]=P[m]),-1!==P[m]?B[D+P[m]]=B[D+m]:B[q+B[z+m]]=B[D+m]);v!==h&&(k[v]=Ya(h),B[F+v]=0)}for(0!==G&&(I=K),B[z+h]=Z,k[h]=Y,B[0+h]=K-Y,B[R+h]=-2,L=i(L,l,B,F,c),N=Y;N=L?B[F+v]-=w:0!==B[F+v]&&(B[F+v]=B[z+v]+V)}for(N=Y;N0?(C+=$,j[E++]=v,S+=v):(k[v]=Ya(h),B[F+v]=0)}B[R+m]=E-A+1;var X=E,ee=A+B[0+m];for(W=O+1;W=0))for(m=B[U+(S=P[m])],B[U+S]=-1;-1!==m&&-1!==B[D+m];m=B[D+m],L++){for(x=B[0+m],M=B[R+m],W=k[m]+1;W<=k[m]+x-1;W++)B[F+j[W]]=L;var re=m;for(d=B[D+m];-1!==d;){var ne=B[0+d]===x&&B[R+d]===M;for(W=k[d]+1;ne&&W<=k[d]+x-1;W++)B[F+j[W]]!==L&&(ne=0);ne?(k[d]=Ya(m),B[_+m]+=B[_+d],B[_+d]=0,B[R+d]=-1,d=B[D+d],B[D+re]=d):(re=d,d=B[D+d])}}for(W=Y,N=Y;N=0;d--)B[_+d]>0||(B[D+d]=B[q+k[d]],B[q+k[d]]=d);for(v=c;v>=0;v--)B[_+v]<=0||-1!==k[v]&&(B[D+v]=B[q+k[v]],B[q+k[v]]=v);for(h=0,m=0;m<=c;m++)-1===k[m]&&(h=Wa(m,h,B,q,D,T,F));return T.splice(T.length-1,1),T};function i(e,t,r,n,i){if(e<2||e+t<0){for(var a=0;a=1&&N[o]++,2===E.jleaf&&N[E.q]--}-1!==r[o]&&(g[0+o]=r[o])}for(o=0;o=0;r--)-1!==e[r]&&(a[o+r]=a[0+e[r]],a[0+e[r]]=r);for(r=0;r=0;u--)for(l=r[u],f=r[u+1],c=l;c=0;s--)m[s]=-1,-1!==(u=d[s])&&(0==h[v+u]++&&(h[y+u]=s),h[0+s]=h[g+u],h[g+u]=s);for(t.lnz=0,t.m2=a,u=0;u=0;){e=n[f];var p=i?i[e]:e;eo(c,e)||(to(c,e),n[l+f]=p<0?0:ro(c[p]));var m=1;for(o=n[l+f],s=p<0?0:ro(c[p+1]);o3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var n=f(t,e,!1),i=p(e,n,r);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})});function so(e,t){var r,n=t.length,i=[];if(e)for(r=0;r1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},sqrt:{name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},sqrtm:{name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]},square:{name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},subtract:{name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},unaryMinus:{name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},bitAnd:{name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitNot:{name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},bitOr:{name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},bitXor:{name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},leftShift:{name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},rightArithShift:{name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},rightLogShift:{name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},bellNumbers:{name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},catalan:{name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},composition:{name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},stirlingS2:{name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},config:{name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},import:{name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},typed:{name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]},arg:{name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},conj:{name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},re:{name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},im:{name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},evaluate:po,eval:po,help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},intersect:{name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},and:{name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},not:{name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},or:{name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},xor:{name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},concat:{name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},cross:{name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},column:{name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row"]},ctranspose:{name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},det:{name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},diag:{name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},dot:{name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},getMatrixDataType:{name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},identity:{name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},filter:{name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},flatten:{name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},forEach:{name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]},inv:{name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],seealso:["inv"]},kron:{name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},map:{name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},ones:{name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},partitionSelect:{name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1)'],seealso:["sort"]},range:{name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},resize:{name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},reshape:{name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])"],seealso:["size","squeeze","resize"]},row:{name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column"]},size:{name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},sort:{name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},squeeze:{name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},subset:{name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},trace:{name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},transpose:{name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},zeros:{name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},combinations:{name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},combinationsWithRep:{name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},factorial:{name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},gamma:{name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},kldivergence:{name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},multinomial:{name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},permutations:{name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},pickRandom:{name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},random:{name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},randomInt:{name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},compare:{name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},compareNatural:{name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},compareText:{name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},deepEqual:{name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},equal:{name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},equalText:{name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},larger:{name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},largerEq:{name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},smaller:{name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},smallerEq:{name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},unequal:{name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},setCartesian:{name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},setDifference:{name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},setDistinct:{name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},setIntersect:{name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},setIsSubset:{name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},setMultiplicity:{name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},setPowerset:{name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},setSize:{name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},setSymDifference:{name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},setUnion:{name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},erf:{name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},mad:{name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},max:{name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},mean:{name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},median:{name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},min:{name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},mode:{name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},prod:{name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},quantileSeq:{name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. \n\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.",examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},std:{name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},sum:{name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},variance:go,var:go,acos:{name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},acosh:{name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},acot:{name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},acoth:{name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},acsc:{name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},acsch:{name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},asec:{name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},asinh:{name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},atan:{name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},atanh:{name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},atan2:{name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},cos:{name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},coth:{name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},csc:{name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},csch:{name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},sec:{name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},sech:{name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},sin:{name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},tanh:{name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},to:{name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},clone:{name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},format:{name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},isNaN:{name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isInteger:{name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},isNegative:{name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},isNumeric:{name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},hasNumericValue:{name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},isPositive:{name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isPrime:{name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},isZero:{name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},typeOf:fo,typeof:fo,numeric:{name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction)','numeric(4, "Fraction")','numeric(fraction(2, 5), "number)'],seealso:["number","fraction","bignumber","string","format"]}},vo=ne("help",["typed","mathWithTransform","Help"],function(e){var t=e.typed,r=e.mathWithTransform,n=e.Help;return t("help",{any:function(e){var t,i=e;if("string"!=typeof e)for(t in r)if(Object(w.f)(r,t)&&e===r[t]){i=t;break}var a=zr(yo,i);if(!a){var o="function"==typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new n(a)}})}),bo=ne("chain",["typed","Chain"],function(e){var t=e.typed,r=e.Chain;return t("chain",{"":function(){return new r},any:function(e){return new r(e)}})}),xo=ne("det",["typed","matrix","subtract","multiply","unaryMinus","lup"],function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.multiply,a=e.unaryMinus,o=e.lup;return t("det",{any:function(e){return Object(w.a)(e)},"Array | Matrix":function(e){var t;switch((t=Object(S.v)(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return Object(w.a)(e);case 1:if(1===t[0])return Object(w.a)(e.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+_(t)+")");case 2:var s=t[0],u=t[1];if(s===u)return function(e,t,r){if(1===t)return Object(w.a)(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var s=o(e),u=s.U[0][0],c=1;c=t)break;for(var m=f,d=0;!p[s.p[m]];)p[s.p[m]]=!0,m=s.p[m],d++;d%2==0&&l++}return l%2==0?u:a(u)}(e.clone().valueOf(),s);throw new RangeError("Matrix must be square (size: "+_(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+_(t)+")")}}})}),wo=ne("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.addScalar,a=e.multiply,o=e.unaryMinus,s=e.det,u=e.identity,c=e.abs;return t("inv",{"Array | Matrix":function(e){var t=Object(S.v)(e)?e.size():U(e);switch(t.length){case 1:if(1===t[0])return Object(S.v)(e)?r([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+_(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return Object(S.v)(e)?r(l(e.valueOf(),i,a),e.storage()):l(e,i,a);throw new RangeError("Matrix must be square (size: "+_(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+_(t)+")")}},any:function(e){return n(1,e)}});function l(e,t,r){var l,f,p,m,d;if(1===t){if(0===(m=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,m)]]}if(2===t){var h=s(e);if(0===h)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],h),n(o(e[0][1]),h)],[n(o(e[1][0]),h),n(e[0][0],h)]]}var g=e.concat();for(l=0;lb&&(b=c(g[l][v]),x=l),l++;if(0===b)throw Error("Cannot calculate inverse, determinant is zero");(l=x)!==v&&(d=g[v],g[v]=g[l],g[l]=d,d=y[v],y[v]=y[l],y[l]=d);var w=g[v],N=y[v];for(l=0;l1&&void 0!==arguments[1]?arguments[1]:1e-12,n=e.length,i=o(r/n),a=new Array(n),s=0;s=o(i);){var c=u[0][0],l=u[0][1];t=v(e[c][c],e[l][l],e[c][l]),e=N(e,t,c,l),a=x(a,t,c,l),u=O(e)}for(var f=S(n,0),p=0;p1&&void 0!==arguments[1]?arguments[1]:1e-12,n=e.length,i=Math.abs(r/n),a=new Array(n),o=0;o=Math.abs(i);){var u=s[0][0],c=s[0][1];e=M(e,t=y(e[u][u],e[c][c],e[u][c]),u,c),a=b(a,t,u,c),s=A(e)}for(var l=S(n,0),f=0;f1&&(g=o(g,p),y=-y),m=n(m,o(h=h*(l-v+1)/((2*l-v+1)*v),g)),d=n(d,o(h*y,g));for(var b=o(a(d),m),x=0;xp&&++a>f)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return m}return t("sqrtm",{"Array | Matrix":function(e){var t=Object(S.v)(e)?e.size():U(e);switch(t.length){case 1:if(1===t[0])return a(e);throw new RangeError("Matrix must be square (size: "+_(t)+")");case 2:if(t[0]===t[1])return m(e);throw new RangeError("Matrix must be square (size: "+_(t)+")")}}})}),Oo=ne("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],function(e){var t=e.typed,r=e.matrix,n=e.multiply,i=e.equalScalar,a=e.divideScalar,o=e.inv,s=Nt({typed:t,equalScalar:i}),u=vt({typed:t});return t("divide",Object(w.e)({"Array | Matrix, Array | Matrix":function(e,t){return n(e,o(t))},"DenseMatrix, any":function(e,t){return u(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return u(r(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,o(t))}},a.signatures))}),Eo=ne("distance",["typed","addScalar","subtract","divideScalar","multiplyScalar","unaryMinus","sqrt","abs"],function(e){var t=e.typed,r=e.addScalar,n=e.subtract,i=e.multiplyScalar,a=e.divideScalar,o=e.unaryMinus,s=e.sqrt,u=e.abs;return t("distance",{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var s=a(n(r[1],r[0]),n(t[1],t[0])),u=i(i(s,s),t[0]),c=o(i(s,t[0])),f=e[1];return h(e[0],e[1],u,c,f)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){var s=a(n(r.lineTwoPtY,r.lineTwoPtX),n(t.lineOnePtY,t.lineOnePtX)),u=i(i(s,s),t.lineOnePtX),c=o(i(s,t.lineOnePtX)),f=e.pointX;return h(e.pointX,e.pointY,u,c,f)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return h(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!f(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!p(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!p(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return y(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in t&&"yCoeffLine"in t&&"constant"in t)return h(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!f(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in t&&"y0"in t&&"z0"in t&&"a"in t&&"b"in t&&"c"in t)return g(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in t&&"pointTwoY"in t)return y([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!f(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in t&&"pointTwoY"in t&&"pointTwoZ"in t)return y([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&c(e[0][0])&&c(e[0][1])){if(e.some(function(e){return 2!==e.length||!c(e[0])||!c(e[1])}))return!1}else{if(!(3===e[0].length&&c(e[0][0])&&c(e[0][1])&&c(e[0][2])))return!1;if(e.some(function(e){return 3!==e.length||!c(e[0])||!c(e[1])||!c(e[2])}))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=[],n=[],i=0;i0&&(o=e[s]);return c(o,n)}var l=a(e,(t-1)/2);return u(l)}catch(e){throw sn(e,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(e){return e}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return o}),Io=ne("mad",["typed","abs","map","median","subtract"],function(e){var t=e.typed,r=e.abs,n=e.map,i=e.median,a=e.subtract;return t("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=Z(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(n(e,function(e){return r(a(e,t))}))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):sn(e,"mad")}}}),To=ne("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,a=e.divide,o=e.apply,s=e.isNaN;return t("variance",{"Array | Matrix":function(e){return u(e,"unbiased")},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,"unbiased")},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return u(e,"unbiased")}});function u(e,t){var o=0,u=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Se(e,function(e){try{o=r(o,e),u++}catch(t){throw sn(t,"variance",e)}}),0===u)throw new Error("Cannot calculate variance of an empty array");var c=a(o,u);if(o=0,Se(e,function(e){var t=n(e,c);o=r(o,i(t,t))}),s(o))return o;switch(t){case"uncorrected":return a(o,u);case"biased":return a(o,u+1);case"unbiased":var l=Object(S.e)(o)?o.mul(0):0;return 1===u?l:a(o,u-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(e,t,function(e){return u(e,r)})}catch(e){throw sn(e,"variance")}}}),Bo=ne("var",["variance"],function(e){var t=e.variance;return function(){Pe('Function "var" has been renamed to "variance" in v6.0.0, please use the new function instead.');for(var e=arguments.length,r=new Array(e),n=0;n0&&(m=u[g])}return s(m),s(d),r(n(m,1-f),n(d,f))}var y=t.times(c-1);if(y.isInteger()){y=y.toNumber();var v=o?u[y]:i(u,y);return s(v),v}var b,x,w=y.floor(),N=y.minus(w),M=w.toNumber();if(o)b=u[M],x=u[M+1];else{x=i(u,M+1),b=u[M];for(var A=0;A0&&(b=u[A])}s(b),s(x);var O=new N.constructor(1);return r(n(b,O.minus(N)),n(x,N))}var s=t({"number | BigNumber | Unit":function(e){return e}});return function(e,t,r){var n,i,a;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(Object(S.i)(e)){if("boolean"==typeof(r=r||!1)){if(i=e.valueOf(),Object(S.y)(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return o(i,t,r);if(t>1){if(!Object(k.i)(t))throw new Error("N must be a positive integer");var s=t+1;n=new Array(t);for(var u=0;u4294967295)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var f=new c(l+1);n=new Array(l);for(var p=0;p1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!Object(S.e)(d))throw new TypeError("Unexpected type of argument in function quantileSeq");if(a=new d.constructor(1),d.isNegative()||d.gt(a))throw new Error("Probability must be between 0 and 1, inclusive")}n[m]=o(i,d,r)}return n}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}),Do=ne("std",["typed","sqrt","variance"],function(e){var t=e.typed,r=e.sqrt,n=e.variance;return t("std",{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(e){return i(e)}});function i(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return r(n.apply(null,arguments))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}}),qo=r("kEzi"),Ro=ne("combinations",["typed"],function(e){return(0,e.typed)("combinations",{"number, number":qo.a,"BigNumber, BigNumber":function(e,t){var r,n,i=e.constructor,a=e.minus(t),o=new i(1);if(!zo(e)||!zo(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(r=o,t.lt(a))for(n=o;n.lte(a);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(a.plus(n)).dividedBy(n);return r}})});function zo(e){return e.isInteger()&&e.gte(0)}var Fo=r("hN2E"),Uo=ne("combinationsWithRep",["typed"],function(e){return(0,e.typed)("combinationsWithRep",{"number, number":function(e,t){if(!Object(k.i)(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Object(k.i)(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t2;)u+=o-=2,s=s.times(u);return new a(s.toPrecision(a.precision))}(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(e){return Ce(e,s)}});return s}),Qo=ne("factorial",["typed","gamma"],function(e){var t=e.typed,r=e.gamma,n=t("factorial",{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":function(e){return Ce(e,n)}});return n}),Ho=ne("kldivergence",["typed","matrix","divide","sum","multiply","dotDivide","log","isNumeric"],function(e){var t=e.typed,r=e.matrix,n=e.divide,i=e.sum,a=e.multiply,o=e.dotDivide,s=e.log,u=e.isNumeric;return t("kldivergence",{"Array, Array":function(e,t){return c(r(e),r(t))},"Matrix, Array":function(e,t){return c(e,r(t))},"Array, Matrix":function(e,t){return c(r(e),t)},"Matrix, Matrix":function(e,t){return c(e,t)}});function c(e,t){var r=t.size().length,c=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(c>1)throw new Error("second object must be one dimensional");if(r!==c)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");var l=n(e,i(e)),f=n(t,i(t)),p=i(a(l,s(o(l,f))));return u(p)?p:Number.NaN}}),Go=ne("multinomial",["typed","add","divide","multiply","factorial","isInteger","isPositive"],function(e){var t=e.typed,r=e.add,n=e.divide,i=e.multiply,a=e.factorial,o=e.isInteger,s=e.isPositive;return t("multinomial",{"Array | Matrix":function(e){var t=0,u=1;return Se(e,function(e){if(!o(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),u=i(u,a(e))}),n(a(t),u)}})}),Jo=ne("permutations",["typed","factorial"],function(e){return(0,e.typed)("permutations",{"number | BigNumber":e.factorial,"number, number":function(e,t){if(!Object(k.i)(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!Object(k.i)(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return Object(Fo.a)(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!Zo(e)||!Zo(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})});function Zo(e){return e.isInteger()&&e.gte(0)}var Wo=r("Uw4v"),Yo=r.n(Wo),Ko=Yo()();function Vo(e){var t,r;return t=null===(r=e)?Ko:Yo()(String(r)),function(){return t()}}var $o=ne("pickRandom",["typed","config","?on"],function(e){var t=e.typed,r=e.config,n=e.on,i=Vo(r.randomSeed);return n&&n("config",function(e,t){e.randomSeed!==t.randomSeed&&(i=Vo(e.randomSeed))}),t({"Array | Matrix":function(e){return a(e)},"Array | Matrix, number":function(e,t){return a(e,t,void 0)},"Array | Matrix, Array":function(e,t){return a(e,void 0,t)},"Array | Matrix, Array | Matrix, number":function(e,t,r){return a(e,r,t)},"Array | Matrix, number, Array | Matrix":function(e,t,r){return a(e,t,r)}});function a(e,t,r){var n=void 0===t;if(n&&(t=1),e=e.valueOf(),r&&(r=r.valueOf()),U(e).length>1)throw new Error("Only one dimensional vectors supported");var a=0;if(void 0!==r){if(r.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var o=0,s=r.length;o=u)return t>1?e:e[0];for(var c,l=[];l.length1)for(var n=0,i=e.shift();n2&&o(t)){for(var a=t.args.pop();t.args.length>0;)a=r([t.args.pop(),a]);t.args=a.args}}},unflattenl:function e(t){if(t.args&&0!==t.args.length){for(var r=u(t),n=t.args.length,i=0;i2&&o(t)){for(var a=t.args.shift();t.args.length>0;)a=r([a,t.args.shift()]);t.args=a.args}}}}}),ss=ne("simplifyCore",["equal","isZero","add","subtract","multiply","divide","pow","ConstantNode","OperatorNode","FunctionNode","ParenthesisNode"],function(e){var t=e.equal,r=e.isZero,n=e.add,i=e.subtract,a=e.multiply,o=e.divide,s=e.pow,u=e.ConstantNode,c=e.OperatorNode,l=e.FunctionNode,f=e.ParenthesisNode,p=new u(0),m=new u(1);return function e(d){if(Object(S.B)(d)&&d.isUnary()){var h=e(d.args[0]);if("+"===d.op)return h;if("-"===d.op){if(Object(S.B)(h)){if(h.isUnary()&&"-"===h.op)return h.args[0];if(h.isBinary()&&"subtract"===h.fn)return new c("-","subtract",[h.args[1],h.args[0]])}return new c(d.op,d.fn,[h])}}else if(Object(S.B)(d)&&d.isBinary()){var g=e(d.args[0]),y=e(d.args[1]);if("+"===d.op){if(Object(S.l)(g)){if(r(g.value))return y;if(Object(S.l)(y))return new u(n(g.value,y.value))}return Object(S.l)(y)&&r(y.value)?g:Object(S.B)(y)&&y.isUnary()&&"-"===y.op?new c("-","subtract",[g,y.args[0]]):new c(d.op,d.fn,y?[g,y]:[g])}if("-"===d.op){if(Object(S.l)(g)&&y){if(Object(S.l)(y))return new u(i(g.value,y.value));if(r(g.value))return new c("-","unaryMinus",[y])}if("subtract"===d.fn)return Object(S.l)(y)&&r(y.value)?g:Object(S.B)(y)&&y.isUnary()&&"-"===y.op?e(new c("+","add",[g,y.args[0]])):new c(d.op,d.fn,[g,y])}else{if("*"===d.op){if(Object(S.l)(g)){if(r(g.value))return p;if(t(g.value,1))return y;if(Object(S.l)(y))return new u(a(g.value,y.value))}if(Object(S.l)(y)){if(r(y.value))return p;if(t(y.value,1))return g;if(Object(S.B)(g)&&g.isBinary()&&g.op===d.op){var v=g.args[0];if(Object(S.l)(v)){var b=new u(a(v.value,y.value));return new c(d.op,d.fn,[b,g.args[1]],d.implicit)}}return new c(d.op,d.fn,[y,g],d.implicit)}return new c(d.op,d.fn,[g,y],d.implicit)}if("/"===d.op){if(Object(S.l)(g)){if(r(g.value))return p;if(Object(S.l)(y)&&(t(y.value,1)||t(y.value,2)||t(y.value,4)))return new u(o(g.value,y.value))}return new c(d.op,d.fn,[g,y])}if("^"===d.op){if(Object(S.l)(y)){if(r(y.value))return m;if(t(y.value,1))return g;if(Object(S.l)(g))return new u(s(g.value,y.value));if(Object(S.B)(g)&&g.isBinary()&&"^"===g.op){var x=g.args[1];if(Object(S.l)(x))return new c(d.op,d.fn,[g.args[0],new u(a(x.value,y.value))])}}return new c(d.op,d.fn,[g,y])}}}else{if(Object(S.C)(d)){var w=e(d.content);return Object(S.C)(w)||Object(S.J)(w)||Object(S.l)(w)?w:new f(w)}if(Object(S.r)(d)){var N=d.args.map(e).map(function(e){return Object(S.C)(e)?e.content:e});return new l(e(d.fn),N)}}return d}}),us=ne("simplifyConstant",["typed","config","mathWithTransform","?fraction","?bignumber","ConstantNode","OperatorNode","FunctionNode","SymbolNode"],function(e){var t=e.typed,r=e.config,n=e.mathWithTransform,i=e.fraction,a=e.bignumber,o=e.ConstantNode,s=e.OperatorNode,u=e.FunctionNode,c=e.SymbolNode,l=os({FunctionNode:u,OperatorNode:s,SymbolNode:c}),f=l.isCommutative,p=l.isAssociative,m=l.allChildren,d=l.createMakeNodeFunction;function h(e,t,r){try{return v(n[e].apply(null,t),r)}catch(i){return t=t.map(function(e){return Object(S.o)(e)?e.valueOf():e}),v(n[e].apply(null,t),r)}}var g=t({Fraction:function(e){var t,r=e.s*e.n;t=r<0?new s("-","unaryMinus",[new o(-r)]):new o(r);if(1===e.d)return t;return new s("/","divide",[t,new o(e.d)])},number:function(e){return e<0?b(new o(-e)):new o(e)},BigNumber:function(e){return e<0?b(new o(-e)):new o(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function y(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&i){var r=i(e);if(r.valueOf()===e)return r}return e}var v=t({"string, Object":function(e,t){return"BigNumber"===r.number?(void 0===a&&Sr(),a(e)):"Fraction"===r.number?(void 0===i&&Cr(),i(e)):y(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return y(e,t)},"Complex, Object":function(e,t){return 0!==e.im?e:y(e.re,t)}});function b(e){return new s("-","unaryMinus",[e])}function x(e,t,r,n){return t.reduce(function(t,i){if(Object(S.w)(t)||Object(S.w)(i))Object(S.w)(t)?Object(S.w)(i)||(i=g(i)):t=g(t);else{try{return h(e,[t,i],n)}catch(e){}t=g(t),i=g(i)}return r([t,i])})}return function(e,t){var r=function e(t,r){switch(t.type){case"SymbolNode":return t;case"ConstantNode":return"number"!=typeof t.value&&isNaN(t.value)?t:v(t.value,r);case"FunctionNode":if(n[t.name]&&n[t.name].rawArgs)return t;if(-1===["add","multiply"].indexOf(t.name)){var i=t.args.map(function(t){return e(t,r)});if(!i.some(S.w))try{return h(t.name,i,r)}catch(e){}return i=i.map(function(e){return Object(S.w)(e)?e:g(e)}),new u(t.name,i)}case"OperatorNode":var a,o,s=t.fn.toString(),c=d(t);if(Object(S.B)(t)&&t.isUnary())a=[e(t.args[0],r)],o=Object(S.w)(a[0])?c(a):h(s,a,r);else if(p(t))if(a=(a=m(t)).map(function(t){return e(t,r)}),f(s)){for(var l=[],y=[],b=0;b1?(o=x(s,l,c,r),y.unshift(o),o=x(s,y,c,r)):o=x(s,a,c,r)}else o=x(s,a,c,r);else a=t.args.map(function(t){return e(t,r)}),o=x(s,a,c,r);return o;case"ParenthesisNode":return e(t.content,r);case"AccessorNode":case"ArrayNode":case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"IndexNode":case"ObjectNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(t.type))}}(e,t);return Object(S.w)(r)?r:g(r)}}),cs=ne("resolve",["parse","FunctionNode","OperatorNode","ParenthesisNode"],function(e){var t=e.parse,r=e.FunctionNode,n=e.OperatorNode,i=e.ParenthesisNode;return function e(a,o){if(!o)return a;if(Object(S.J)(a)){var s=o[a.name];if(Object(S.w)(s))return e(s,o);if("number"==typeof s)return t(String(s))}else{if(Object(S.B)(a)){var u=a.args.map(function(t){return e(t,o)});return new n(a.op,a.fn,u,a.implicit)}if(Object(S.C)(a))return new i(e(a.content,o));if(Object(S.r)(a)){var c=a.args.map(function(t){return e(t,o)});return new r(a.name,c)}}return a}});function ls(e){"@babel/helpers - typeof";return(ls="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)}var fs=ne("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","?fraction","?bignumber","mathWithTransform","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],function(e){var t=e.config,r=e.typed,n=e.parse,i=e.add,a=e.subtract,o=e.multiply,s=e.divide,u=e.pow,c=e.isZero,l=e.equal,f=e.fraction,p=e.bignumber,m=e.mathWithTransform,d=e.ConstantNode,h=e.FunctionNode,g=e.OperatorNode,y=e.ParenthesisNode,v=e.SymbolNode,b=us({typed:r,config:t,mathWithTransform:m,fraction:f,bignumber:p,ConstantNode:d,OperatorNode:g,FunctionNode:h,SymbolNode:v}),x=ss({equal:l,isZero:c,add:i,subtract:a,multiply:o,divide:s,pow:u,ConstantNode:d,OperatorNode:g,FunctionNode:h,ParenthesisNode:y}),N=cs({parse:n,FunctionNode:h,OperatorNode:g,ParenthesisNode:y}),M=os({FunctionNode:h,OperatorNode:g,SymbolNode:v}),A=M.isCommutative,O=M.isAssociative,E=M.flatten,C=M.unflattenr,j=M.unflattenl,k=M.createMakeNodeFunction,I=r("simplify",{string:function(e){return I(n(e),I.rules,{},{})},"string, Object":function(e,t){return I(n(e),I.rules,t,{})},"string, Object, Object":function(e,t,r){return I(n(e),I.rules,t,r)},"string, Array":function(e,t){return I(n(e),t,{},{})},"string, Array, Object":function(e,t,r){return I(n(e),t,r,{})},"string, Array, Object, Object":function(e,t,r,i){return I(n(e),t,r,i)},"Node, Object":function(e,t){return I(e,I.rules,t,{})},"Node, Object, Object":function(e,t,r){return I(e,I.rules,t,r)},Node:function(e){return I(e,I.rules,{},{})},"Node, Array":function(e,t){return I(e,t,{},{})},"Node, Array, Object":function(e,t,r){return I(e,t,r,{})},"Node, Array, Object, Object":function(e,t,r,i){t=function(e){for(var t=[],r=0;r");if(2!==s.length)throw SyntaxError("Could not parse rule: "+i);i={l:s[0],r:s[1]};case"object":if(a={l:T(n(i.l)),r:T(n(i.r))},i.context&&(a.evaluate=i.context),i.evaluate&&(a.evaluate=n(i.evaluate)),O(a.l)){var u=k(a.l),c=new v("_p"+_++);a.expanded={},a.expanded.l=u([a.l.clone(),c]),E(a.expanded.l),C(a.expanded.l),a.expanded.r=u([a.r,c])}break;case"function":a=i;break;default:throw TypeError("Unsupported type of rule: "+o)}t.push(a)}return t}(t);for(var a=N(e,r),o={},s=(a=T(a)).toString({parenthesis:"all"});!o[s];){o[s]=!0,_=0;for(var u=0;u=2&&2===e.args.length){for(var i=function(e,t){var r,n,i=[],a=k(e);if(A(e,t))for(var o=0;o2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var u=[],c=0;c0){for(var n=h(e,t.args[0],r),i=1;i0){var n=e.args.filter(function(e){return void 0===t[e]}),i=1===n.length?n[0]:new l("*","multiply",n),s=r.concat(g(i,t));return new l("*","multiply",s)}return new l("+","add",e.args.map(function(r){return new l("*","multiply",e.args.map(function(e){return e===r?g(e,t):e.clone()}))}))}if("/"===e.op&&e.isBinary()){var u=e.args[0],f=e.args[1];return void 0!==t[f]?new l("/","divide",[g(u,t),f]):void 0!==t[u]?new l("*","multiply",[new l("-","unaryMinus",[u]),new l("/","divide",[g(f,t),new l("^","pow",[f.clone(),y(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[g(u,t),f.clone()]),new l("*","multiply",[u.clone(),g(f,t)])]),new l("^","pow",[f.clone(),y(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],m=e.args[1];if(void 0!==t[p])return Object(S.l)(p)&&(o(p.value)||a(p.value,1))?y(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[p.clone()]),g(m.clone(),t)])]);if(void 0!==t[m]){if(Object(S.l)(m)){if(o(m.value))return y(0);if(a(m.value,1))return g(p,t)}var d=new l("^","pow",[p.clone(),new l("-","subtract",[m,y(1)])]);return new l("*","multiply",[m.clone(),new l("*","multiply",[g(p,t),d])])}return new l("*","multiply",[new l("^","pow",[p.clone(),m.clone()]),new l("+","add",[new l("*","multiply",[g(p,t),new l("/","divide",[m.clone(),p.clone()])]),new l("*","multiply",[g(m,t),new c("log",[p.clone()])])])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function y(e,t){return new u(s(e,t||r.number))}return m}),ms=ne("rationalize",["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplify","?bignumber","?fraction","mathWithTransform","ConstantNode","OperatorNode","FunctionNode","SymbolNode","ParenthesisNode"],function(e){var t=e.config,r=e.typed,n=e.equal,i=e.isZero,a=e.add,o=e.subtract,s=e.multiply,u=e.divide,c=e.pow,l=e.parse,f=e.simplify,p=e.fraction,m=e.bignumber,d=e.mathWithTransform,h=e.ConstantNode,g=e.OperatorNode,y=e.FunctionNode,v=e.SymbolNode,b=e.ParenthesisNode,x=us({typed:r,config:t,mathWithTransform:d,fraction:p,bignumber:m,ConstantNode:h,OperatorNode:g,FunctionNode:y,SymbolNode:v}),w=ss({equal:n,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,ConstantNode:h,OperatorNode:g,FunctionNode:y,ParenthesisNode:b}),N=r("rationalize",{string:function(e){return N(l(e),{},!1)},"string, boolean":function(e,t){return N(l(e),{},t)},"string, Object":function(e,t){return N(l(e),t,!1)},"string, Object, boolean":function(e,t,r){return N(l(e),t,r)},Node:function(e){return N(e,{},!1)},"Node, boolean":function(e,t){return N(e,{},t)},"Node, Object":function(e,t){return N(e,t,!1)},"Node, Object, boolean":function(e,t,r){var n=function(){var e=[w,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},x,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(t,r),n.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],n.sucDivRules=r,n.firstRulesAgain=e.concat(t),n.finalRules=[w,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},x,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],n}(),i=function(e,t,r,n){var i=[],a=f(e,n,t,{exactFractions:!1}),o="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!Object(k.i)(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===o.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n=1){var o,s;e=function e(t,r,n){var i=t.type;var a=arguments.length>1;if("OperatorNode"===i&&t.isBinary()){var o,s=!1;if("^"===t.op&&("ParenthesisNode"!==t.args[0].type&&"OperatorNode"!==t.args[0].type||"ConstantNode"!==t.args[1].type||(o=parseFloat(t.args[1].value),s=o>=2&&Object(k.i)(o))),s){if(o>2){var u=t.args[0],c=new g("^","pow",[t.args[0].cloneDeep(),new h(o-1)]);t=new g("*","multiply",[u,c])}else t=new g("*","multiply",[t.args[0],t.args[0].cloneDeep()]);a&&("content"===n?r.content=t:r.args[n]=t)}}if("ParenthesisNode"===i)e(t.content,t,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(var l=0;ln&&(t[c]=0),t[c]+=o.cte*("+"===o.oper?1:-1),void(n=Math.max(c,n))}o.cte=c,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,r);for(var a,o=!0,s=n=t.length-1;s>=0;s--)if(0!==t[s]){var u=new h(o?t[s]:Math.abs(t[s])),c=t[s]<0?"-":"+";if(s>0){var l=new v(i);if(s>1){var f=new h(s);l=new g("^","pow",[l,f])}u=-1===t[s]&&o?new g("-","unaryMinus",[l]):1===Math.abs(t[s])?l:new g("*","multiply",[u,l])}a=o?u:"+"===c?new g("+","add",[a,u]):new g("-","subtract",[a,u]),o=!1}return o?new h(0):a}return N}),ds=ne("reviver",["classes"],function(e){var t=e.classes;return function(e,r){var n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}}),hs=ne("true",[],function(){return!0}),gs=ne("false",[],function(){return!1}),ys=ne("null",[],function(){return null}),vs=_s("Infinity",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1/0):1/0}),bs=_s("NaN",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(NaN):NaN}),xs=_s("pi",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?ii(r):_e.pi}),ws=_s("tau",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?ai(r):_e.tau}),Ns=_s("e",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?ri(r):_e.e}),Ms=_s("phi",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?ni(r):_e.phi}),As=_s("LN2",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).ln():Math.LN2}),Os=_s("LN10",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(10).ln():Math.LN10}),Es=_s("LOG2E",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E}),Ss=_s("LOG10E",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E}),Cs=_s("SQRT1_2",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2}),js=_s("SQRT2",["config","?BigNumber"],function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2}),ks=_s("i",["Complex"],function(e){return e.Complex.I}),Is=ne("PI",["pi"],function(e){return e.pi}),Ts=ne("E",["e"],function(e){return e.e}),Bs=ne("version",[],function(){return"6.6.1"});function _s(e,t,r){return ne(e,t,r,{recreateOnConfigChange:!0})}var Ds=Iu("speedOfLight","299792458","m s^-1"),qs=Iu("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Rs=Iu("planckConstant","6.62607015e-34","J s"),zs=Iu("reducedPlanckConstant","1.0545718176461565e-34","J s"),Fs=Iu("magneticConstant","1.25663706212e-6","N A^-2"),Us=Iu("electricConstant","8.8541878128e-12","F m^-1"),Ps=Iu("vacuumImpedance","376.730313667","ohm"),Ls=Iu("coulomb","8.987551792261171e9","N m^2 C^-2"),Qs=Iu("elementaryCharge","1.602176634e-19","C"),Hs=Iu("bohrMagneton","9.2740100783e-24","J T^-1"),Gs=Iu("conductanceQuantum","7.748091729863649e-5","S"),Js=Iu("inverseConductanceQuantum","12906.403729652257","ohm"),Zs=Iu("magneticFluxQuantum","2.0678338484619295e-15","Wb"),Ws=Iu("nuclearMagneton","5.0507837461e-27","J T^-1"),Ys=Iu("klitzing","25812.807459304513","ohm"),Ks=Iu("bohrRadius","5.29177210903e-11","m"),Vs=Iu("classicalElectronRadius","2.8179403262e-15","m"),$s=Iu("electronMass","9.1093837015e-31","kg"),Xs=Iu("fermiCoupling","1.1663787e-5","GeV^-2"),eu=Tu("fineStructure",.0072973525693),tu=Iu("hartreeEnergy","4.3597447222071e-18","J"),ru=Iu("protonMass","1.67262192369e-27","kg"),nu=Iu("deuteronMass","3.3435830926e-27","kg"),iu=Iu("neutronMass","1.6749271613e-27","kg"),au=Iu("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),ou=Iu("rydberg","10973731.568160","m^-1"),su=Iu("thomsonCrossSection","6.6524587321e-29","m^2"),uu=Tu("weakMixingAngle",.2229),cu=Tu("efimovFactor",22.7),lu=Iu("atomicMass","1.66053906660e-27","kg"),fu=Iu("avogadro","6.02214076e23","mol^-1"),pu=Iu("boltzmann","1.380649e-23","J K^-1"),mu=Iu("faraday","96485.33212331001","C mol^-1"),du=Iu("firstRadiation","3.7417718521927573e-16","W m^2"),hu=Iu("loschmidt","2.686780111798444e25","m^-3"),gu=Iu("gasConstant","8.31446261815324","J K^-1 mol^-1"),yu=Iu("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),vu=Iu("molarVolume","0.022413969545014137","m^3 mol^-1"),bu=Tu("sackurTetrode",-1.16487052358),xu=Iu("secondRadiation","0.014387768775039337","m K"),wu=Iu("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Nu=Iu("wienDisplacement","2.897771955e-3","m K"),Mu=Iu("molarMass","0.99999999965e-3","kg mol^-1"),Au=Iu("molarMassC12","11.9999999958e-3","kg mol^-1"),Ou=Iu("gravity","9.80665","m s^-2"),Eu=Iu("planckLength","1.616255e-35","m"),Su=Iu("planckMass","2.176435e-8","kg"),Cu=Iu("planckTime","5.391245e-44","s"),ju=Iu("planckCharge","1.87554603778e-18","C"),ku=Iu("planckTemperature","1.416785e+32","K");function Iu(e,t,r){return ne(e,["config","Unit","BigNumber"],function(e){var n=e.config,i=e.Unit,a=e.BigNumber,o=new i("BigNumber"===n.number?new a(t):parseFloat(t),r);return o.fixPrefix=!0,o})}function Tu(e,t){return ne(e,["config","BigNumber"],function(e){var r=e.config,n=e.BigNumber;return"BigNumber"===r.number?new n(t):t})}var Bu=ne("apply",["typed","isInteger"],function(e){var t=e.typed,r=e.isInteger,n=it({typed:t,isInteger:r});return t("apply",{"...any":function(e){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),_u=ne("column",["typed","Index","matrix","range"],function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range,a=cr({typed:t,Index:r,matrix:n,range:i});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];Object(S.y)(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0});function Du(e,t,r){var n=e.filter(function(e){return Object(S.J)(e)&&!(e.name in t)&&!(e.name in r)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=Object.create(r),o=e.compile();return function(e){return a[i]=e,o.evaluate(a)}}var qu=ne("filter",["typed"],function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=Object(S.J)(e[1])||Object(S.q)(e[1])?e[1].compile().evaluate(r):Du(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":Ru,"Matrix, function":function(e,t){return e.create(Ru(e.toArray(),t))},"Array, RegExp":V,"Matrix, RegExp":function(e,t){return e.create(V(e.toArray(),t))}});return r},{isTransformFunction:!0});function Ru(e,t){var r=hr(t);return K(e,function(e,n,i){return 1===r?t(e):2===r?t(e,[n+1]):t(e,[n+1],i)})}var zu=ne("forEach",["typed"],function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=Object(S.J)(e[1])||Object(S.q)(e[1])?e[1].compile().evaluate(r):Du(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(e,t){var r=hr(t);!function n(i,a){Array.isArray(i)?Y(i,function(e,t){n(e,a.concat(t+1))}):1===r?t(i):2===r?t(i,a):t(i,a,e)}(e.valueOf(),[])}});return r},{isTransformFunction:!0}),Fu=ne("index",["Index"],function(e){var t=e.Index;return function(){for(var e=[],r=0,n=arguments.length;r0?0:2;else if(i&&!0===i.isSet)i=i.map(function(e){return e-1});else if(Object(S.b)(i)||Object(S.v)(i))i=i.map(function(e){return e-1});else if(Object(S.y)(i))i--;else if(Object(S.e)(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[r]=i}var a=new t;return t.apply(a,e),a}},{isTransformFunction:!0}),Uu=ne("map",["typed"],function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=Object(S.J)(e[1])||Object(S.q)(e[1])?e[1].compile().evaluate(r):Du(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(e,t){return Pu(e,t,e)},"Matrix, function":function(e,t){return e.create(Pu(e.valueOf(),t,e))}});return r},{isTransformFunction:!0});function Pu(e,t,r){var n=hr(t);return function e(i,a){return Array.isArray(i)?W(i,function(t,r){return e(t,a.concat(r+1))}):1===n?t(i):2===n?t(i,a):t(i,a,r)}(e,[])}var Lu=ne("max",["typed","larger"],function(e){var t=e.typed,r=e.larger,n=Kn({typed:t,larger:r});return t("max",{"...any":function(e){if(2===e.length&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return n.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Qu=ne("mean",["typed","add","divide"],function(e){var t=e.typed,r=e.add,n=e.divide,i=jo({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){if(2===e.length&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Hu=ne("min",["typed","smaller"],function(e){var t=e.typed,r=e.smaller,n=Vn({typed:t,smaller:r});return t("min",{"...any":function(e){if(2===e.length&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return n.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Gu=ne("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,s=e.larger,u=e.largerEq,c=kr({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),c.apply(null,e)}})},{isTransformFunction:!0}),Ju=ne("row",["typed","Index","matrix","range"],function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range,a=_r({typed:t,Index:r,matrix:n,range:i});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];Object(S.y)(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Zu=ne("subset",["typed","matrix"],function(e){var t=e.typed,r=e.matrix,n=Gr({typed:t,matrix:r});return t("subset",{"...any":function(e){try{return n.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Wu=ne("concat",["typed","matrix","isInteger"],function(e){var t=e.typed,r=e.matrix,n=e.isInteger,i=sr({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];Object(S.y)(r)?e[t]=r-1:Object(S.e)(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Yu=ne("std",["typed","sqrt","variance"],function(e){var t=e.typed,r=e.sqrt,n=e.variance,i=Do({typed:t,sqrt:r,variance:n});return t("std",{"...any":function(e){if(e.length>=2&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Ku=ne("sum",["typed","config","add","?bignumber","?fraction"],function(e){var t=e.typed,r=e.config,n=e.add,i=e.bignumber,a=e.fraction,o=Co({typed:t,config:r,add:n,bignumber:i,fraction:a});return t("sum",{"...any":function(e){if(2===e.length&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),Vu=ne("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,a=e.divide,o=e.apply,s=e.isNaN,u=To({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:s});return t("variance",{"...any":function(e){if(e.length>=2&&Object(S.i)(e[0])){var t=e[1];Object(S.y)(t)?e[1]=t-1:Object(S.e)(t)&&(e[1]=t.minus(1))}try{return u.apply(null,e)}catch(e){throw na(e)}}})},{isTransformFunction:!0}),$u=fe({}),Xu=ve({}),ec=Ne({}),tc=pr({}),rc=gs({}),nc=ys({}),ic=hs({}),ac=de({config:E}),oc=Me({}),sc=Ns({BigNumber:ac,config:E}),uc=ks({Complex:Xu}),cc=Os({BigNumber:ac,config:E}),lc=Ss({BigNumber:ac,config:E}),fc=bs({BigNumber:ac,config:E}),pc=xs({BigNumber:ac,config:E}),mc=Cs({BigNumber:ac,config:E}),dc=ws({BigNumber:ac,config:E}),hc=cu({BigNumber:ac,config:E}),gc=eu({BigNumber:ac,config:E}),yc=bu({BigNumber:ac,config:E}),vc=uu({BigNumber:ac,config:E}),bc=we({}),xc=As({BigNumber:ac,config:E}),wc=Ms({BigNumber:ac,config:E}),Nc=js({BigNumber:ac,config:E}),Mc=Ae({Matrix:oc}),Ac=vs({BigNumber:ac,config:E}),Oc=se({BigNumber:ac,Complex:Xu,DenseMatrix:Mc,Fraction:bc}),Ec=Be({typed:Oc}),Sc=qe({typed:Oc}),Cc=ze({typed:Oc}),jc=Ue({typed:Oc}),kc=Ge({config:E,typed:Oc}),Ic=Ze({typed:Oc}),Tc=Ye({typed:Oc}),Bc=Ve({Complex:Xu,typed:Oc}),_c=et({typed:Oc}),Dc=rt({BigNumber:ac,config:E,typed:Oc}),qc=it({isInteger:Ec,typed:Oc}),Rc=ct({typed:Oc}),zc=ft({Complex:Xu,typed:Oc}),Fc=At({Complex:Xu,config:E,typed:Oc}),Uc=kt({typed:Oc}),Pc=Bt({BigNumber:ac,Fraction:bc,complex:Bc,typed:Oc}),Lc=Dt({typed:Oc}),Qc=Kt({typed:Oc}),Hc=er({typed:Oc}),Gc=rr({typed:Oc}),Jc=ir({typed:Oc}),Zc=gr({typed:Oc}),Wc=br({typed:Oc}),Yc=Ar({typed:Oc}),Kc=Xr({typed:Oc}),Vc=cn({typed:Oc}),$c=mn({typed:Oc}),Xc=mi({Complex:Xu,config:E,typed:Oc}),el=hi({BigNumber:ac,typed:Oc}),tl=yi({BigNumber:ac,Complex:Xu,config:E,typed:Oc}),rl=bi({BigNumber:ac,Complex:Xu,config:E,typed:Oc}),nl=wi({Complex:Xu,config:E,typed:Oc}),il=Mi({typed:Oc}),al=Oi({Complex:Xu,config:E,typed:Oc}),ol=Si({typed:Oc}),sl=ji({BigNumber:ac,typed:Oc}),ul=Ii({BigNumber:ac,typed:Oc}),cl=Bi({BigNumber:ac,typed:Oc}),ll=Di({typed:Oc}),fl=Ri({typed:Oc}),pl=Ro({typed:Oc}),ml=$o({config:E,typed:Oc}),dl=ts({config:E,typed:Oc}),hl=Es({BigNumber:ac,config:E}),gl=Oe({typed:Oc}),yl=Re({isNumeric:Sc,typed:Oc}),vl=Le({typed:Oc}),bl=We({typed:Oc}),xl=$e({Fraction:bc,typed:Oc}),wl=tt({typed:Oc}),Nl=ot({typed:Oc}),Ml=lt({typed:Oc}),Al=Ot({Complex:Xu,config:E,typed:Oc}),Ol=_t({Complex:Xu,config:E,typed:Oc}),El=tr({typed:Oc}),Sl=wr({typed:Oc}),Cl=on({isNaN:jc,isNumeric:Sc,typed:Oc}),jl=ln({typed:Oc}),kl=di({Complex:Xu,config:E,typed:Oc}),Il=vi({BigNumber:ac,typed:Oc}),Tl=Ni({typed:Oc}),Bl=Ei({typed:Oc}),_l=ki({BigNumber:ac,typed:Oc}),Dl=_i({typed:Oc}),ql=Uo({typed:Oc}),Rl=es({config:E,typed:Oc}),zl=Bs({}),Fl=De({typed:Oc}),Ul=Je({Matrix:oc,equalScalar:kc,typed:Oc}),Pl=Xe({DenseMatrix:Mc,Matrix:oc,SparseMatrix:Ul,typed:Oc}),Ll=st({BigNumber:ac,Complex:Xu,Fraction:bc,config:E,isNegative:Fl,matrix:Pl,typed:Oc,unaryMinus:wl}),Ql=bt({BigNumber:ac,DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),Hl=jt({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),Gl=Tt({BigNumber:ac,equalScalar:kc,matrix:Pl,typed:Oc}),Jl=zt({BigNumber:ac,config:E,matrix:Pl,typed:Oc}),Zl=Yt({equalScalar:kc,matrix:Pl,typed:Oc}),Wl=Xt({DenseMatrix:Mc,matrix:Pl,typed:Oc}),Yl=ar({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),Kl=sr({isInteger:Ec,matrix:Pl,typed:Oc}),Vl=fr({DenseMatrix:Mc,SparseMatrix:Ul,matrix:Pl,typed:Oc}),$l=Nr({BigNumber:ac,DenseMatrix:Mc,SparseMatrix:Ul,config:E,matrix:Pl,typed:Oc}),Xl=Er({BigNumber:ac,config:E,matrix:Pl,typed:Oc}),ef=Ir({isInteger:Ec,matrix:Pl,typed:Oc}),tf=Dr({matrix:Pl,config:E,typed:Oc}),rf=Gr({matrix:Pl,typed:Oc}),nf=$r({BigNumber:ac,config:E,matrix:Pl,typed:Oc}),af=pn({matrix:Pl,typed:Oc}),of=xn({BigNumber:ac,DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc,zeros:nf}),sf=In({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc,zeros:nf}),uf=Bn({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc,zeros:nf}),cf=Dn({BigNumber:ac,DenseMatrix:Mc,Fraction:bc,config:E,equalScalar:kc,matrix:Pl,typed:Oc}),lf=Fn({matrix:Pl,typed:Oc}),ff=Ln({DenseMatrix:Mc,config:E,matrix:Pl,typed:Oc}),pf=Hn({DenseMatrix:Mc,config:E,matrix:Pl,typed:Oc}),mf=Zn({DenseMatrix:Mc,config:E,equalScalar:kc,matrix:Pl,typed:Oc}),df=Kn({larger:pf,typed:Oc}),hf=$n({DenseMatrix:Mc,smaller:ff}),gf=ei({larger:pf,smaller:ff}),yf=fi({SparseMatrix:Ul,typed:Oc}),vf=gi({BigNumber:ac,Complex:Xu,config:E,typed:Oc}),bf=Ai({BigNumber:ac,DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),xf=Ti({BigNumber:ac,typed:Oc}),wf=Wi({DenseMatrix:Mc,SparseMatrix:Ul,addScalar:Nl,equalScalar:kc,matrix:Pl,typed:Oc}),Nf=$i({add:wf,matrix:Pl,typed:Oc}),Mf=as({addScalar:Nl,combinations:pl,isInteger:Ec,isNegative:Fl,isPositive:Cc,larger:pf,typed:Oc}),Af=Fe({typed:Oc}),Of=nt({typed:Oc}),Ef=mt({config:E,round:of,typed:Oc}),Sf=It({addScalar:Nl,equalScalar:kc,matrix:Pl,multiplyScalar:Uc,typed:Oc}),Cf=Ut({equalScalar:kc,matrix:Pl,multiplyScalar:Uc,typed:Oc}),jf=nr({typed:Oc}),kf=vr({matrix:Pl,typed:Oc}),If=Br({config:E,matrix:Pl}),Tf=qr({matrix:Pl,typed:Oc}),Bf=un({multiply:Sf,typed:Oc}),_f=gn({Complex:Xu,config:E,fraction:xl,identity:$l,matrix:Pl,multiply:Sf,number:Ic,typed:Oc}),Df=On({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,pow:_f,typed:Oc}),qf=Tn({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc,zeros:nf}),Rf=zn({compare:cf,typed:Oc}),zf=Pn({compareText:lf,isZero:Af,typed:Oc}),Ff=Gn({DenseMatrix:Mc,config:E,matrix:Pl,typed:Oc}),Uf=Wn({compare:cf,isNaN:jc,isNumeric:Sc,typed:Oc}),Pf=Vn({smaller:ff,typed:Oc}),Lf=ti({FibonacciHeap:gf,addScalar:Nl,equalScalar:kc}),Qf=xi({BigNumber:ac,Complex:Xu,config:E,typed:Oc}),Hf=qi({typed:Oc}),Gf=Gi({compareNatural:Rf,typed:Oc}),Jf=Ki({abs:Of,add:wf,conj:El,equalScalar:kc,larger:pf,matrix:Pl,multiply:Sf,pow:_f,smaller:ff,sqrt:Ol,typed:Oc}),Zf=_o({add:wf,compare:cf,multiply:Sf,partitionSelect:Uf,typed:Oc}),Wf=Lo({BigNumber:ac,Complex:Xu,config:E,multiplyScalar:Uc,pow:_f,typed:Oc}),Yf=Ke({BigNumber:ac,typed:Oc}),Kf=Mt({equalScalar:kc,matrix:Pl,typed:Oc}),Vf=Vt({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),$f=Mr({matrix:Pl,multiplyScalar:Uc,typed:Oc}),Xf=Kr({matrix:Pl,typed:Oc}),ep=dn({bignumber:Yf,fraction:xl,number:Ic}),tp=_n({equalScalar:kc,matrix:Pl,not:Jc,typed:Oc,zeros:nf}),rp=Qn({DenseMatrix:Mc,config:E,matrix:Pl,typed:Oc}),np=Yn({compare:cf,compareNatural:Rf,matrix:Pl,typed:Oc}),ip=Ci({BigNumber:ac,typed:Oc}),ap=Vi({add:wf,multiply:Sf,typed:Oc}),op=Co({bignumber:Yf,fraction:xl,add:wf,config:E,typed:Oc}),sp=Qo({gamma:Wf,typed:Oc}),up=Jo({factorial:sp,typed:Oc}),cp=ut({config:E,round:of,typed:Oc}),lp=qt({DenseMatrix:Mc,addScalar:Nl,equalScalar:kc,matrix:Pl,typed:Oc,unaryMinus:wl}),fp=lr({matrix:Pl,multiply:Sf,subtract:lp,typed:Oc}),pp=Vr({conj:El,transpose:Xf,typed:Oc}),mp=Un({DenseMatrix:Mc,equalScalar:kc,matrix:Pl,typed:Oc}),dp=Xn({ImmutableDenseMatrix:hf}),hp=zi({DenseMatrix:Mc,Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),gp=Ui({DenseMatrix:Mc,Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),yp=Li({Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),vp=Hi({Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),bp=Xi({Index:dp,typed:Oc}),xp=pt({Complex:Xu,ceil:cp,floor:Ef,typed:Oc}),wp=kr({bignumber:Yf,matrix:Pl,config:E,larger:pf,largerEq:Ff,smaller:ff,smallerEq:rp,typed:Oc}),Np=hn({numeric:ep,typed:Oc}),Mp=An({Complex:Xu,config:E,divideScalar:Np,typed:Oc}),Ap=Cn({DenseMatrix:Mc,divideScalar:Np,equalScalar:kc,matrix:Pl,multiplyScalar:Uc,subtract:lp,typed:Oc}),Op=Jn({equal:mp,typed:Oc}),Ep=Fi({DenseMatrix:Mc,Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),Sp=Qi({Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),Cp=Yi({abs:Of,addScalar:Nl,divideScalar:Np,isPositive:Cc,multiplyScalar:Uc,smaller:ff,sqrt:Ol,typed:Oc}),jp=Ga({DenseMatrix:Mc,Spa:Lf,SparseMatrix:Ul,abs:Of,addScalar:Nl,divideScalar:Np,equalScalar:kc,larger:pf,matrix:Pl,multiplyScalar:Uc,subtract:lp,typed:Oc,unaryMinus:wl}),kp=oo({SparseMatrix:Ul,abs:Of,add:wf,divideScalar:Np,larger:pf,largerEq:Ff,multiply:Sf,subtract:lp,transpose:Xf,typed:Oc}),Ip=xo({lup:jp,matrix:Pl,multiply:Sf,subtract:lp,typed:Oc,unaryMinus:wl}),Tp=Eo({abs:Of,addScalar:Nl,divideScalar:Np,multiplyScalar:Uc,sqrt:Ol,subtract:lp,typed:Oc,unaryMinus:wl}),Bp=rs({addScalar:Nl,combinations:pl,divideScalar:Np,factorial:sp,isInteger:Ec,isNegative:Fl,larger:pf,multiplyScalar:Uc,pow:_f,subtract:lp,typed:Oc}),_p=is({addScalar:Nl,combinations:pl,divideScalar:Np,isInteger:Ec,isNegative:Fl,multiplyScalar:Uc,typed:Oc}),Dp=or({DenseMatrix:Mc,matrix:Pl,typed:Oc}),qp=_r({Index:dp,matrix:Pl,range:wp,typed:Oc}),Rp=En({DenseMatrix:Mc,divideScalar:Np,equalScalar:kc,matrix:Pl,typed:Oc}),zp=ci({BigNumber:ac,Complex:Xu,Fraction:bc,abs:Of,addScalar:Nl,config:E,divideScalar:Np,equal:mp,fix:xp,format:Vc,isNumeric:Sc,multiplyScalar:Uc,number:Ic,pow:_f,round:of,subtract:lp}),Fp=pi({Unit:zp,typed:Oc}),Up=Ji({Index:dp,concat:Kl,setDifference:Ep,size:tf,subset:rf,typed:Oc}),Pp=Za({addScalar:Nl,complex:Bc,conj:El,divideScalar:Np,equal:mp,identity:$l,isZero:Af,matrix:Pl,multiplyScalar:Uc,sign:Pc,sqrt:Ol,subtract:lp,typed:Oc,unaryMinus:wl,zeros:nf}),Lp=wo({abs:Of,addScalar:Nl,det:Ip,divideScalar:Np,identity:$l,matrix:Pl,multiply:Sf,typed:Oc,unaryMinus:wl}),Qp=Mo({abs:Of,add:wf,identity:$l,inv:Lp,multiply:Sf,typed:Oc}),Hp=Oo({divideScalar:Np,equalScalar:kc,inv:Lp,matrix:Pl,multiply:Sf,typed:Oc}),Gp=jo({add:wf,divide:Hp,typed:Oc}),Jp=To({add:wf,apply:qc,divide:Hp,isNaN:jc,multiply:Sf,subtract:lp,typed:Oc}),Zp=Do({sqrt:Ol,typed:Oc,variance:Jp}),Wp=Go({add:wf,divide:Hp,factorial:sp,isInteger:Ec,isPositive:Cc,multiply:Sf,typed:Oc}),Yp=lu({BigNumber:ac,Unit:zp,config:E}),Kp=Hs({BigNumber:ac,Unit:zp,config:E}),Vp=pu({BigNumber:ac,Unit:zp,config:E}),$p=Gs({BigNumber:ac,Unit:zp,config:E}),Xp=nu({BigNumber:ac,Unit:zp,config:E}),em=$s({BigNumber:ac,Unit:zp,config:E}),tm=mu({BigNumber:ac,Unit:zp,config:E}),rm=du({BigNumber:ac,Unit:zp,config:E}),nm=qs({BigNumber:ac,Unit:zp,config:E}),im=tu({BigNumber:ac,Unit:zp,config:E}),am=Ys({BigNumber:ac,Unit:zp,config:E}),om=Fs({BigNumber:ac,Unit:zp,config:E}),sm=Mu({BigNumber:ac,Unit:zp,config:E}),um=yu({BigNumber:ac,Unit:zp,config:E}),cm=iu({BigNumber:ac,Unit:zp,config:E}),lm=ju({BigNumber:ac,Unit:zp,config:E}),fm=Eu({BigNumber:ac,Unit:zp,config:E}),pm=ku({BigNumber:ac,Unit:zp,config:E}),mm=ru({BigNumber:ac,Unit:zp,config:E}),dm=zs({BigNumber:ac,Unit:zp,config:E}),hm=xu({BigNumber:ac,Unit:zp,config:E}),gm=wu({BigNumber:ac,Unit:zp,config:E}),ym=Ps({BigNumber:ac,Unit:zp,config:E}),vm=cr({Index:dp,matrix:Pl,range:wp,typed:Oc}),bm=jn({DenseMatrix:Mc,divideScalar:Np,equalScalar:kc,matrix:Pl,multiplyScalar:Uc,subtract:lp,typed:Oc}),xm=Pi({DenseMatrix:Mc,Index:dp,compareNatural:Rf,size:tf,subset:rf,typed:Oc}),wm=uo({DenseMatrix:Mc,lsolve:Ap,lup:jp,matrix:Pl,slu:kp,typed:Oc,usolve:bm}),Nm=No({abs:Of,add:wf,addScalar:Nl,atan:il,bignumber:Yf,cos:Bl,equal:mp,inv:Lp,matrix:Pl,multiply:Sf,multiplyScalar:Uc,sin:Dl,subtract:lp,typed:Oc}),Mm=So({abs:Of,add:wf,addScalar:Nl,config:E,divideScalar:Np,equalScalar:kc,matrix:Pl,multiply:Sf,multiplyScalar:Uc,smaller:ff,subtract:lp,typed:Oc}),Am=ns({addScalar:Nl,isInteger:Ec,isNegative:Fl,stirlingS2:Bp,typed:Oc}),Om=fu({BigNumber:ac,Unit:zp,config:E}),Em=Vs({BigNumber:ac,Unit:zp,config:E}),Sm=Us({BigNumber:ac,Unit:zp,config:E}),Cm=Xs({BigNumber:ac,Unit:zp,config:E}),jm=Ou({BigNumber:ac,Unit:zp,config:E}),km=hu({BigNumber:ac,Unit:zp,config:E}),Im=Au({BigNumber:ac,Unit:zp,config:E}),Tm=Ws({BigNumber:ac,Unit:zp,config:E}),Bm=Su({BigNumber:ac,Unit:zp,config:E}),_m=au({BigNumber:ac,Unit:zp,config:E}),Dm=Ds({BigNumber:ac,Unit:zp,config:E}),qm=Nu({BigNumber:ac,Unit:zp,config:E}),Rm=Nn({Complex:Xu,config:E,divideScalar:Np,typed:Oc}),zm=li({Unit:zp,typed:Oc}),Fm=Ao({abs:Of,add:wf,identity:$l,inv:Lp,max:df,multiply:Sf,size:tf,sqrt:Ol,subtract:lp,typed:Oc}),Um=Ho({divide:Hp,dotDivide:Rp,isNumeric:Sc,log:Rm,matrix:Pl,multiply:Sf,sum:op,typed:Oc}),Pm=Ks({BigNumber:ac,Unit:zp,config:E}),Lm=Qs({BigNumber:ac,Unit:zp,config:E}),Qm=Js({BigNumber:ac,Unit:zp,config:E}),Hm=vu({BigNumber:ac,Unit:zp,config:E}),Gm=Cu({BigNumber:ac,Unit:zp,config:E}),Jm=su({BigNumber:ac,Unit:zp,config:E}),Zm=Mn({Complex:Xu,config:E,divideScalar:Np,log:Rm,typed:Oc}),Wm=ko({add:wf,compare:cf,divide:Hp,partitionSelect:Uf,typed:Oc}),Ym=gu({BigNumber:ac,Unit:zp,config:E}),Km=Rs({BigNumber:ac,Unit:zp,config:E}),Vm=Zi({Index:dp,concat:Kl,setIntersect:xm,setSymDifference:Up,size:tf,subset:rf,typed:Oc}),$m=Zs({BigNumber:ac,Unit:zp,config:E}),Xm=Ls({BigNumber:ac,Unit:zp,config:E}),ed=Io({abs:Of,map:Yc,median:Wm,subtract:lp,typed:Oc}),td=ou({BigNumber:ac,Unit:zp,config:E});function rd(){return(rd=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:t.fn;if(re(a,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(a));var s=p(t)?r.expression.transform:r,c=a in r.expression.transform,l=Object(w.f)(s,a)?s[a]:void 0,m=function(){var n={};t.dependencies.map(ae).forEach(function(e){if(re(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=r:"mathWithTransform"===e?n.mathWithTransform=r.expression.mathWithTransform:"classes"===e?n.classes=r:n[e]=r[e]});var o=t(n);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===l||i.override)return o;if(u(l)&&u(o))return e(l,o);if(i.silent)return l;throw new Error('Cannot import "'+a+'": already exists')};t.meta&&!1===t.meta.lazy?(s[a]=m(),l&&c?o(a):(p(t)||f(t))&&Object(w.h)(r.expression.mathWithTransform,a,function(){return s[a]})):(Object(w.h)(s,a,m),l&&c?o(a):(p(t)||f(t))&&Object(w.h)(r.expression.mathWithTransform,a,function(){return s[a]})),n[a]=t,r.emit("import",a,m)}function u(e){return"function"==typeof e&&"object"===Dd(e.signatures)}function c(e){return!Object(w.f)(m,e)}function l(e){return void 0===e.path&&!Object(w.f)(m,e.name)}function f(e){return!(-1!==e.fn.indexOf(".")||Object(w.f)(m,e.fn)||e.meta&&e.meta.isClass)}function p(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var m={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(a,c){var f=arguments.length;if(1!==f&&2!==f)throw new Tr("import",f,1,2);c||(c={});var m,d={};for(var h in function i(a,s,f){if(Object(w.g)(s))!function(i,a){if(Pe("Factories of type { name, factory } are deprecated since v6. Please create your factory functions using the math.factory function."),"string"==typeof i.name){var s=i.name,c=s in r.expression.transform,f=i.path?Object(w.k)(r,i.path):r,p=Object(w.f)(f,s)?f[s]:void 0,m=function(){var r=t(i);if(r&&"function"==typeof r.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(u(p)&&u(r))return a.override||(r=e(p,r)),r;if(void 0===p||a.override)return r;if(a.silent)return p;throw new Error('Cannot import "'+s+'": already exists')};!1!==i.lazy?(Object(w.h)(f,s,m),c?o(s):("expression.transform"===i.path||l(i))&&Object(w.h)(r.expression.mathWithTransform,s,m)):(f[s]=m(),c?o(s):("expression.transform"===i.path||l(i))&&(r.expression.mathWithTransform[s]=m()));var d=i.path?i.path+"."+i.name:i.name;n[d]=i,r.emit("import",s,m,i.path)}else t(i)}(s,c);else if(Array.isArray(s))s.forEach(function(e){return i(a,e)});else if("object"===Dd(s))for(var m in s)Object(w.f)(s,m)&&i(a,s[m],m);else if(ie(s)||void 0!==f){var d=ie(s)?p(s)?s.fn+".transform":s.fn:f;if(Object(w.f)(a,d)&&a[d]!==s&&!c.silent)throw new Error('Cannot import "'+d+'" twice');a[d]=s}else if(!c.silent)throw new TypeError("Factory, Object, or Array expected")}(d,a),d)if(Object(w.f)(d,h)){var g=d[h];if(ie(g))s(g,c);else if("function"==typeof(m=g)||"number"==typeof m||"string"==typeof m||"boolean"==typeof m||null===m||Object(S.L)(m)||Object(S.j)(m)||Object(S.e)(m)||Object(S.o)(m)||Object(S.v)(m)||Array.isArray(m))i(h,g,c);else if(!c.silent)throw new TypeError("Factory, Object, or Array expected")}}}function Rd(){return(Rd=Object.assign||function(e){for(var t=1;t{b}: {c} ({d}%)"},series:[{name:"",type:"pie",radius:["50%","70%"],avoidLabelOverlap:!1,label:{normal:{show:!1,position:"center"}},labelLine:{normal:{show:!1}}}]},this.options);t.setOption(r)}}},mounted:function(){this.draw()},updated:function(){this.draw()}},$d={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"ring-chart"},[t("div",{ref:"chart",staticClass:"chart"}),this._v(" "),t("div",{staticClass:"description"},[this._t("default")],2)])},staticRenderFns:[]};var Xd=r("VU/8")(Vd,$d,!1,function(e){r("vLdK")},"data-v-1fe1d933",null).exports,eh={data:function(){return{errorCount:0,errorRatio:0,warnCount:0,warnRatio:0,normalCount:0,normalRatio:0,total:0}},components:{RingChart:Xd},computed:{options:function(){return{series:[{name:"整体分布",data:[{value:this.errorCount,name:"异常",itemStyle:{color:"rgb(243, 74, 74)"}},{value:this.warnCount,name:"告警",itemStyle:{color:"#FE9835"}},{value:this.normalCount,name:"正常",itemStyle:{color:"#27C093"}}]}]}}},inject:["setting"],watch:{"setting.reflushTimes":function(){this.setting.flag&&this.getData()},"setting.flag":function(e){e&&this.getData()}},filters:{formatRadio:function(e){return Pd(e+" * 100").toFixed(2)}},methods:{getData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.get("/device/stats-overall");case 2:r=t.sent,Kd()(e.$data,r.data.body);case 4:case"end":return t.stop()}},t,e)}))()}}},th={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"OverallDistribution"}},[r("div",{staticClass:"distribution-chart"},[r("ring-chart",{staticClass:"chart",attrs:{options:e.options}},[r("div",{staticClass:"value"},[e._v(e._s(e.total))]),e._v(" "),r("div",{staticClass:"title"},[e._v("监控设备总数")])])],1),e._v(" "),r("div",{staticClass:"distribution-list"},[r("div",{staticClass:"part error"},[e._m(0),e._v(" "),r("div",{staticClass:"part-value"},[r("div",{staticClass:"count"},[e._v("\n "+e._s(e.errorCount)+"\n ")]),e._v(" "),r("div",{staticClass:"radio"},[e._v("\n 占比"+e._s(e._f("formatRadio")(e.errorRatio))+"%\n ")])])]),e._v(" "),r("div",{staticClass:"part warn"},[e._m(1),e._v(" "),r("div",{staticClass:"part-value"},[r("div",{staticClass:"count"},[e._v("\n "+e._s(e.warnCount)+"\n ")]),e._v(" "),r("div",{staticClass:"radio"},[e._v("\n 占比"+e._s(e._f("formatRadio")(e.warnRatio))+"%\n ")])])]),e._v(" "),r("div",{staticClass:"part normal"},[e._m(2),e._v(" "),r("div",{staticClass:"part-value"},[r("div",{staticClass:"count"},[e._v("\n "+e._s(e.normalCount)+"\n ")]),e._v(" "),r("div",{staticClass:"radio"},[e._v("\n 占比"+e._s(e._f("formatRadio")(e.normalRatio))+"%\n ")])])])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"part-title"},[t("span",[this._v("异常")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"part-title"},[t("span",[this._v("告警")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"part-title"},[t("span",[this._v("正常")])])}]};var rh=r("VU/8")(eh,th,!1,function(e){r("D+q9")},"data-v-08d66cc0",null).exports,nh={data:function(){return{dimension:"type",data:[]}},inject:["setting"],components:{RingChart:Xd},watch:{dimension:function(){this.getData()},"setting.reflushTimes":function(){this.setting.flag&&this.getData()},"setting.flag":function(e){e&&this.getData()}},filters:{getOptions:function(e){return{tooltip:{confine:!0},title:{text:e.dimensionName||"-",textStyle:{fontWeight:"normal",fontSize:14},bottom:0,left:"center"},series:[{name:e.dimensionName||"-",data:[{value:e.errorCount,name:"异常",itemStyle:{color:"rgb(243, 74, 74)"}},{value:e.warnCount,name:"告警",itemStyle:{color:"#FE9835"}},{value:e.normalCount,name:"正常",itemStyle:{color:"#27C093"}}]}]}}},methods:{getData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.get("/device/stats-dimension/"+e.dimension);case 2:r=t.sent,e.data=r.data.body;case 4:case"end":return t.stop()}},t,e)}))()}}},ih={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"DrillingDistribution"}},[r("div",{staticClass:"dimension-box"},[r("span",{staticClass:"title"},[e._v("下钻维度:")]),e._v(" "),r("el-select",{staticClass:"dimension",model:{value:e.dimension,callback:function(t){e.dimension=t},expression:"dimension"}},[r("el-option",{attrs:{label:"设备类型",value:"type"}}),e._v(" "),r("el-option",{attrs:{label:"系统版本",value:"version"}})],1)],1),e._v(" "),r("div",{staticClass:"charts"},e._l(e.data,function(t,n){return r("ring-chart",{key:n+e.dimension,staticClass:"dimension-chart",attrs:{options:e._f("getOptions")(t)}},[r("span",{staticClass:"total"},[e._v(e._s(t.total))])])}),1),e._v(" "),r("footer")])},staticRenderFns:[]};var ah=r("VU/8")(nh,ih,!1,function(e){r("Hx9U")},"data-v-7a2d8d65",null).exports,oh=r("Dd8w"),sh=r.n(oh),uh={props:["data"],data:function(){return{tableHeight:0,tableHeader:[{prop:"warnningBegin",label:"告警时间"},{prop:"deviceTypeName",label:"设备类型"},{prop:"deviceCode",label:"设备编号"},{prop:"state",label:"告警类型"},{prop:"warnninghours",label:"告警时长"}]}},computed:{tableData:function(){return Qd(this.data).filter(function(e){return e.state.endsWith("WARN")}).sort(function(e,t){return c()(t.warnningBegin,"YYYY-MM-DD HH:mm:ss").unix()-c()(e.warnningBegin,"YYYY-MM-DD HH:mm:ss").unix()}).map(function(e){var t=sh()({},e);return t.state=e.state.split(",").map(function(e){return Ld(e)}).join(),t.warnninghours=(e.warnninghours||"-")+"小时",t})}},mounted:function(){this.initStyle()},methods:{initStyle:function(){var e=this.$refs.container,t=getComputedStyle(e),r=t.height,n=t.paddingTop,i=t.paddingBottom,a=+Pd(""+(r.replace("px","")-n.replace("px","")-i.replace("px","")));this.tableHeight=a}}},ch={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{ref:"container",attrs:{id:"AlarmDevicePrompt"}},[this.tableHeight?t("el-table",{attrs:{height:this.tableHeight,data:this.tableData}},this._l(this.tableHeader,function(e){return t("el-table-column",{key:e.label,attrs:{"show-overflow-tooltip":"",label:e.label,prop:e.prop}})}),1):this._e()],1)},staticRenderFns:[]};var lh=r("VU/8")(uh,ch,!1,function(e){r("IjAv")},"data-v-ad75825a",null).exports,fh={data:function(){return{dates:7,data:[]}},inject:["setting"],watch:{dates:function(){this.getData()},"setting.reflushTimes":function(){this.setting.flag&&this.getData()},"setting.flag":function(e){e&&this.getData()}},methods:{getData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.get("/device/warning-distrib/"+e.dates);case 2:r=t.sent,e.data=r.data.body,e.draw();case 5:case"end":return t.stop()}},t,e)}))()},draw:function(){var e=this.data,t=this.$refs.chart;if(t){var r=Object(p.init)(t);r.clear();var n={tooltip:{trigger:"item",formatter:"发生{b}次告警
设备数:{c}"},xAxis:{type:"category",data:e.map(function(e){return e.freqScope}),axisTick:{show:!1},axisLine:{lineStyle:{color:"#FE9835"}}},yAxis:{show:!1},series:[{data:e.map(function(e){return e.count||0}),type:"bar",itemStyle:{color:"#FE9835"}}]};r.setOption(n)}}}},ph={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"AlarmDeviceDistributed"}},[r("span",{staticClass:"chart-header"},[r("span",[r("span",{staticClass:"before"},[e._v("过去")]),e._v(" "),r("el-radio-group",{attrs:{size:"small"},model:{value:e.dates,callback:function(t){e.dates=t},expression:"dates"}},[r("el-radio-button",{attrs:{label:7}},[e._v("7天")]),e._v(" "),r("el-radio-button",{attrs:{label:14}},[e._v("14天")]),e._v(" "),r("el-radio-button",{attrs:{label:31}},[e._v("31天")])],1)],1)]),e._v(" "),r("span",{staticClass:"chart-box"},[r("div",{ref:"chart",staticClass:"chart-target"})])])},staticRenderFns:[]};var mh=r("VU/8")(fh,ph,!1,function(e){r("z5W3")},"data-v-4c1b1e8d",null).exports,dh=r("c/Tr"),hh=r.n(dh),gh={data:function(){return{overviewType:"cpuRatio",data:[]}},inject:["setting"],methods:{draw:function(){var e=this.$refs,t=this.data,r=this.overviewType,n=e.chart,i=32,a=12;t.length>300&&t.length<600?(i=40,a=15):t.length<100?(i=24,a=9):t.length>=600&&(i=50,a=(a=Math.ceil(t.length/50))<20?20:a);var o=hh()(Array(i),function(e,t){return t}),s=hh()(Array(a),function(e,t){return"s"+t}).reverse(),u=t.map(function(e,t){return[t%i,"s"+Math.floor(t/i),e]});if(n){var c=Object(p.init)(n);c.clear();var l={tooltip:{position:"top",formatter:function(e){var t=u.find(function(t){return t[0]===e.data[0]&&t[1]===e.data[1]}),n="CPU";switch(r){case"dskRatio":n="硬盘";break;case"memRatio":n="内存"}var i=(+e.value[2]).toFixed(2);return("NaN"===i||i<0)&&(i="-"),"\n 设备编号: "+t[2].deviceCode+"
\n "+n+"使用率: "+i+"%\n "}},animation:!1,grid:{show:!0,backgroundColor:"#f8f8f8",borderColor:"transparent"},xAxis:{type:"category",data:o,splitLine:{show:!0,lineStyle:{color:["#fff"],width:2}},axisLine:{show:!1},axisLabel:{show:!1},axisTick:{show:!1}},yAxis:{type:"category",data:s,splitLine:{show:!0,lineStyle:{color:["#fff"],width:2}},axisLine:{show:!1},axisLabel:{show:!1},axisTick:{show:!1}},visualMap:{type:"piecewise",calculable:!0,orient:"horizontal",right:"10%",text:[],top:20,max:100,inRange:{color:["#FDE6E5","#F9ACAB","#F35A58","#9E3B39","#882B2B"]}},series:[{name:"Punch Card",type:"heatmap",data:u.map(function(e){var t=Object(Fd.cloneDeep)(e);return t[2]=t[2][r]||-1,t}),itemStyle:{borderWidth:2,borderColor:"#fff",emphasis:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}],dataZoom:[{type:"slider",show:t.length>1e3,yAxisIndex:[0],left:"93%",startValue:"s0",endValue:"s20",zoomLock:!0,throttle:200,handleSize:0,width:10,showDetail:!1}]};c.setOption(l)}},getData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.post("/device/page",{current:1,size:1e6});case 2:r=t.sent,e.data=r.data.body.records,setTimeout(function(){e.draw()});case 5:case"end":return t.stop()}},t,e)}))()}},watch:{overviewType:function(){this.getData()},"setting.reflushTimes":function(){this.setting.flag&&this.getData()},"setting.flag":function(e){e&&this.getData()}}},yh={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"SystemHealthOverview"}},[r("div",{staticClass:"type-box"},[r("span",{staticClass:"title"},[e._v("概览指标:")]),e._v(" "),r("el-select",{staticClass:"type",model:{value:e.overviewType,callback:function(t){e.overviewType=t},expression:"overviewType"}},[r("el-option",{attrs:{label:"cpu占用率",value:"cpuRatio"}}),e._v(" "),r("el-option",{attrs:{label:"硬盘占用率",value:"dskRatio"}}),e._v(" "),r("el-option",{attrs:{label:"内存占用率",value:"memRatio"}})],1)],1),e._v(" "),r("div",{ref:"chart",staticClass:"chart-target"})])},staticRenderFns:[]};var vh={data:function(){return{errorCount:0,warnCount:0,data:[]}},inject:["setting"],watch:{"setting.reflushTimes":function(){this.setting.flag&&this.getData()},"setting.flag":function(e){e&&this.getData()}},components:{TodayData:Jd,Box:Wd,OverallDistribution:rh,DrillingDistribution:ah,AlarmDevicePrompt:lh,AlarmDeviceDistributed:mh,SystemHealthOverview:r("VU/8")(gh,yh,!1,function(e){r("4V5y")},"data-v-eeb50702",null).exports},methods:{getData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.get("/device/list");case 2:r=t.sent,e.data=r.data.body;case 4:case"end":return t.stop()}},t,e)}))()}}},bh={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"OverallMonitor"}},[n("div",{staticClass:"today-data-container"},[n("today-data",{attrs:{title:"异常",value:e.errorCount,logo:r("2ICW")},on:{"update:value":function(t){e.errorCount=t}}}),e._v(" "),n("today-data",{attrs:{title:"告警",value:e.warnCount,logo:r("KAAS")},on:{"update:value":function(t){e.warnCount=t}}})],1),e._v(" "),n("div",{staticClass:"device-work-container"},[n("box",{staticClass:"all",attrs:{title:"设备工作状态整体分布"}},[n("template",{slot:"operating"},[n("div",{staticClass:"legend"},[n("span",{staticClass:"legend-box"},[n("span",{staticClass:"block error"}),e._v(" "),n("span",{staticClass:"title"},[e._v("异常")])]),e._v(" "),n("span",{staticClass:"legend-box"},[n("span",{staticClass:"block warn"}),e._v(" "),n("span",{staticClass:"title"},[e._v("告警")])]),e._v(" "),n("span",{staticClass:"legend-box"},[n("span",{staticClass:"block normal"}),e._v(" "),n("span",{staticClass:"title"},[e._v("正常")])])])]),e._v(" "),n("overall-distribution")],2),e._v(" "),n("box",{staticClass:"drill-down",attrs:{title:"设备工作状态下钻分布"}},[n("drilling-distribution")],1)],1),e._v(" "),n("div",{staticClass:"alarm-device-container"},[n("box",{staticClass:"prompt",attrs:{title:"告警设备提示",description:"仅显示最近发生的20条告警提示"}},[n("alarm-device-prompt",{attrs:{data:e.data}})],1),e._v(" "),n("box",{staticClass:"equipment-distribution",attrs:{title:"频繁告警设备分布"}},[n("alarm-device-distributed")],1)],1),e._v(" "),n("box",{staticClass:"system-health-overview",attrs:{title:"系统运行状况"}},[n("system-health-overview")],1)],1)},staticRenderFns:[]};var xh=r("VU/8")(vh,bh,!1,function(e){r("h6SL")},"data-v-51f4d41c",null).exports,wh=r("mvHQ"),Nh=r.n(wh),Mh=r("//Fk"),Ah=r.n(Mh),Oh={data:function(){return{searchRules:{current:1,ascColums:[],descColums:[],params:{},records:[{}],search:"",size:10},data:[],total:0,loading:!1,tableHeader:[{label:"设备编号",prop:"deviceCode"},{label:"设备名称",prop:"deviceName"},{label:"设备类型",prop:"deviceTypeName",columnKey:"deviceTypeIds",filters:[]},{label:"系统版本",prop:"deviceModel",columnKey:"deviceModels",filters:[]},{label:"工作状态",prop:"state",columnKey:"states",filters:[{value:"NORMAL",text:"正常"},{value:"ERROR",text:"异常"},{value:"WARN",text:"告警"}]},{label:"CPU使用率",prop:"cpuRatio",sortable:!0},{label:"异常次数",prop:"errorFreq",sortable:!0},{label:"告警次数",prop:"warningFreq",sortable:!0},{label:"内存使用率",prop:"memRatio",sortable:!0},{label:"硬盘使用率",prop:"dskRatio",sortable:!0}],tableHeaderShow:[]}},inject:["setting"],methods:{sortChange:function(e){var t=[],r=[];switch(e.order){case"descending":r.push(e.prop);break;case"ascending":t.push(e.prop)}this.searchRules=sh()({},this.searchRules,{current:1,ascColums:t,descColums:r}),this.getData()},getData:function(){var e=this;return s()(a.a.mark(function t(){var r,n,i,o;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=!0,t.next=3,y.post("/device/page",e.searchRules).finally(function(){return e.loading=!1});case 3:r=t.sent,n=r.data.body,i=n.records,o=n.total,e.data=i,e.total=o;case 7:case"end":return t.stop()}},t,e)}))()},initData:function(){var e=this;return s()(a.a.mark(function t(){var r;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ah.a.all([y.get("/deviceType/running-list"),y.get("/device/version-list")]);case 2:r=t.sent,e.tableHeader.find(function(e){return"deviceTypeName"===e.prop}).filters=r[0].data.body.map(function(e){return e.value=e.id,e.text=e.typeName,e}),e.tableHeader.find(function(e){return"deviceModel"===e.prop}).filters=r[1].data.body.map(function(e){return{value:e,text:e}});case 5:case"end":return t.stop()}},t,e)}))()},filterChange:function(e){this.searchRules.params=sh()({},this.searchRules.params,e)}},watch:{"setting.reflushTimes":function(){this.getData()},"setting.flag":function(){this.getData()},searchRules:{handler:function(e){sessionStorage.setItem("deviceSearchRules",Nh()(e))},deep:!0},"searchRules.current":function(){this.getData()},"searchRules.params":function(){this.getData()},tableHeaderSelector:function(e){sessionStorage.setItem("deviceTableHeaderShow",e.join())}},mounted:function(){var e=sessionStorage.getItem("deviceSearchRules");e&&(this.searchRules=JSON.parse(e)),this.tableHeaderShow=this.tableHeader.slice(0,8);var t=sessionStorage.getItem("deviceTableHeaderShow");t&&(this.tableHeaderShow=this.tableHeader.filter(function(e){return t.split(",").includes(e.prop)})),this.initData()},computed:{tableData:function(){var e=Qd(Object(Fd.cloneDeep)(this.data));return e.forEach(function(e){e.dskRatio+="%",e.memRatio+="%",e.cpuRatio+="%",e.errorFreq+="次",e.warningFreq+="次",e.state=e.state.split(",").map(function(e){return Ld(e)}).join()}),e},getFilteredValue:function(){var e=this;return function(t){return e.searchRules.params[t]}},tableHeaderSelector:{get:function(){return this.tableHeaderShow.map(function(e){return e.prop})},set:function(e){this.tableHeaderShow=this.tableHeader.filter(function(t){return e.includes(t.prop)})}},start:function(){var e=this.searchRules;return(e.current-1)*e.size+1},end:function(){var e=this.searchRules,t=e.current,r=e.size;return t*r>this.total?this.total:t*r}}},Eh={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{attrs:{id:"IndividualMonitor"}},[r("div",{staticClass:"equipment-monitoring"},[r("header",{staticClass:"equipment-title"},[e._v("\n 个体监控\n ")]),e._v(" "),r("div",{staticClass:"content"},[r("div",{staticClass:"search-box"},[r("el-input",{staticClass:"search",attrs:{placeholder:"请输入设备编号或设备名称",clearable:""},model:{value:e.searchRules.search,callback:function(t){e.$set(e.searchRules,"search",t)},expression:"searchRules.search"}},[r("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.getData},slot:"append"})],1),e._v(" "),r("div",{staticClass:"label-select"},[r("el-select",{attrs:{multiple:"","collapse-tags":""},model:{value:e.tableHeaderSelector,callback:function(t){e.tableHeaderSelector=t},expression:"tableHeaderSelector"}},e._l(e.tableHeader.slice(4),function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.prop}})}),1)],1)],1),e._v(" "),r("div",{ref:"container",staticClass:"table-box"},[r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{height:"auto",data:e.tableData},on:{"sort-change":e.sortChange,"filter-change":e.filterChange}},e._l(e.tableHeaderShow,function(t){return r("el-table-column",{key:t.label,attrs:{"show-overflow-tooltip":"",label:t.label,prop:t.prop,sortable:t.sortable,filters:t.filters,"filter-method":e.filterMethod,"column-key":t.columnKey,"filtered-value":e.getFilteredValue(t.columnKey)}})}),1),e._v(" "),r("footer",[r("div",{staticClass:"now"},[e._v("\n 当前显示第"+e._s(e.start)+" - "+e._s(e.end)+"条\n ")]),e._v(" "),r("el-pagination",{attrs:{layout:"total, prev, pager, next","page-size":e.searchRules.size,"current-page":e.searchRules.current,total:e.total},on:{"update:pageSize":function(t){return e.$set(e.searchRules,"size",t)},"update:page-size":function(t){return e.$set(e.searchRules,"size",t)},"update:currentPage":function(t){return e.$set(e.searchRules,"current",t)},"update:current-page":function(t){return e.$set(e.searchRules,"current",t)}}})],1)],1)])])])},staticRenderFns:[]};var Sh={name:"monitor",data:function(){return{setting:{reflushTimes:0,flag:!0}}},provide:function(){return{setting:this.setting}},components:{OverallMonitor:xh,IndividualMonitor:r("VU/8")(Oh,Eh,!1,function(e){r("ZKZJ")},"data-v-b1c32450",null).exports},mounted:function(){var e=this;this.setting.flag=!this.$route.query.individual,this.$nextTick(function(){e.setting.reflushTimes++}),setInterval(function(){e.setting.reflushTimes++},24e4)},beforeRouteUpdate:function(e,t,r){this.setting.flag=Boolean(this.$route.query.individual),r()}},Ch={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"Device"}},[n("div",{staticClass:"kunlun-header"},[n("span",[e._v("设备监控")]),e._v(" "),n("img",{attrs:{src:r(e.setting.flag?"1aK/":"CF6e"),alt:"整体监控"},on:{click:function(t){return e.$router.push("/res/device/monitor")}}}),e._v(" "),n("img",{attrs:{src:r(e.setting.flag?"FPcK":"lj1F"),alt:"个体监控"},on:{click:function(t){return e.$router.push("/res/device/monitor?individual=1")}}})]),e._v(" "),n("section",[n("overall-monitor",{directives:[{name:"show",rawName:"v-show",value:e.setting.flag,expression:"setting.flag"}]}),e._v(" "),n("individual-monitor",{directives:[{name:"show",rawName:"v-show",value:!e.setting.flag,expression:"!setting.flag"}]})],1),e._v(" "),n("footer",{staticClass:"content-footer"})])},staticRenderFns:[]};var jh=r("VU/8")(Sh,Ch,!1,function(e){r("HopX")},"data-v-5ed05adb",null);t.default=jh.exports},lj1F:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAGYklEQVR4Xu3dsZFUWRQE0Q8COLExtmIr4MQqzDqAUkrFr7sHuSLe7UxS6+j58vv7x+dz4N8///78cuBj+AgvI/BFIC8z4pxXERDIq3Q45m0EBPI2I+55FQGBvEqHY95GQCBvM+KeVxEQyKt0OOZtBATyNiPueRUBgbxKh2PeRkAgbzPinlcREMirdDjmbQQE8jYj7nkVAYEEOn59+/gRzE0PEBBIIPHK99aCj/y/nwok+C8gkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRf/vhuK/P8/nnefwB0YDj0lQgS7bcWicgkDpyDy4REMiSLbfWCQikjtyDSwQEsmTLrXUCAqkj9+ASAYEs2XJrnYBA6sg9uERAIEu23FonIJA6cg8uERDIki231gkIpI7cg0sEfMluyZZb6wQEUkfuwSUCAlmy5dY6AYHUkXtwiYBAlmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSB25B5cICGTJllvrBARSR+7BJQICWbLl1joBgdSRe3CJgECWbLm1TkAgdeQeXCIgkCVbbq0TEEgduQeXCAhkyZZb6wT8smIduQeXCAhkyZZb6wQEUkfuwSUCAlmy5dY6AYHUkXtwiYBAlmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGBBMh/ffv4EcxNDxAQSCDx9/ePz2BueoCAQAKJAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQ+bcfjvv6PJ9/nsdfCw44Lk0FsmTLrXUCAqkj9+ASAYEs2XJrnYBA6sg9uERAIEu23FonIJA6cg8uERDIki231gkIpI7cg0sEBLJky611AgKpI/fgEgGBLNlya52AQOrIPbhEwJfslmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSB25B5cICGTJllvrBARSR+7BJQICWbLl1joBgdSRe3CJgECWbLm1TkAgdeQeXCIgkCVbbq0TEEgduQeXCAhkyZZb6wQEUkfuwSUCAlmy5dY6AYHUkXtwiYBAlmy5tU7ALyvWkXtwiYBAlmy5tU5AIHXkHlwiIJAlW26tExBIHbkHlwgIZMmWW+sEBFJH7sElAgJZsuXWOgGB1JF7cImAQJZsubVOQCB15B5cIiCQJVturRMQSID817ePH8Hc9AABgQQSf3//+AzmpgcICCSQKJAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkQIJYB2ZCiQQKZAA1pGpQAKRAglgHZkKJBApkADWkalAApECCWAdmQokECmQANaRqUACkX/74bivz/P553n8teCA49JUIEu23FonIJA6cg8uERDIki231gkIpI7cg0sEBLJky611AgKpI/fgEgGBLNlya52AQOrIPbhEQCBLttxaJyCQOnIPLhEQyJItt9YJCKSO3INLBP4D0On6USqfdZgAAAAASUVORK5CYII="},on7W:function(e,t,r){"use strict";var n=r("NPXF"),i=Array.prototype.concat,a=Array.prototype.slice,o=e.exports=function(e){for(var t=[],r=0,o=e.length;r0){for(a+=o,t=1;tr)throw Error(g+e)}function T(e,t,r,n){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=E,i=0):(i=Math.ceil((t+1)/E),t%=E),a=x(10,E-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)==x(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)==x(10,t-3)-1,o}function B(e,t,r){for(var n,i,a=[0],o=0,s=e.length;or-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}j.absoluteValue=j.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),D(e)},j.ceil=function(){return D(new this.constructor(this),this.e+1,2)},j.comparedTo=j.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;ts[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},j.cosine=j.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())+E,n.rounding=1,r=function(e,t){var r,n,i=t.d.length;i<32?(r=Math.ceil(i/3),n=(1/V(4,r)).toString()):(r=16,n="2.3283064365386962890625e-10");e.precision+=r,t=K(e,1,t.times(n),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,$(n,r)),n.precision=e,n.rounding=t,D(2==s||3==s?r.neg():r,e,t,!0)):new n(1):new n(NaN)},j.cubeRoot=j.cbrt=function(){var e,t,r,n,i,a,o,s,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(d=!1,(a=l.s*x(l.s*l,1/3))&&Math.abs(a)!=1/0?n=new f(a.toString()):(r=k(l.d),(a=((e=l.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=x(r,1/3),e=b((e+1)/3)-(e%3==(e<0?-1:2)),(n=new f(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=l.s),o=(e=f.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(l),n=_(c.plus(l).times(s),c.plus(u),o+2,1),k(s.d).slice(0,o)===(r=k(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))||(D(n,e+1,1),t=!n.times(n).times(n).eq(l));break}if(!i&&(D(s,e+1,0),s.times(s).times(s).eq(l))){n=s;break}o+=4,i=1}return d=!0,D(n,e,f.rounding,t)},j.decimalPlaces=j.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-b(this.e/E))*E,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},j.dividedBy=j.div=function(e){return _(this,new this.constructor(e))},j.dividedToIntegerBy=j.divToInt=function(e){var t=this.constructor;return D(_(this,new t(e),0,1,1),t.precision,t.rounding)},j.equals=j.eq=function(e){return 0===this.cmp(e)},j.floor=function(){return D(new this.constructor(this),this.e+1,3)},j.greaterThan=j.gt=function(e){return this.cmp(e)>0},j.greaterThanOrEqualTo=j.gte=function(e){var t=this.cmp(e);return 1==t||0===t},j.hyperbolicCosine=j.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/V(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=K(o,1,a.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=a.times(a),a=s.minus(u.times(l.minus(u.times(l))));return D(a,o.precision=r,o.rounding=n,!0)},j.hyperbolicSine=j.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=K(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=K(a,2,i=i.times(1/V(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,D(i,t,r,!0)},j.hyperbolicTangent=j.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,_(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},j.inverseCosine=j.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()?F(r,i,a):new r(0):new r(NaN):t.isZero()?F(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=F(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))},j.inverseHyperbolicCosine=j.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,d=!1,r=r.times(r).minus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},j.inverseHyperbolicSine=j.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,d=!1,r=r.times(r).plus(1).sqrt().plus(r),d=!0,n.precision=e,n.rounding=t,r.ln())},j.inverseHyperbolicTangent=j.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?D(new a(i),e,t,!0):(a.precision=r=n-i.e,i=_(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)},j.inverseSine=j.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=F(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)))},j.inverseTangent=j.atan=function(){var e,t,r,n,i,a,o,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=C)return(o=F(l,f+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new l(NaN);if(f+4<=C)return(o=F(l,f+4,p).times(.5)).s=c.s,o}for(l.precision=s=f+10,l.rounding=1,e=r=Math.min(28,s/E+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(d=!1,t=Math.ceil(s/E),n=1,u=c.times(c),o=new l(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<this.d.length-2},j.isNaN=function(){return!this.s},j.isNegative=j.isNeg=function(){return this.s<0},j.isPositive=j.isPos=function(){return this.s>0},j.isZero=function(){return!!this.d&&0===this.d[0]},j.lessThan=j.lt=function(e){return this.cmp(e)<0},j.lessThanOrEqualTo=j.lte=function(e){return this.cmp(e)<1},j.logarithm=j.log=function(e){var t,r,n,i,a,o,s,u,c=this.constructor,l=c.precision,f=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(d=!1,o=J(this,s=l+5),n=t?z(c,s+10):J(e,s),T((u=_(o,n,s,1)).d,i=l,f))do{if(o=J(this,s+=10),n=t?z(c,s+10):J(e,s),u=_(o,n,s,1),!a){+k(u.d).slice(i+1,i+15)+1==1e14&&(u=D(u,l+1,0));break}}while(T(u.d,i+=10,f));return d=!0,D(u,l,f)},j.minus=j.sub=function(e){var t,r,n,i,a,o,s,u,c,l,f,p,m=this,h=m.constructor;if(e=new h(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new h(e.d||m.s!==e.s?m:NaN):e=new h(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,s=h.precision,u=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===u?-0:0);e=new h(m)}return d?D(e,s,u):e}if(r=b(e.e/E),l=b(m.e/E),c=c.slice(),a=l-r){for((f=a<0)?(t=c,a=-a,o=p.length):(t=p,r=l,o=c.length),a>(n=Math.max(Math.ceil(s/E),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((f=(n=c.length)<(o=p.length))&&(o=n),n=0;n0;--n)c[o++]=0;for(n=p.length;n>a;){if(c[--n](o=(a=Math.ceil(s/E))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=l.length)<0&&(i=o,r=l,l=c,c=r),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/O|0,c[i]%=O;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=R(c,n),d?D(e,s,u):e},j.precision=j.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(g+e);return r.d?(t=U(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},j.round=function(){var e=this,t=e.constructor;return D(new t(e),e.e+1,t.rounding)},j.sine=j.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())+E,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return K(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/V(5,r)),t=K(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,$(n,r)),n.precision=e,n.rounding=t,D(s>2?r.neg():r,e,t,!0)):new n(NaN)},j.squareRoot=j.sqrt=function(){var e,t,r,n,i,a,o=this,s=o.d,u=o.e,c=o.s,l=o.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(d=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=k(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=b((u+1)/2)-(u<0||u%2),n=new l(t=c==1/0?"1e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new l(c.toString()),r=(u=l.precision)+3;;)if(n=(a=n).plus(_(o,a,r+2,1)).times(.5),k(a.d).slice(0,r)===(t=k(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(D(n,u+1,1),e=!n.times(n).eq(o));break}if(!i&&(D(a,u+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}return d=!0,D(n,u,l.rounding,e)},j.tangent=j.tan=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+10,n.rounding=1,(r=r.sin()).s=1,r=_(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,D(2==s||4==s?r.neg():r,e,t,!0)):new n(NaN)},j.times=j.mul=function(e){var t,r,n,i,a,o,s,u,c,l=this,f=l.constructor,p=l.d,m=(e=new f(e)).d;if(e.s*=l.s,!(p&&p[0]&&m&&m[0]))return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*e.s:e.s/0);for(r=b(l.e/E)+b(e.e/E),(u=p.length)<(c=m.length)&&(a=p,p=m,m=a,o=u,u=c,c=o),a=[],n=o=u+c;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)s=a[i]+m[n]*p[i-n-1]+t,a[i--]=s%O|0,t=s/O|0;a[i]=(a[i]+t)%O|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=R(a,r),d?D(e,f.precision,f.rounding):e},j.toBinary=function(e,t){return X(this,2,e,t)},j.toDecimalPlaces=j.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(I(e,0,c),void 0===t?t=n.rounding:I(t,0,8),D(r,e+r.e+1,t))},j.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=q(n,!0):(I(e,0,c),void 0===t?t=i.rounding:I(t,0,8),r=q(n=D(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},j.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return void 0===e?r=q(i):(I(e,0,c),void 0===t?t=a.rounding:I(t,0,8),r=q(n=D(new a(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},j.toFraction=function(e){var t,r,n,i,a,o,s,u,c,l,f,p,m=this,h=m.d,y=m.constructor;if(!h)return new y(m);if(c=r=new y(1),o=(a=(t=new y(n=u=new y(0))).e=U(h)-m.e-1)%E,t.d[0]=x(10,o<0?E+o:o),null==e)e=a>0?t:c;else{if(!(s=new y(e)).isInt()||s.lt(c))throw Error(g+s);e=s.gt(t)?a>0?t:c:s}for(d=!1,s=new y(k(h)),l=y.precision,y.precision=a=h.length*E*2;f=_(s,t,0,1,1),1!=(i=r.plus(f.times(n))).cmp(e);)r=n,n=i,i=c,c=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=_(e.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=m.s,p=_(c,n,a,1).minus(m).abs().cmp(_(u,r,a,1).minus(m).abs())<1?[c,n]:[u,r],y.precision=l,d=!0,p},j.toHexadecimal=j.toHex=function(e,t){return X(this,16,e,t)},j.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:I(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(d=!1,r=_(r,e,0,t,1).times(e),d=!0,D(r)):(e.s=r.s,r=e),r},j.toNumber=function(){return+this},j.toOctal=function(e,t){return X(this,8,e,t)},j.toPower=j.pow=function(e){var t,r,n,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(x(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,a=u.rounding,e.eq(1))return D(s,n,a);if((t=b(e.e/E))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=L(u,s,r,n),e.s<0?new u(1).div(i):D(i,n,a);if((o=s.s)<0){if(tu.maxE+1||t0?o/0:0):(d=!1,u.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=G(e.times(J(s,n+r)),n)).d&&T((i=D(i,n+5,1)).d,n,a)&&(t=n+10,+k((i=D(G(e.times(J(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=D(i,n+1,0))),i.s=o,d=!0,u.rounding=a,D(i,n,a))},j.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=q(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(I(e,1,c),void 0===t?t=i.rounding:I(t,0,8),r=q(n=D(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},j.toSignificantDigits=j.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(I(e,1,c),void 0===t?t=r.rounding:I(t,0,8)),D(new r(this),e,t)},j.toString=function(){var e=this,t=e.constructor,r=q(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},j.truncated=j.trunc=function(){return D(new this.constructor(this),this.e+1,1)},j.valueOf=j.toJSON=function(){var e=this,t=e.constructor,r=q(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var _=function(){function e(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;)e.shift()}return function(n,i,a,s,u,c){var l,f,p,m,d,h,g,y,v,x,w,N,M,A,S,C,j,k,I,T,B=n.constructor,_=n.s==i.s?1:-1,q=n.d,R=i.d;if(!(q&&q[0]&&R&&R[0]))return new B(n.s&&i.s&&(q?!R||q[0]!=R[0]:R)?q&&0==q[0]||!R?0*_:_/0:NaN);for(c?(d=1,f=n.e-i.e):(c=O,d=E,f=b(n.e/d)-b(i.e/d)),I=R.length,j=q.length,x=(v=new B(_)).d=[],p=0;R[p]==(q[p]||0);p++);if(R[p]>(q[p]||0)&&f--,null==a?(A=a=B.precision,s=B.rounding):A=u?a+(n.e-i.e)+1:a,A<0)x.push(1),h=!0;else{if(A=A/d+2|0,p=0,1==I){for(m=0,R=R[0],A++;(p1&&(R=e(R,m,c),q=e(q,m,c),I=R.length,j=q.length),C=I,N=(w=q.slice(0,I)).length;N=c/2&&++k;do{m=0,(l=t(R,w,I,N))<0?(M=w[0],I!=N&&(M=M*c+(w[1]||0)),(m=M/k|0)>1?(m>=c&&(m=c-1),1==(l=t(g=e(R,m,c),w,y=g.length,N=w.length))&&(m--,r(g,I=10;m/=10)p++;v.e=p+f*d-1,D(v,u?a+v.e+1:a,s,h)}return v}}();function D(e,t,r,n){var i,a,o,s,u,c,l,f,p,m=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((a=t-i)<0)a+=E,o=t,u=(l=f[p=0])/x(10,i-o-1)%10|0;else if((p=Math.ceil((a+1)/E))>=(s=f.length)){if(!n)break e;for(;s++<=p;)f.push(0);l=u=0,i=1,o=(a%=E)-E+1}else{for(l=s=f[p],i=1;s>=10;s/=10)i++;u=(o=(a%=E)-E+i)<0?0:l/x(10,i-o-1)%10|0}if(n=n||t<0||void 0!==f[p+1]||(o<0?l:l%x(10,i-o-1)),c=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?o>0?l/x(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=x(10,(E-t%E)%E),e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=p,s=1,p--):(f.length=p+1,s=x(10,E-a),f[p]=o>0?(l/x(10,i-o)%x(10,o)|0)*s:0),c)for(;;){if(0==p){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,f[0]==O&&(f[0]=1));break}if(f[p]+=s,f[p]!=O)break;f[p--]=0,s=1}for(a=f.length;0===f[--a];)f.pop()}return d&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+P(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+P(-i-1)+a,r&&(n=r-o)>0&&(a+=P(n))):i>=o?(a+=P(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+P(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=P(n))),a}function R(e,t){var r=e[0];for(t*=E;r>=10;r/=10)t++;return t}function z(e,t,r){if(t>S)throw d=!0,r&&(e.precision=r),Error(y);return D(new e(f),t,1,!0)}function F(e,t,r){if(t>C)throw Error(y);return D(new e(p),t,r,!0)}function U(e){var t=e.length-1,r=t*E+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function P(e){for(var t="";e--;)t+="0";return t}function L(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/E+4);for(d=!1;;){if(r%2&&ee((a=a.times(t)).d,o)&&(i=!0),0===(r=b(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}ee((t=t.times(t)).d,o)}return d=!0,a}function Q(e){return 1&e.d[e.d.length-1]}function H(e,t,r){for(var n,i=new e(t[0]),a=0;++a17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(d=!1,u=h):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=n=Math.log(x(2,f))/Math.LN10*2+5|0,r=a=o=new p(1),p.precision=u;;){if(a=D(a.times(e),u,1),r=r.times(++l),k((s=o.plus(_(a,r,u,1))).d).slice(0,u)===k(o.d).slice(0,u)){for(i=f;i--;)o=D(o.times(o),u,1);if(null!=t)return p.precision=h,o;if(!(c<3&&T(o.d,u-n,m,c)))return D(o,p.precision=h,m,d=!0);p.precision=u+=10,r=a=s=new p(1),l=0,c++}o=s}}function J(e,t){var r,n,i,a,o,s,u,c,l,f,p,m=1,h=e,g=h.d,y=h.constructor,v=y.rounding,b=y.precision;if(h.s<0||!g||!g[0]||!h.e&&1==g[0]&&1==g.length)return new y(g&&!g[0]?-1/0:1!=h.s?NaN:g?0:h);if(null==t?(d=!1,l=b):l=t,y.precision=l+=10,n=(r=k(g)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=z(y,l+2,b).times(a+""),h=J(new y(n+"."+r.slice(1)),l-10).plus(c),y.precision=b,null==t?D(h,b,v,d=!0):h;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=k((h=h.times(e)).d)).charAt(0),m++;for(a=h.e,n>1?(h=new y("0."+r),a++):h=new y(n+"."+r.slice(1)),f=h,u=o=h=_(h.minus(1),h.plus(1),l,1),p=D(h.times(h),l,1),i=3;;){if(o=D(o.times(p),l,1),k((c=u.plus(_(o,new y(i),l,1))).d).slice(0,l)===k(u.d).slice(0,l)){if(u=u.times(2),0!==a&&(u=u.plus(z(y,l+2,b).times(a+""))),u=_(u,new y(m),l,1),null!=t)return y.precision=b,u;if(!T(u.d,l-10,v,s))return D(u,y.precision=b,v,d=!0);y.precision=l+=10,c=o=h=_(f.minus(1),f.plus(1),l,1),p=D(h.times(h),l,1),i=s=1}u=c,i+=2}}function Z(e){return String(e.s*e.s/0)}function W(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%E,r<0&&(n+=E),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,n=e.constructor,s&&(o=(u=(t=t.replace(".","")).length)-o,i=L(n,new n(r),o,2*o)),o=f=(l=B(t,r,O)).length-1;0===l[o];--o)l.pop();return o<0?new n(0*e.s):(e.e=R(l,f),e.d=l,d=!1,s&&(e=_(e,i,4*u)),c&&(e=e.times(Math.abs(c)<54?x(2,c):a.pow(2,c))),d=!0,e)}function K(e,t,r,n,i){var a,o,s,u,c=e.precision,l=Math.ceil(c/E);for(d=!1,u=r.times(r),s=new e(n);;){if(o=_(s.times(u),new e(t++*t++),c,1),s=i?n.plus(o):n.minus(o),n=_(o.times(u),new e(t++*t++),c,1),void 0!==(o=s.plus(n)).d[l]){for(a=l;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=n,n=o,o=a,0}return d=!0,o.d.length=l+1,o}function V(e,t){for(var r=e;--t;)r*=e;return r}function $(e,t){var r,n=t.s<0,i=F(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return s=n?4:1,t;if((r=t.divToInt(i)).isZero())s=n?3:2;else{if((t=t.minus(r.times(i))).lte(a))return s=Q(r)?n?2:3:n?4:1,t;s=Q(r)?n?1:4:n?3:2}return t.minus(i).abs()}function X(e,t,r,n){var i,a,s,u,f,p,m,d,h,g=e.constructor,y=void 0!==r;if(y?(I(r,1,c),void 0===n?n=g.rounding:I(n,0,8)):(r=g.precision,n=g.rounding),e.isFinite()){for(s=(m=q(e)).indexOf("."),y?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,s>=0&&(m=m.replace(".",""),(h=new g(1)).e=m.length-s,h.d=B(q(h),10,i),h.e=h.d.length),a=f=(d=B(m,10,i)).length;0==d[--f];)d.pop();if(d[0]){if(s<0?a--:((e=new g(e)).d=d,e.e=a,d=(e=_(e,h,r,n,0,i)).d,a=e.e,p=o),s=d[r],u=i/2,p=p||void 0!==d[r+1],p=n<4?(void 0!==s||p)&&(0===n||n===(e.s<0?3:2)):s>u||s===u&&(4===n||p||6===n&&1&d[r-1]||n===(e.s<0?8:7)),d.length=r,p)for(;++d[--r]>i-1;)d[r]=0,r||(++a,d.unshift(1));for(f=d.length;!d[f-1];--f);for(s=0,m="";s1)if(16==t||8==t){for(s=16==t?4:3,--f;f%s;f++)m+="0";for(f=(d=B(m,i,t)).length;!d[f-1];--f);for(s=1,m="1.";sf)for(a-=f;a--;)m+="0";else at)return e.length=t,!0}function te(e){return new this(e).abs()}function re(e){return new this(e).acos()}function ne(e){return new this(e).acosh()}function ie(e,t){return new this(e).plus(t)}function ae(e){return new this(e).asin()}function oe(e){return new this(e).asinh()}function se(e){return new this(e).atan()}function ue(e){return new this(e).atanh()}function ce(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?F(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=F(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,r=this.atan(_(e,t,a,1)),t=F(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(_(e,t,a,1)):(r=F(this,a,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function le(e){return new this(e).cbrt()}function fe(e){return D(e=new this(e),e.e+1,2)}function pe(e){if(!e||"object"!=typeof e)throw Error(h+"Object expected");var t,r,n,i=!0===e.defaults,a=["precision",1,c,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(t=0;t=a[t+1]&&n<=a[t+2]))throw Error(g+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=m[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(g+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(v);this[r]=!0}else this[r]=!1}return this}function me(e){return new this(e).cos()}function de(e){return new this(e).cosh()}function he(e,t){return new this(e).div(t)}function ge(e){return new this(e).exp()}function ye(e){return D(e=new this(e),e.e+1,3)}function ve(){var e,t,r=new this(0);for(d=!1,e=0;e=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(v);for(t=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=n/4}else for(;a=10;i/=10)n++;na.maxE?(i.e=NaN,i.d=null):e.e=10;r/=10)t++;return void(d?t>a.maxE?(i.e=NaN,i.d=null):t>t}function f(e,t){if(!Object(n.i)(e)||!Object(n.i)(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}a.signature=i,o.signature="number",s.signature=i,u.signature=i,c.signature=i,l.signature=i,f.signature=i},z5W3:function(e,t,r){var n=r("cFq8");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("4dbd7acc",n,!0)},zOqJ:function(e,t,r){var n=r("Y/tY"),i=r("vImi"),a={};Object.keys(n).forEach(function(e){a[e]={},Object.defineProperty(a[e],"channels",{value:n[e].channels}),Object.defineProperty(a[e],"labels",{value:n[e].labels});var t=i(e);Object.keys(t).forEach(function(r){var n=t[r];a[e][r]=function(e){var t=function(t){if(void 0===t||null===t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,i=0;i1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)})}),e.exports=a}});