@perses-dev/timeseries-chart-plugin 0.13.0-beta.0 → 0.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/__mf/js/{TimeSeriesChart.7df900ef.js → TimeSeriesChart.f9dd142d.js} +2 -2
  2. package/__mf/js/async/187.2cc43fac.js +24 -0
  3. package/__mf/js/async/568.cdcaf97d.js +1 -0
  4. package/__mf/js/async/681.8d61b348.js +110 -0
  5. package/__mf/js/async/681.8d61b348.js.LICENSE.txt +27 -0
  6. package/__mf/js/async/724.3439df06.js +1 -0
  7. package/__mf/js/async/780.12a33d06.js +39 -0
  8. package/__mf/js/async/{721.88bf4be4.js.LICENSE.txt → 780.12a33d06.js.LICENSE.txt} +11 -23
  9. package/__mf/js/async/907.5ce8f69d.js +7 -0
  10. package/__mf/js/async/__federation_expose_TimeSeriesChart.d1167045.js +1 -0
  11. package/__mf/js/{main.496219f9.js → main.2bb9f3e3.js} +2 -2
  12. package/lib/QuerySettingsEditor.d.ts.map +1 -1
  13. package/lib/QuerySettingsEditor.js.map +1 -1
  14. package/lib/TimeSeriesChartBase.d.ts +2 -2
  15. package/lib/TimeSeriesChartBase.d.ts.map +1 -1
  16. package/lib/TimeSeriesChartBase.js +1 -2
  17. package/lib/TimeSeriesChartBase.js.map +1 -1
  18. package/lib/TimeSeriesChartPanel.d.ts +1 -1
  19. package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
  20. package/lib/TimeSeriesChartPanel.js +2 -3
  21. package/lib/TimeSeriesChartPanel.js.map +1 -1
  22. package/lib/cjs/TimeSeriesChartBase.js +3 -4
  23. package/lib/cjs/TimeSeriesChartPanel.js +4 -5
  24. package/lib/cjs/utils/data-transform.js +1 -2
  25. package/lib/test/mock-query-results.d.ts +1 -1
  26. package/lib/test/mock-query-results.js.map +1 -1
  27. package/lib/time-series-chart-model.d.ts +2 -1
  28. package/lib/time-series-chart-model.d.ts.map +1 -1
  29. package/lib/time-series-chart-model.js.map +1 -1
  30. package/lib/utils/data-transform.d.ts +2 -2
  31. package/lib/utils/data-transform.d.ts.map +1 -1
  32. package/lib/utils/data-transform.js +1 -2
  33. package/lib/utils/data-transform.js.map +1 -1
  34. package/mf-manifest.json +14 -15
  35. package/mf-stats.json +14 -15
  36. package/package.json +4 -4
  37. package/__mf/js/async/366.084dd32e.js +0 -24
  38. package/__mf/js/async/377.7ec764e5.js +0 -2
  39. package/__mf/js/async/377.7ec764e5.js.LICENSE.txt +0 -15
  40. package/__mf/js/async/558.401fb679.js +0 -1
  41. package/__mf/js/async/721.88bf4be4.js +0 -110
  42. package/__mf/js/async/826.c7b150c6.js +0 -7
  43. package/__mf/js/async/891.18ba0e56.js +0 -38
  44. package/__mf/js/async/945.1a85358e.js +0 -1
  45. package/__mf/js/async/__federation_expose_TimeSeriesChart.0329eb0a.js +0 -1
  46. /package/__mf/css/async/{826.85c2cbf6.css → 907.85c2cbf6.css} +0 -0
  47. /package/__mf/js/async/{366.084dd32e.js.LICENSE.txt → 187.2cc43fac.js.LICENSE.txt} +0 -0
  48. /package/__mf/js/async/{826.c7b150c6.js.LICENSE.txt → 907.5ce8f69d.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- /*! For license information please see 377.7ec764e5.js.LICENSE.txt */
2
- (self["chunk_TimeSeriesChart "]=self["chunk_TimeSeriesChart "]||[]).push([["377"],{54042(t,r,e){"use strict";var n;r.default=void 0,r.default=(0,((n=e(1448))&&n.__esModule?n:{default:n}).default)("M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z","Download")},23420(t){function r(){}r.prototype={on:function(t,r,e){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:r,ctx:e}),this},once:function(t,r,e){var n=this;function i(){n.off(t,i),r.apply(e,arguments)}return i._=r,this.on(t,i,e)},emit:function(t){for(var r=[].slice.call(arguments,1),e=((this.e||(this.e={}))[t]||[]).slice(),n=0,i=e.length;n<i;n++)e[n].fn.apply(e[n].ctx,r);return this},off:function(t,r){var e=this.e||(this.e={}),n=e[t],i=[];if(n&&r)for(var o=0,s=n.length;o<s;o++)n[o].fn!==r&&n[o].fn._!==r&&i.push(n[o]);return i.length?e[t]=i:delete e[t],this}},t.exports=r,t.exports.TinyEmitter=r},42915(t){"use strict";var r;r=function(){function t(){return!0}function r(){return!1}function e(){}return function n(){var i=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:function(t){return"object"==typeof t&&null!==t&&t.constructor===Object}},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],o={name:"any",test:t},s=[],a=[],u={types:i,conversions:a,ignore:s};function c(t){var r=j(u.types,function(r){return r.name===t});if(r)return r;if("any"===t)return o;var e=j(u.types,function(r){return r.name.toLowerCase()===t.toLowerCase()});throw TypeError('Unknown type "'+t+'"'+(e?'. Did you mean "'+e.name+'"?':""))}function f(t){return t===o?999:u.types.indexOf(t)}function h(t){var r=j(u.types,function(r){return r.test(t)});if(r)return r.name;throw TypeError("Value has unknown type. Value: "+t)}function p(t){return t.map(function(t){var r=t.types.map(y);return(t.restParam?"...":"")+r.join("|")}).join(",")}function l(t){var r=T(t);return!!r&&r.restParam}function d(t){return t.types.some(function(t){return null!=t.conversion})}function m(r){if(!r||0===r.types.length)return t;if(1===r.types.length)return c(r.types[0].name).test;if(2===r.types.length){var e=c(r.types[0].name).test,n=c(r.types[1].name).test;return function(t){return e(t)||n(t)}}var i=r.types.map(function(t){return c(t.name).test});return function(t){for(var r=0;r<i.length;r++)if(i[r](t))return!0;return!1}}function g(t,r){return r<t.params.length?t.params[r]:l(t.params)?T(t.params):null}function v(t,r,e){var n=g(t,r);return(n?e?n.types.filter(w):n.types:[]).map(y)}function y(t){return t.name}function w(t){return null===t.conversion||void 0===t.conversion}function x(t,r){var e=function(t){for(var r={},e=0;e<t.length;e++)r[t[e]]=!0;return Object.keys(r)}(k(t,function(t){return v(t,r,!1)}));return -1!==e.indexOf("any")?["any"]:e}function N(t,r,e){var n,i,o,s=t||"unnamed",a=e;for(o=0;o<r.length;o++){var u=a.filter(function(t){var e=m(g(t,o));return(o<t.params.length||l(t.params))&&e(r[o])});if(0===u.length){if((i=x(a,o)).length>0){var c=h(r[o]);return(n=TypeError("Unexpected type of argument in function "+s+" (expected: "+i.join(" or ")+", actual: "+c+", index: "+o+")")).data={category:"wrongType",fn:s,index:o,actual:c,expected:i},n}}else a=u}var f=a.map(function(t){return l(t.params)?1/0:t.params.length});if(r.length<Math.min.apply(null,f))return(n=TypeError("Too few arguments in function "+s+" (expected: "+(i=x(a,o)).join(" or ")+", index: "+r.length+")")).data={category:"tooFewArgs",fn:s,index:r.length,expected:i},n;var p=Math.max.apply(null,f);return r.length>p?(n=TypeError("Too many arguments in function "+s+" (expected: "+p+", actual: "+r.length+")")).data={category:"tooManyArgs",fn:s,index:r.length,expectedLength:p}:(n=TypeError('Arguments of type "'+r.join(", ")+'" do not match any of the defined signatures of function '+s+".")).data={category:"mismatch",actual:r.map(h)},n}function b(t){for(var r=999,e=0;e<t.types.length;e++)w(t.types[e])&&(r=Math.min(r,t.types[e].typeIndex));return r}function _(t){for(var r=999,e=0;e<t.types.length;e++)w(t.types[e])||(r=Math.min(r,t.types[e].conversionIndex));return r}function M(t,r){var e,n,i=Math.min(t.params.length,r.params.length);if(0!=(n=t.params.some(d)-r.params.some(d)))return n;for(e=0;e<i;e++)if(0!=(n=d(t.params[e])-d(r.params[e])))return n;for(e=0;e<i;e++)if(0!==(n=function(t,r){var e;return 0!=(e=t.restParam-r.restParam)||0!=(e=d(t)-d(r))||0!=(e=b(t)-b(r))?e:_(t)-_(r)}(t.params[e],r.params[e])))return n;return t.params.length-r.params.length}function E(t){var r,e,n,i,o=[],s=[];switch(t.types.forEach(function(t){t.conversion&&(o.push(c(t.conversion.from).test),s.push(t.conversion.convert))}),s.length){case 0:return function(t){return t};case 1:return r=o[0],n=s[0],function(t){return r(t)?n(t):t};case 2:return r=o[0],e=o[1],n=s[0],i=s[1],function(t){return r(t)?n(t):e(t)?i(t):t};default:return function(t){for(var r=0;r<s.length;r++)if(o[r](t))return s[r](t);return t}}}function O(t,r){return function t(e,n,i){if(!(n<e.length))return[i.map(function(t,r){return{types:t,restParam:r===e.length-1&&l(e)}})];var o,s=e[n],a=r?s.types.filter(w):s.types;if(s.restParam){var u=a.filter(w);o=u.length<a.length?[u,a]:[a]}else o=a.map(function(t){return[t]});return k(o,function(r){return t(e,n+1,i.concat([r]))})}(t,0,[])}function A(t,n){if(0===Object.keys(n).length)throw SyntaxError("No signatures provided");var i,o=[];Object.keys(n).map(function(t){var r,e,i;return r=n[t],e=u.conversions,i=[],(""!==t.trim()&&(i=t.split(",").map(C).map(function(t,r,n){var i,o,s,a,u,h,p,l,d=(i=e,o=u=((a=0===t.indexOf("..."))?t.length>3?t.slice(3):"any":t).split("|").map(C).filter(P).filter(S),s={},i.forEach(function(t){-1!==o.indexOf(t.from)||-1===o.indexOf(t.to)||s[t.from]||(s[t.from]=t)}),h=Object.keys(s).map(function(t){return s[t]}),p=u.map(function(t){var r=c(t);return{name:t,typeIndex:f(r),test:r.test,conversion:null,conversionIndex:-1}}),l=h.map(function(t){var r=c(t.from);return{name:t.from,typeIndex:f(r),test:r.test,conversion:t,conversionIndex:e.indexOf(t)}}),{types:p.concat(l),restParam:a});if(d.restParam&&r!==n.length-1)throw SyntaxError('Unexpected rest parameter "'+t+'": only allowed for the last parameter');return d})),i.some(I))?null:{params:i,fn:r}}).filter(F).forEach(function(t){var r=j(o,function(r){return function(t,r){for(var e=Math.max(t.params.length,r.params.length),n=0;n<e;n++)if(!function(t,r){for(var e,n=0;n<t.length;n++)if(e=t[n],-1!==r.indexOf(e))return!0;return!1}(v(t,n,!0),v(r,n,!0)))return!1;var i=t.params.length,o=r.params.length,s=l(t.params),a=l(r.params);return s?a?i===o:o>=i:a?i>=o:i===o}(r,t)});if(r)throw TypeError('Conflicting signatures "'+p(r.params)+'" and "'+p(t.params)+'".');o.push(t)});var s=k(o,function(t){return(t?O(t.params,!1):[]).map(function(r){return{params:r,fn:t.fn}})}).filter(F);s.sort(M);var a=s[0]&&s[0].params.length<=2&&!l(s[0].params),h=s[1]&&s[1].params.length<=2&&!l(s[1].params),g=s[2]&&s[2].params.length<=2&&!l(s[2].params),y=s[3]&&s[3].params.length<=2&&!l(s[3].params),w=s[4]&&s[4].params.length<=2&&!l(s[4].params),x=s[5]&&s[5].params.length<=2&&!l(s[5].params),N=s.map(function(t){return function(t){var r,e,n;if(l(t)){var i,o=(r=(i=t).slice(0,i.length-1).map(m)).length,s=m(T(t)),a=function(t){for(var r=o;r<t.length;r++)if(!s(t[r]))return!1;return!0};return function(t){for(var e=0;e<r.length;e++)if(!r[e](t[e]))return!1;return a(t)&&t.length>=o+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(e=m(t[0]),function(t){return e(t[0])&&1===t.length}):2===t.length?(e=m(t[0]),n=m(t[1]),function(t){return e(t[0])&&n(t[1])&&2===t.length}):(r=t.map(m),function(t){for(var e=0;e<r.length;e++)if(!r[e](t[e]))return!1;return t.length===r.length})}(t.params)}),b=a?m(s[0].params[0]):r,_=h?m(s[1].params[0]):r,A=g?m(s[2].params[0]):r,z=y?m(s[3].params[0]):r,R=w?m(s[4].params[0]):r,q=x?m(s[5].params[0]):r,B=a?m(s[0].params[1]):r,Z=h?m(s[1].params[1]):r,L=g?m(s[2].params[1]):r,U=y?m(s[3].params[1]):r,Y=w?m(s[4].params[1]):r,$=x?m(s[5].params[1]):r,G=s.map(function(t){return function(t,r){var e=r;if(t.some(d)){var n=l(t),i=t.map(E);e=function(){for(var t=[],e=n?arguments.length-1:arguments.length,o=0;o<e;o++)t[o]=i[o](arguments[o]);return n&&(t[e]=arguments[e].map(i[e])),r.apply(this,t)}}var o=e;if(l(t)){var s=t.length-1;o=function(){return e.apply(this,D(arguments,0,s).concat([D(arguments,s)]))}}return o}(t.params,t.fn)}),Q=a?G[0]:e,H=h?G[1]:e,J=g?G[2]:e,W=y?G[3]:e,V=w?G[4]:e,K=x?G[5]:e,X=a?s[0].params.length:-1,tt=h?s[1].params.length:-1,tr=g?s[2].params.length:-1,te=y?s[3].params.length:-1,tn=w?s[4].params.length:-1,ti=x?s[5].params.length:-1,to=6*!!(a&&h&&g&&y&&w&&x),ts=s.length,ta=function(){for(var r=to;r<ts;r++)if(N[r](arguments))return G[r].apply(this,arguments);return u.onMismatch(t,arguments,s)},tu=function t(r,e){return arguments.length===X&&b(r)&&B(e)?Q.apply(t,arguments):arguments.length===tt&&_(r)&&Z(e)?H.apply(t,arguments):arguments.length===tr&&A(r)&&L(e)?J.apply(t,arguments):arguments.length===te&&z(r)&&U(e)?W.apply(t,arguments):arguments.length===tn&&R(r)&&Y(e)?V.apply(t,arguments):arguments.length===ti&&q(r)&&$(e)?K.apply(t,arguments):ta.apply(t,arguments)};try{Object.defineProperty(tu,"name",{value:t})}catch(t){}return i={},s.forEach(function(t){t.params.some(d)||O(t.params,!0).forEach(function(r){i[p(r)]=t.fn})}),tu.signatures=i,tu}function z(t,r,e){throw N(t,r,e)}function S(t){return -1===u.ignore.indexOf(t)}function C(t){return t.trim()}function P(t){return!!t}function F(t){return null!==t}function I(t){return 0===t.types.length}function T(t){return t[t.length-1]}function D(t,r,e){return Array.prototype.slice.call(t,r,e)}function j(t,r){for(var e=0;e<t.length;e++)if(r(t[e]))return t[e]}function k(t,r){return Array.prototype.concat.apply([],t.map(r))}function R(t){for(var r="",e=0;e<t.length;e++){var n=t[e];if(("object"==typeof n.signatures||"string"==typeof n.signature)&&""!==n.name){if(""===r)r=n.name;else if(r!==n.name){var i=Error("Function names do not match (expected: "+r+", actual: "+n.name+")");throw i.data={actual:n.name,expected:r},i}}}return r}function q(t){var r,e={};function n(t,n){if(e.hasOwnProperty(t)&&n!==e[t])throw(r=Error('Signature "'+t+'" is defined twice')).data={signature:t},r}for(var i=0;i<t.length;i++){var o=t[i];if("object"==typeof o.signatures)for(var s in o.signatures)o.signatures.hasOwnProperty(s)&&(n(s,o.signatures[s]),e[s]=o.signatures[s]);else if("string"==typeof o.signature)n(o.signature,o),e[o.signature]=o;else throw(r=TypeError("Function is no typed-function (index: "+i+")")).data={index:i},r}return e}return(u=A("typed",{"string, Object":A,Object:function(t){var r=[];for(var e in t)t.hasOwnProperty(e)&&r.push(t[e]);return A(R(r),t)},"...Function":function(t){return A(R(t),q(t))},"string, ...Function":function(t,r){return A(t,q(r))}})).create=n,u.types=i,u.conversions=a,u.ignore=s,u.onMismatch=z,u.throwMismatchError=z,u.createError=N,u.convert=function(t,r){var e=h(t);if(r===e)return t;for(var n=0;n<u.conversions.length;n++){var i=u.conversions[n];if(i.from===e&&i.to===r)return i.convert(t)}throw Error("Cannot convert from "+e+" to "+r)},u.find=function(t,r){if(!t.signatures)throw TypeError("Function is no typed-function");if("string"==typeof r){e=r.split(",");for(var e,n=0;n<e.length;n++)e[n]=e[n].trim()}else if(Array.isArray(r))e=r;else throw TypeError("String array or a comma separated string expected");var i=e.join(","),o=t.signatures[i];if(o)return o;throw TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+e.join(", ")+"))")},u.addType=function(t,r){if(!t||"string"!=typeof t.name||"function"!=typeof t.test)throw TypeError("Object with properties {name: string, test: function} expected");if(!1!==r){for(var e=0;e<u.types.length;e++)if("Object"===u.types[e].name)return void u.types.splice(e,0,t)}u.types.push(t)},u.addConversion=function(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw TypeError("Object with properties {from: string, to: string, convert: function} expected");u.conversions.push(t)},u}()},"function"==typeof define&&define.amd?define([],r):t.exports=r()},18615(t,r,e){"use strict";e.d(r,{v:()=>g});var n=e(68102),i=e(32718),o=e(23420),s=e(46797),a=e(1207),u=e(49204);function c(t,r,e,n){if(!(this instanceof c))throw SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=r,this.min=e,this.max=n,this.message="Wrong number of arguments in function "+t+" ("+r+" provided, "+e+(null!=n?"-"+n:"")+" expected)",this.stack=Error().stack}c.prototype=Error(),c.prototype.constructor=Error,c.prototype.name="ArgumentsError",c.prototype.isArgumentsError=!0;var f={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},h=["Matrix","Array"],p=["number","BigNumber","Fraction"];function l(t,r,e){var n;void 0!==t[r]&&(n=t[r],-1===e.indexOf(n))&&console.warn('Warning: Unknown value "'+t[r]+'" for configuration option "'+r+'". Available options: '+e.map(t=>JSON.stringify(t)).join(", ")+".")}var d=e(15562),m=e(16086);function g(t,r){var e,v,y=(0,n.A)({},f,r);if("function"!=typeof Object.create)throw Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var w=((e={isNumber:s.Et,isComplex:s.Zd,isBigNumber:s.C4,isFraction:s.fU,isUnit:s.vO,isString:s.Kg,isArray:s.cy,isMatrix:s.OA,isCollection:s.P3,isDenseMatrix:s.zR,isSparseMatrix:s.AF,isRange:s._Z,isIndex:s.nw,isBoolean:s.Lm,isResultSet:s.eW,isHelp:s.gS,isFunction:s.Tn,isDate:s.$P,isRegExp:s.gd,isObject:s.Gv,isNull:s.kZ,isUndefined:s.b0,isAccessorNode:s.AS,isArrayNode:s.gO,isAssignmentNode:s.qM,isBlockNode:s.CD,isConditionalNode:s.PO,isConstantNode:s.BA,isFunctionAssignmentNode:s.m2,isFunctionNode:s.Px,isIndexNode:s.$I,isNode:s.Ll,isObjectNode:s.GJ,isOperatorNode:s.$$,isParenthesisNode:s.tv,isRangeNode:s.Ye,isSymbolNode:s.li,isChain:s.o_}).on=(v=new o).on.bind(v),e.off=v.off.bind(v),e.once=v.once.bind(v),e.emit=v.emit.bind(v),e);w.config=function(t,r){function e(e){if(!e)return(0,i.s8)(t,i.o8);var n=(0,i.s8)(t,i.o8);l(e,"matrix",h),l(e,"number",p),(0,i.zw)(t,e);var o=(0,i.s8)(t,i.o8);return r("config",o,n,(0,i.s8)(e,i.o8)),o}return e.MATRIX_OPTIONS=h,e.NUMBER_OPTIONS=p,Object.keys(f).forEach(r=>{Object.defineProperty(e,r,{get:()=>t[r],enumerable:!0,configurable:!0})}),e}(y,w.emit),w.expression={transform:{},mathWithTransform:{config:w.config}};var x={},N=function(t,r,e){function n(t,e){e&&"function"==typeof e.transform?(r.expression.transform[t]=e.transform,f(t)&&(r.expression.mathWithTransform[t]=e.transform)):(delete r.expression.transform[t],f(t)&&(r.expression.mathWithTransform[t]=e))}function o(t){return"function"==typeof t&&"object"==typeof t.signatures}function f(t){return!(0,i.mQ)(p,t)}function h(t){return void 0!==t&&void 0!==t.meta&&!0===t.meta.isTransformFunction}var p={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(l,d){var m=arguments.length;if(1!==m&&2!==m)throw new c("import",m,1,2);d||(d={});var g={};for(var v in!function t(r,e,n){if(Array.isArray(e))e.forEach(e=>t(r,e));else if("object"==typeof e)for(var o in e)(0,i.mQ)(e,o)&&t(r,e[o],o);else if((0,a.T$)(e)||void 0!==n){var s=(0,a.T$)(e)?h(e)?e.fn+".transform":e.fn:n;if((0,i.mQ)(r,s)&&r[s]!==e&&!d.silent)throw Error('Cannot import "'+s+'" twice');r[s]=e}else if(!d.silent)throw TypeError("Factory, Object, or Array expected")}(g,l),g)if((0,i.mQ)(g,v)){var y,w=g[v];if((0,a.T$)(w))!function(n,s){var c,l,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.fn;if((0,u.gR)(d,"."))throw Error("Factory name should not contain a nested path. Name: "+JSON.stringify(d));var m=h(n)?r.expression.transform:r,g=d in r.expression.transform,v=(0,i.mQ)(m,d)?m[d]:void 0,y=function(){var e={};n.dependencies.map(a.Py).forEach(t=>{if((0,u.gR)(t,"."))throw Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(t));"math"===t?e.math=r:"mathWithTransform"===t?e.mathWithTransform=r.expression.mathWithTransform:"classes"===t?e.classes=r:e[t]=r[t]});var i=n(e);if(i&&"function"==typeof i.transform)throw Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===v||s.override)return i;if(o(v)&&o(i))return t(v,i);if(s.silent)return v;throw Error('Cannot import "'+d+'": already exists')};n.meta&&!1===n.meta.lazy?m[d]=y():(0,i.RZ)(m,d,y),v&&g?(c=d,delete r.expression.transform[c],f(c)?r.expression.mathWithTransform[c]=r[c]:delete r.expression.mathWithTransform[c]):!h(n)&&(-1!==(l=n).fn.indexOf(".")||(0,i.mQ)(p,l.fn)||l.meta&&l.meta.isClass)||(0,i.RZ)(r.expression.mathWithTransform,d,()=>m[d]),e[d]=n,r.emit("import",d,y)}(w,d);else{if("function"==typeof(y=w)||"number"==typeof y||"string"==typeof y||"boolean"==typeof y||null===y||(0,s.vO)(y)||(0,s.Zd)(y)||(0,s.C4)(y)||(0,s.fU)(y)||(0,s.OA)(y)||Array.isArray(y))!function(i,s,a){var u;if(a.wrap&&"function"==typeof s&&(s=function(t){var e=function(){for(var e=[],n=0,i=arguments.length;n<i;n++){var o=arguments[n];e[n]=o&&o.valueOf()}return t.apply(r,e)};return t.transform&&(e.transform=t.transform),e}(s)),"function"==typeof(u=s)&&"string"==typeof u.signature&&(s=t(i,{[s.signature]:s})),o(r[i])&&o(s)){s=a.override?t(i,s.signatures):t(r[i],s),r[i]=s,delete e[i],n(i,s),r.emit("import",i,function(){return s});return}if(void 0===r[i]||a.override){r[i]=s,delete e[i],n(i,s),r.emit("import",i,function(){return s});return}if(!a.silent)throw Error('Cannot import "'+i+'": already exists')}(v,w,d);else if(!d.silent)throw TypeError("Factory, Object, or Array expected")}}}}(function(){for(var t=arguments.length,r=Array(t),e=0;e<t;e++)r[e]=arguments[e];return w.typed.apply(w.typed,r)},w,x);return w.import=N,w.on("config",()=>{(0,i.zu)(x).forEach(t=>{t&&t.meta&&t.meta.recreateOnConfigChange&&N(t,{override:!0})})}),w.create=g.bind(null,t),w.factory=a.P9,w.import((0,i.zu)((0,i.rU)(t))),w.ArgumentsError=c,w.DimensionError=d.h,w.IndexError=m.d,w}},50285(t,r,e){"use strict";e.d(r,{_:()=>rE});var n,i,o="0123456789abcdef",s="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",a="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",u={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:9e15,crypto:!1},c=!0,f="[DecimalError] ",h=f+"Invalid argument: ",p=f+"Precision limit exceeded",l=f+"crypto unavailable",d="[object Decimal]",m=Math.floor,g=Math.pow,v=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,y=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,w=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,x=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,N=s.length-1,b=a.length-1,_={toStringTag:d};function M(t){var r,e,n,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,r=1;r<i;r++)(e=7-(n=t[r]+"").length)&&(o+=D(e)),o+=n;(e=7-(n=(s=t[r])+"").length)&&(o+=D(e))}else if(0===s)return"0";for(;s%10==0;)s/=10;return o+s}function E(t,r,e){if(t!==~~t||t<r||t>e)throw Error(h+t)}function O(t,r,e,n){var i,o,s,a;for(o=t[0];o>=10;o/=10)--r;return--r<0?(r+=7,i=0):(i=Math.ceil((r+1)/7),r%=7),o=g(10,7-r),a=t[i]%o|0,null==n?r<3?(0==r?a=a/100|0:1==r&&(a=a/10|0),s=e<4&&99999==a||e>3&&49999==a||5e4==a||0==a):s=(e<4&&a+1==o||e>3&&a+1==o/2)&&(t[i+1]/o/100|0)==g(10,r-2)-1||(a==o/2||0==a)&&(t[i+1]/o/100|0)==0:r<4?(0==r?a=a/1e3|0:1==r?a=a/100|0:2==r&&(a=a/10|0),s=(n||e<4)&&9999==a||!n&&e>3&&4999==a):s=((n||e<4)&&a+1==o||!n&&e>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==g(10,r-3)-1,s}function A(t,r,e){for(var n,i,s=[0],a=0,u=t.length;a<u;){for(i=s.length;i--;)s[i]*=r;for(s[0]+=o.indexOf(t.charAt(a++)),n=0;n<s.length;n++)s[n]>e-1&&(void 0===s[n+1]&&(s[n+1]=0),s[n+1]+=s[n]/e|0,s[n]%=e)}return s.reverse()}_.absoluteValue=_.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),S(t)},_.ceil=function(){return S(new this.constructor(this),this.e+1,2)},_.clampedTo=_.clamp=function(t,r){var e=this.constructor;if(t=new e(t),r=new e(r),!t.s||!r.s)return new e(NaN);if(t.gt(r))throw Error(h+r);return 0>this.cmp(t)?t:this.cmp(r)>0?r:new e(this)},_.comparedTo=_.cmp=function(t){var r,e,n,i,o=this.d,s=(t=new this.constructor(t)).d,a=this.s,u=t.s;if(!o||!s)return a&&u?a!==u?a:o===s?0:!o^a<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?a:s[0]?-u:0;if(a!==u)return a;if(this.e!==t.e)return this.e>t.e^a<0?1:-1;for(r=0,e=(n=o.length)<(i=s.length)?n:i;r<e;++r)if(o[r]!==s[r])return o[r]>s[r]^a<0?1:-1;return n===i?0:n>i^a<0?1:-1},_.cosine=_.cos=function(){var t,r,e=this,n=e.constructor;return e.d?e.d[0]?(t=n.precision,r=n.rounding,n.precision=t+Math.max(e.e,e.sd())+7,n.rounding=1,e=function(t,r){var e,n,i;if(r.isZero())return r;(n=r.d.length)<32?i=(1/Y(4,e=Math.ceil(n/3))).toString():(e=16,i="2.3283064365386962890625e-10"),t.precision+=e,r=U(t,1,r.times(i),new t(1));for(var o=e;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return t.precision-=e,r}(n,$(n,e)),n.precision=t,n.rounding=r,S(2==i||3==i?e.neg():e,t,r,!0)):new n(1):new n(NaN)},_.cubeRoot=_.cbrt=function(){var t,r,e,n,i,o,s,a,u,f,h=this.constructor;if(!this.isFinite()||this.isZero())return new h(this);for(c=!1,(o=this.s*g(this.s*this,1/3))&&Math.abs(o)!=1/0?n=new h(o.toString()):(e=M(this.d),(o=((t=this.e)-e.length+1)%3)&&(e+=1==o||-2==o?"0":"00"),o=g(e,1/3),t=m((t+1)/3)-(t%3==(t<0?-1:2)),(n=new h(e=o==1/0?"5e"+t:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=this.s),s=(t=h.precision)+3;;)if(n=z((f=(u=(a=n).times(a).times(a)).plus(this)).plus(this).times(a),f.plus(u),s+2,1),M(a.d).slice(0,s)===(e=M(n.d)).slice(0,s)){if("9999"!=(e=e.slice(s-3,s+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(S(n,t+1,1),r=!n.times(n).times(n).eq(this));break}if(!i&&(S(a,t+1,0),a.times(a).times(a).eq(this))){n=a;break}s+=4,i=1}return c=!0,S(n,t,h.rounding,r)},_.decimalPlaces=_.dp=function(){var t,r=this.d,e=NaN;if(r){if(e=((t=r.length-1)-m(this.e/7))*7,t=r[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},_.dividedBy=_.div=function(t){return z(this,new this.constructor(t))},_.dividedToIntegerBy=_.divToInt=function(t){var r=this.constructor;return S(z(this,new r(t),0,1,1),r.precision,r.rounding)},_.equals=_.eq=function(t){return 0===this.cmp(t)},_.floor=function(){return S(new this.constructor(this),this.e+1,3)},_.greaterThan=_.gt=function(t){return this.cmp(t)>0},_.greaterThanOrEqualTo=_.gte=function(t){var r=this.cmp(t);return 1==r||0===r},_.hyperbolicCosine=_.cosh=function(){var t,r,e,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;e=s.precision,n=s.rounding,s.precision=e+Math.max(o.e,o.sd())+4,s.rounding=1,(i=o.d.length)<32?r=(1/Y(4,t=Math.ceil(i/3))).toString():(t=16,r="2.3283064365386962890625e-10"),o=U(s,1,o.times(r),new s(1),!0);for(var u,c=t,f=new s(8);c--;)u=o.times(o),o=a.minus(u.times(f.minus(u.times(f))));return S(o,s.precision=e,s.rounding=n,!0)},_.hyperbolicSine=_.sinh=function(){var t,r,e,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,e=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,(n=i.d.length)<3)i=U(o,2,i,i,!0);else{t=(t=1.4*Math.sqrt(n))>16?16:0|t,i=U(o,2,i=i.times(1/Y(5,t)),i,!0);for(var s,a=new o(5),u=new o(16),c=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(c))))}return o.precision=r,o.rounding=e,S(i,r,e,!0)},_.hyperbolicTangent=_.tanh=function(){var t,r,e=this.constructor;return this.isFinite()?this.isZero()?new e(this):(t=e.precision,r=e.rounding,e.precision=t+7,e.rounding=1,z(this.sinh(),this.cosh(),e.precision=t,e.rounding=r)):new e(this.s)},_.inverseCosine=_.acos=function(){var t=this,r=t.constructor,e=t.abs().cmp(1),n=r.precision,i=r.rounding;return -1!==e?0===e?t.isNeg()?I(r,n,i):new r(0):new r(NaN):t.isZero()?I(r,n+4,i).times(.5):(r.precision=n+6,r.rounding=1,t=new r(1).minus(t).div(t.plus(1)).sqrt().atan(),r.precision=n,r.rounding=i,t.times(2))},_.inverseHyperbolicCosine=_.acosh=function(){var t,r,e=this,n=e.constructor;return e.lte(1)?new n(e.eq(1)?0:NaN):e.isFinite()?(t=n.precision,r=n.rounding,n.precision=t+Math.max(Math.abs(e.e),e.sd())+4,n.rounding=1,c=!1,e=e.times(e).minus(1).sqrt().plus(e),c=!0,n.precision=t,n.rounding=r,e.ln()):new n(e)},_.inverseHyperbolicSine=_.asinh=function(){var t,r,e=this,n=e.constructor;return!e.isFinite()||e.isZero()?new n(e):(t=n.precision,r=n.rounding,n.precision=t+2*Math.max(Math.abs(e.e),e.sd())+6,n.rounding=1,c=!1,e=e.times(e).plus(1).sqrt().plus(e),c=!0,n.precision=t,n.rounding=r,e.ln())},_.inverseHyperbolicTangent=_.atanh=function(){var t,r,e,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,r=o.rounding,Math.max(n=i.sd(),t)<-(2*i.e)-1)?S(new o(i),t,r,!0):(o.precision=e=n-i.e,i=z(i.plus(1),new o(1).minus(i),e+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=r,i.times(.5)):new o(NaN)},_.inverseSine=_.asin=function(){var t,r,e,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),e=o.precision,n=o.rounding,-1!==r)?0===r?((t=I(o,e+4,n).times(.5)).s=i.s,t):new o(NaN):(o.precision=e+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=e,o.rounding=n,i.times(2))},_.inverseTangent=_.atan=function(){var t,r,e,n,i,o,s,a,u,f=this,h=f.constructor,p=h.precision,l=h.rounding;if(f.isFinite()){if(f.isZero())return new h(f);else if(f.abs().eq(1)&&p+4<=b)return(s=I(h,p+4,l).times(.25)).s=f.s,s}else{if(!f.s)return new h(NaN);if(p+4<=b)return(s=I(h,p+4,l).times(.5)).s=f.s,s}for(h.precision=a=p+10,h.rounding=1,t=e=Math.min(28,a/7+2|0);t;--t)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(c=!1,r=Math.ceil(a/7),n=1,u=f.times(f),s=new h(f),i=f;-1!==t;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),void 0!==(s=o.plus(i.div(n+=2))).d[r])for(t=r;s.d[t]===o.d[t]&&t--;);return e&&(s=s.times(2<<e-1)),c=!0,S(s,h.precision=p,h.rounding=l,!0)},_.isFinite=function(){return!!this.d},_.isInteger=_.isInt=function(){return!!this.d&&m(this.e/7)>this.d.length-2},_.isNaN=function(){return!this.s},_.isNegative=_.isNeg=function(){return this.s<0},_.isPositive=_.isPos=function(){return this.s>0},_.isZero=function(){return!!this.d&&0===this.d[0]},_.lessThan=_.lt=function(t){return 0>this.cmp(t)},_.lessThanOrEqualTo=_.lte=function(t){return 1>this.cmp(t)},_.logarithm=_.log=function(t){var r,e,n,i,o,s,a,u=this.constructor,f=u.precision,h=u.rounding;if(null==t)t=new u(10),r=!0;else{if(e=(t=new u(t)).d,t.s<0||!e||!e[0]||t.eq(1))return new u(NaN);r=t.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new u(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(r)if(e.length>1)i=!0;else{for(n=e[0];n%10==0;)n/=10;i=1!==n}if(c=!1,O((a=z(o=B(this,s=f+5),r?F(u,s+10):B(t,s),s,1)).d,n=f,h))do if(s+=10,a=z(o=B(this,s),r?F(u,s+10):B(t,s),s,1),!i){+M(a.d).slice(n+1,n+15)+1==1e14&&(a=S(a,f+1,0));break}while(O(a.d,n+=10,h));return c=!0,S(a,f,h)},_.minus=_.sub=function(t){var r,e,n,i,o,s,a,u,f,h,p,l,d=this.constructor;if(t=new d(t),!this.d||!t.d)return this.s&&t.s?this.d?t.s=-t.s:t=new d(t.d||this.s!==t.s?this:NaN):t=new d(NaN),t;if(this.s!=t.s)return t.s=-t.s,this.plus(t);if(f=this.d,l=t.d,a=d.precision,u=d.rounding,!f[0]||!l[0]){if(l[0])t.s=-t.s;else{if(!f[0])return new d(3===u?-0:0);t=new d(this)}return c?S(t,a,u):t}if(e=m(t.e/7),h=m(this.e/7),f=f.slice(),o=h-e){for((p=o<0)?(r=f,o=-o,s=l.length):(r=l,e=h,s=f.length),o>(n=Math.max(Math.ceil(a/7),s)+2)&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.reverse()}else{for((p=(n=f.length)<(s=l.length))&&(s=n),n=0;n<s;n++)if(f[n]!=l[n]){p=f[n]<l[n];break}o=0}for(p&&(r=f,f=l,l=r,t.s=-t.s),s=f.length,n=l.length-s;n>0;--n)f[s++]=0;for(n=l.length;n>o;){if(f[--n]<l[n]){for(i=n;i&&0===f[--i];)f[i]=1e7-1;--f[i],f[n]+=1e7}f[n]-=l[n]}for(;0===f[--s];)f.pop();for(;0===f[0];f.shift())--e;return f[0]?(t.d=f,t.e=P(f,e),c?S(t,a,u):t):new d(3===u?-0:0)},_.modulo=_.mod=function(t){var r,e=this.constructor;return(t=new e(t),this.d&&t.s&&(!t.d||t.d[0]))?t.d&&(!this.d||this.d[0])?(c=!1,9==e.modulo?(r=z(this,t.abs(),0,3,1),r.s*=t.s):r=z(this,t,0,e.modulo,1),r=r.times(t),c=!0,this.minus(r)):S(new e(this),e.precision,e.rounding):new e(NaN)},_.naturalExponential=_.exp=function(){return q(this)},_.naturalLogarithm=_.ln=function(){return B(this)},_.negated=_.neg=function(){var t=new this.constructor(this);return t.s=-t.s,S(t)},_.plus=_.add=function(t){var r,e,n,i,o,s,a,u,f,h,p=this.constructor;if(t=new p(t),!this.d||!t.d)return this.s&&t.s?this.d||(t=new p(t.d||this.s===t.s?this:NaN)):t=new p(NaN),t;if(this.s!=t.s)return t.s=-t.s,this.minus(t);if(f=this.d,h=t.d,a=p.precision,u=p.rounding,!f[0]||!h[0])return h[0]||(t=new p(this)),c?S(t,a,u):t;if(o=m(this.e/7),n=m(t.e/7),f=f.slice(),i=o-n){for(i<0?(e=f,i=-i,s=h.length):(e=h,n=o,s=f.length),i>(s=(o=Math.ceil(a/7))>s?o+1:s+1)&&(i=s,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((s=f.length)-(i=h.length)<0&&(i=s,e=h,h=f,f=e),r=0;i;)r=(f[--i]=f[i]+h[i]+r)/1e7|0,f[i]%=1e7;for(r&&(f.unshift(r),++n),s=f.length;0==f[--s];)f.pop();return t.d=f,t.e=P(f,n),c?S(t,a,u):t},_.precision=_.sd=function(t){var r;if(void 0!==t&&!!t!==t&&1!==t&&0!==t)throw Error(h+t);return this.d?(r=T(this.d),t&&this.e+1>r&&(r=this.e+1)):r=NaN,r},_.round=function(){var t=this.constructor;return S(new t(this),this.e+1,t.rounding)},_.sine=_.sin=function(){var t,r,e=this,n=e.constructor;return e.isFinite()?e.isZero()?new n(e):(t=n.precision,r=n.rounding,n.precision=t+Math.max(e.e,e.sd())+7,n.rounding=1,e=function(t,r){var e,n=r.d.length;if(n<3)return r.isZero()?r:U(t,2,r,r);e=(e=1.4*Math.sqrt(n))>16?16:0|e,r=U(t,2,r=r.times(1/Y(5,e)),r);for(var i,o=new t(5),s=new t(16),a=new t(20);e--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}(n,$(n,e)),n.precision=t,n.rounding=r,S(i>2?e.neg():e,t,r,!0)):new n(NaN)},_.squareRoot=_.sqrt=function(){var t,r,e,n,i,o,s=this.d,a=this.e,u=this.s,f=this.constructor;if(1!==u||!s||!s[0])return new f(!u||u<0&&(!s||s[0])?NaN:s?this:1/0);for(c=!1,0==(u=Math.sqrt(+this))||u==1/0?(((r=M(s)).length+a)%2==0&&(r+="0"),u=Math.sqrt(r),a=m((a+1)/2)-(a<0||a%2),n=new f(r=u==1/0?"5e"+a:(r=u.toExponential()).slice(0,r.indexOf("e")+1)+a)):n=new f(u.toString()),e=(a=f.precision)+3;;)if(n=(o=n).plus(z(this,o,e+2,1)).times(.5),M(o.d).slice(0,e)===(r=M(n.d)).slice(0,e)){if("9999"!=(r=r.slice(e-3,e+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(S(n,a+1,1),t=!n.times(n).eq(this));break}if(!i&&(S(o,a+1,0),o.times(o).eq(this))){n=o;break}e+=4,i=1}return c=!0,S(n,a,f.rounding,t)},_.tangent=_.tan=function(){var t,r,e=this,n=e.constructor;return e.isFinite()?e.isZero()?new n(e):(t=n.precision,r=n.rounding,n.precision=t+10,n.rounding=1,(e=e.sin()).s=1,e=z(e,new n(1).minus(e.times(e)).sqrt(),t+10,0),n.precision=t,n.rounding=r,S(2==i||4==i?e.neg():e,t,r,!0)):new n(NaN)},_.times=_.mul=function(t){var r,e,n,i,o,s,a,u,f,h=this.constructor,p=this.d,l=(t=new h(t)).d;if(t.s*=this.s,!p||!p[0]||!l||!l[0])return new h(!t.s||p&&!p[0]&&!l||l&&!l[0]&&!p?NaN:!p||!l?t.s/0:0*t.s);for(e=m(this.e/7)+m(t.e/7),(u=p.length)<(f=l.length)&&(o=p,p=l,l=o,s=u,u=f,f=s),o=[],n=s=u+f;n--;)o.push(0);for(n=f;--n>=0;){for(r=0,i=u+n;i>n;)a=o[i]+l[n]*p[i-n-1]+r,o[i--]=a%1e7|0,r=a/1e7|0;o[i]=(o[i]+r)%1e7|0}for(;!o[--s];)o.pop();return r?++e:o.shift(),t.d=o,t.e=P(o,e),c?S(t,h.precision,h.rounding):t},_.toBinary=function(t,r){return G(this,2,t,r)},_.toDecimalPlaces=_.toDP=function(t,r){var e=this,n=e.constructor;return(e=new n(e),void 0===t)?e:(E(t,0,1e9),void 0===r?r=n.rounding:E(r,0,8),S(e,t+e.e+1,r))},_.toExponential=function(t,r){var e,n=this,i=n.constructor;return void 0===t?e=C(n,!0):(E(t,0,1e9),void 0===r?r=i.rounding:E(r,0,8),e=C(n=S(new i(n),t+1,r),!0,t+1)),n.isNeg()&&!n.isZero()?"-"+e:e},_.toFixed=function(t,r){var e,n,i=this.constructor;return void 0===t?e=C(this):(E(t,0,1e9),void 0===r?r=i.rounding:E(r,0,8),e=C(n=S(new i(this),t+this.e+1,r),!1,t+n.e+1)),this.isNeg()&&!this.isZero()?"-"+e:e},_.toFraction=function(t){var r,e,n,i,o,s,a,u,f,p,l,d,m=this.d,v=this.constructor;if(!m)return new v(this);if(f=e=new v(1),n=u=new v(0),s=(o=(r=new v(n)).e=T(m)-this.e-1)%7,r.d[0]=g(10,s<0?7+s:s),null==t)t=o>0?r:f;else{if(!(a=new v(t)).isInt()||a.lt(f))throw Error(h+a);t=a.gt(r)?o>0?r:f:a}for(c=!1,a=new v(M(m)),p=v.precision,v.precision=o=7*m.length*2;l=z(a,r,0,1,1),1!=(i=e.plus(l.times(n))).cmp(t);)e=n,n=i,i=f,f=u.plus(l.times(i)),u=i,i=r,r=a.minus(l.times(i)),a=i;return i=z(t.minus(e),n,0,1,1),u=u.plus(i.times(f)),e=e.plus(i.times(n)),u.s=f.s=this.s,d=1>z(f,n,o,1).minus(this).abs().cmp(z(u,e,o,1).minus(this).abs())?[f,n]:[u,e],v.precision=p,c=!0,d},_.toHexadecimal=_.toHex=function(t,r){return G(this,16,t,r)},_.toNearest=function(t,r){var e=this,n=e.constructor;if(e=new n(e),null==t){if(!e.d)return e;t=new n(1),r=n.rounding}else{if(t=new n(t),void 0===r?r=n.rounding:E(r,0,8),!e.d)return t.s?e:t;if(!t.d)return t.s&&(t.s=e.s),t}return t.d[0]?(c=!1,e=z(e,t,0,r,1).times(t),c=!0,S(e)):(t.s=e.s,e=t),e},_.toNumber=function(){return+this},_.toOctal=function(t,r){return G(this,8,t,r)},_.toPower=_.pow=function(t){var r,e,n,i,o,s,a=this,u=a.constructor,f=+(t=new u(t));if(!a.d||!t.d||!a.d[0]||!t.d[0])return new u(g(+a,f));if((a=new u(a)).eq(1))return a;if(n=u.precision,o=u.rounding,t.eq(1))return S(a,n,o);if((r=m(t.e/7))>=t.d.length-1&&(e=f<0?-f:f)<=0x1fffffffffffff)return i=j(u,a,e,n),t.s<0?new u(1).div(i):S(i,n,o);if((s=a.s)<0){if(r<t.d.length-1)return new u(NaN);if((1&t.d[r])==0&&(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(r=0!=(e=g(+a,f))&&isFinite(e)?new u(e+"").e:m(f*(Math.log("0."+M(a.d))/Math.LN10+a.e+1)))>u.maxE+1||r<u.minE-1?new u(r>0?s/0:0):(c=!1,u.rounding=a.s=1,e=Math.min(12,(r+"").length),(i=q(t.times(B(a,n+e)),n)).d&&O((i=S(i,n+5,1)).d,n,o)&&(r=n+10,+M((i=S(q(t.times(B(a,r+e)),r),r+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=S(i,n+1,0))),i.s=s,c=!0,u.rounding=o,S(i,n,o))},_.toPrecision=function(t,r){var e,n=this,i=n.constructor;return void 0===t?e=C(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(E(t,1,1e9),void 0===r?r=i.rounding:E(r,0,8),e=C(n=S(new i(n),t,r),t<=n.e||n.e<=i.toExpNeg,t)),n.isNeg()&&!n.isZero()?"-"+e:e},_.toSignificantDigits=_.toSD=function(t,r){var e=this.constructor;return void 0===t?(t=e.precision,r=e.rounding):(E(t,1,1e9),void 0===r?r=e.rounding:E(r,0,8)),S(new e(this),t,r)},_.toString=function(){var t=this.constructor,r=C(this,this.e<=t.toExpNeg||this.e>=t.toExpPos);return this.isNeg()&&!this.isZero()?"-"+r:r},_.truncated=_.trunc=function(){return S(new this.constructor(this),this.e+1,1)},_.valueOf=_.toJSON=function(){var t=this.constructor,r=C(this,this.e<=t.toExpNeg||this.e>=t.toExpPos);return this.isNeg()?"-"+r:r};var z=function(){function t(t,r,e){var n,i=0,o=t.length;for(t=t.slice();o--;)n=t[o]*r+i,t[o]=n%e|0,i=n/e|0;return i&&t.unshift(i),t}function r(t,r,e,n){var i,o;if(e!=n)o=e>n?1:-1;else for(i=o=0;i<e;i++)if(t[i]!=r[i]){o=t[i]>r[i]?1:-1;break}return o}function e(t,r,e,n){for(var i=0;e--;)t[e]-=i,i=+(t[e]<r[e]),t[e]=i*n+t[e]-r[e];for(;!t[0]&&t.length>1;)t.shift()}return function(i,o,s,a,u,c){var f,h,p,l,d,g,v,y,w,x,N,b,_,M,E,O,A,z,C,P,F=i.constructor,I=i.s==o.s?1:-1,T=i.d,D=o.d;if(!T||!T[0]||!D||!D[0])return new F(!i.s||!o.s||(T?D&&T[0]==D[0]:!D)?NaN:T&&0==T[0]||!D?0*I:I/0);for(c?(d=1,h=i.e-o.e):(c=1e7,d=7,h=m(i.e/d)-m(o.e/d)),C=D.length,A=T.length,x=(w=new F(I)).d=[],p=0;D[p]==(T[p]||0);p++);if(D[p]>(T[p]||0)&&h--,null==s?(M=s=F.precision,a=F.rounding):M=u?s+(i.e-o.e)+1:s,M<0)x.push(1),g=!0;else{if(M=M/d+2|0,p=0,1==C){for(l=0,D=D[0],M++;(p<A||l)&&M--;p++)E=l*c+(T[p]||0),x[p]=E/D|0,l=E%D|0;g=l||p<A}else{for((l=c/(D[0]+1)|0)>1&&(D=t(D,l,c),T=t(T,l,c),C=D.length,A=T.length),O=C,b=(N=T.slice(0,C)).length;b<C;)N[b++]=0;(P=D.slice()).unshift(0),z=D[0],D[1]>=c/2&&++z;do l=0,(f=r(D,N,C,b))<0?(_=N[0],C!=b&&(_=_*c+(N[1]||0)),(l=_/z|0)>1?(l>=c&&(l=c-1),y=(v=t(D,l,c)).length,b=N.length,1==(f=r(v,N,y,b))&&(l--,e(v,C<y?P:D,y,c))):(0==l&&(f=l=1),v=D.slice()),(y=v.length)<b&&v.unshift(0),e(N,v,b,c),-1==f&&(b=N.length,(f=r(D,N,C,b))<1&&(l++,e(N,C<b?P:D,b,c))),b=N.length):0===f&&(l++,N=[0]),x[p++]=l,f&&N[0]?N[b++]=T[O]||0:(N=[T[O]],b=1);while((O++<A||void 0!==N[0])&&M--);g=void 0!==N[0]}x[0]||x.shift()}if(1==d)w.e=h,n=g;else{for(p=1,l=x[0];l>=10;l/=10)p++;w.e=p+h*d-1,S(w,u?s+w.e+1:s,a,g)}return w}}();function S(t,r,e,n){var i,o,s,a,u,f,h,p,l,d=t.constructor;t:if(null!=r){if(!(p=t.d))return t;for(i=1,a=p[0];a>=10;a/=10)i++;if((o=r-i)<0)o+=7,s=r,u=(h=p[l=0])/g(10,i-s-1)%10|0;else if((l=Math.ceil((o+1)/7))>=(a=p.length))if(n){for(;a++<=l;)p.push(0);h=u=0,i=1,o%=7,s=o-7+1}else break t;else{for(i=1,h=a=p[l];a>=10;a/=10)i++;o%=7,u=(s=o-7+i)<0?0:h/g(10,i-s-1)%10|0}if(n=n||r<0||void 0!==p[l+1]||(s<0?h:h%g(10,i-s-1)),f=e<4?(u||n)&&(0==e||e==(t.s<0?3:2)):u>5||5==u&&(4==e||n||6==e&&(o>0?s>0?h/g(10,i-s):0:p[l-1])%10&1||e==(t.s<0?8:7)),r<1||!p[0])return p.length=0,f?(r-=t.e+1,p[0]=g(10,(7-r%7)%7),t.e=-r||0):p[0]=t.e=0,t;if(0==o?(p.length=l,a=1,l--):(p.length=l+1,a=g(10,7-o),p[l]=s>0?(h/g(10,i-s)%g(10,s)|0)*a:0),f)for(;;)if(0==l){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,1e7==p[0]&&(p[0]=1));break}else{if(p[l]+=a,1e7!=p[l])break;p[l--]=0,a=1}for(o=p.length;0===p[--o];)p.pop()}return c&&(t.e>d.maxE?(t.d=null,t.e=NaN):t.e<d.minE&&(t.e=0,t.d=[0])),t}function C(t,r,e){if(!t.isFinite())return Z(t);var n,i=t.e,o=M(t.d),s=o.length;return r?(e&&(n=e-s)>0?o=o.charAt(0)+"."+o.slice(1)+D(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+D(-i-1)+o,e&&(n=e-s)>0&&(o+=D(n))):i>=s?(o+=D(i+1-s),e&&(n=e-i-1)>0&&(o=o+"."+D(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),e&&(n=e-s)>0&&(i+1===s&&(o+="."),o+=D(n))),o}function P(t,r){var e=t[0];for(r*=7;e>=10;e/=10)r++;return r}function F(t,r,e){if(r>N)throw c=!0,e&&(t.precision=e),Error(p);return S(new t(s),r,1,!0)}function I(t,r,e){if(r>b)throw Error(p);return S(new t(a),r,e,!0)}function T(t){var r=t.length-1,e=7*r+1;if(r=t[r]){for(;r%10==0;r/=10)e--;for(r=t[0];r>=10;r/=10)e++}return e}function D(t){for(var r="";t--;)r+="0";return r}function j(t,r,e,n){var i,o=new t(1),s=Math.ceil(n/7+4);for(c=!1;;){if(e%2&&Q((o=o.times(r)).d,s)&&(i=!0),0===(e=m(e/2))){e=o.d.length-1,i&&0===o.d[e]&&++o.d[e];break}Q((r=r.times(r)).d,s)}return c=!0,o}function k(t){return 1&t.d[t.d.length-1]}function R(t,r,e){for(var n,i,o=new t(r[0]),s=0;++s<r.length;){if(!(i=new t(r[s])).s){o=i;break}((n=o.cmp(i))===e||0===n&&o.s===e)&&(o=i)}return o}function q(t,r){var e,n,i,o,s,a,u,f=0,h=0,p=0,l=t.constructor,d=l.rounding,m=l.precision;if(!t.d||!t.d[0]||t.e>17)return new l(t.d?!t.d[0]?1:t.s<0?0:1/0:t.s?t.s<0?0:t:0/0);for(null==r?(c=!1,u=m):u=r,a=new l(.03125);t.e>-2;)t=t.times(a),p+=5;for(u+=n=Math.log(g(2,p))/Math.LN10*2+5|0,e=o=s=new l(1),l.precision=u;;){if(o=S(o.times(t),u,1),e=e.times(++h),M((a=s.plus(z(o,e,u,1))).d).slice(0,u)===M(s.d).slice(0,u)){for(i=p;i--;)s=S(s.times(s),u,1);if(null!=r)return l.precision=m,s;if(!(f<3&&O(s.d,u-n,d,f)))return S(s,l.precision=m,d,c=!0);l.precision=u+=10,e=o=a=new l(1),h=0,f++}s=a}}function B(t,r){var e,n,i,o,s,a,u,f,h,p,l,d=1,m=t,g=m.d,v=m.constructor,y=v.rounding,w=v.precision;if(m.s<0||!g||!g[0]||!m.e&&1==g[0]&&1==g.length)return new v(g&&!g[0]?-1/0:1!=m.s?NaN:g?0:m);if(null==r?(c=!1,h=w):h=r,v.precision=h+=10,n=(e=M(g)).charAt(0),!(15e14>Math.abs(o=m.e)))return f=F(v,h+2,w).times(o+""),m=B(new v(n+"."+e.slice(1)),h-10).plus(f),v.precision=w,null==r?S(m,w,y,c=!0):m;for(;n<7&&1!=n||1==n&&e.charAt(1)>3;)n=(e=M((m=m.times(t)).d)).charAt(0),d++;for(o=m.e,n>1?(m=new v("0."+e),o++):m=new v(n+"."+e.slice(1)),p=m,u=s=m=z(m.minus(1),m.plus(1),h,1),l=S(m.times(m),h,1),i=3;;){if(s=S(s.times(l),h,1),M((f=u.plus(z(s,new v(i),h,1))).d).slice(0,h)===M(u.d).slice(0,h)){if(u=u.times(2),0!==o&&(u=u.plus(F(v,h+2,w).times(o+""))),u=z(u,new v(d),h,1),null!=r)return v.precision=w,u;if(!O(u.d,h-10,y,a))return S(u,v.precision=w,y,c=!0);v.precision=h+=10,f=s=m=z(p.minus(1),p.plus(1),h,1),l=S(m.times(m),h,1),i=a=1}u=f,i+=2}}function Z(t){return String(t.s*t.s/0)}function L(t,r){var e,n,i;for((e=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(e<0&&(e=n),e+=+r.slice(n+1),r=r.substring(0,n)):e<0&&(e=r.length),n=0;48===r.charCodeAt(n);n++);for(i=r.length;48===r.charCodeAt(i-1);--i);if(r=r.slice(n,i)){if(i-=n,t.e=e=e-n-1,t.d=[],n=(e+1)%7,e<0&&(n+=7),n<i){for(n&&t.d.push(+r.slice(0,n)),i-=7;n<i;)t.d.push(+r.slice(n,n+=7));n=7-(r=r.slice(n)).length}else n-=i;for(;n--;)r+="0";t.d.push(+r),c&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function U(t,r,e,n,i){var o,s,a,u,f=t.precision,h=Math.ceil(f/7);for(c=!1,u=e.times(e),a=new t(n);;){if(s=z(a.times(u),new t(r++*r++),f,1),a=i?n.plus(s):n.minus(s),n=z(s.times(u),new t(r++*r++),f,1),void 0!==(s=a.plus(n)).d[h]){for(o=h;s.d[o]===a.d[o]&&o--;);if(-1==o)break}o=a,a=n,n=s,s=o}return c=!0,s.d.length=h+1,s}function Y(t,r){for(var e=t;--r;)e*=t;return e}function $(t,r){var e,n=r.s<0,o=I(t,t.precision,1),s=o.times(.5);if((r=r.abs()).lte(s))return i=n?4:1,r;if((e=r.divToInt(o)).isZero())i=n?3:2;else{if((r=r.minus(e.times(o))).lte(s))return i=k(e)?n?2:3:n?4:1,r;i=k(e)?n?1:4:n?3:2}return r.minus(o).abs()}function G(t,r,e,i){var s,a,u,c,f,h,p,l,d,m=t.constructor,g=void 0!==e;if(g?(E(e,1,1e9),void 0===i?i=m.rounding:E(i,0,8)):(e=m.precision,i=m.rounding),t.isFinite()){for(u=(p=C(t)).indexOf("."),g?(s=2,16==r?e=4*e-3:8==r&&(e=3*e-2)):s=r,u>=0&&(p=p.replace(".",""),(d=new m(1)).e=p.length-u,d.d=A(C(d),10,s),d.e=d.d.length),a=f=(l=A(p,10,s)).length;0==l[--f];)l.pop();if(l[0]){if(u<0?a--:((t=new m(t)).d=l,t.e=a,l=(t=z(t,d,e,i,0,s)).d,a=t.e,h=n),u=l[e],c=s/2,h=h||void 0!==l[e+1],h=i<4?(void 0!==u||h)&&(0===i||i===(t.s<0?3:2)):u>c||u===c&&(4===i||h||6===i&&1&l[e-1]||i===(t.s<0?8:7)),l.length=e,h)for(;++l[--e]>s-1;)l[e]=0,e||(++a,l.unshift(1));for(f=l.length;!l[f-1];--f);for(u=0,p="";u<f;u++)p+=o.charAt(l[u]);if(g){if(f>1)if(16==r||8==r){for(u=16==r?4:3,--f;f%u;f++)p+="0";for(f=(l=A(p,s,r)).length;!l[f-1];--f);for(u=1,p="1.";u<f;u++)p+=o.charAt(l[u])}else p=p.charAt(0)+"."+p.slice(1);p=p+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)p="0"+p;p="0."+p}else if(++a>f)for(a-=f;a--;)p+="0";else a<f&&(p=p.slice(0,a)+"."+p.slice(a))}else p=g?"0p+0":"0";p=(16==r?"0x":2==r?"0b":8==r?"0o":"")+p}else p=Z(t);return t.s<0?"-"+p:p}function Q(t,r){if(t.length>r)return t.length=r,!0}function H(t){return new this(t).abs()}function J(t){return new this(t).acos()}function W(t){return new this(t).acosh()}function V(t,r){return new this(t).plus(r)}function K(t){return new this(t).asin()}function X(t){return new this(t).asinh()}function tt(t){return new this(t).atan()}function tr(t){return new this(t).atanh()}function te(t,r){t=new this(t),r=new this(r);var e,n=this.precision,i=this.rounding,o=n+4;return t.s&&r.s?t.d||r.d?!r.d||t.isZero()?(e=r.s<0?I(this,n,i):new this(0)).s=t.s:!t.d||r.isZero()?(e=I(this,o,1).times(.5)).s=t.s:r.s<0?(this.precision=o,this.rounding=1,e=this.atan(z(t,r,o,1)),r=I(this,o,1),this.precision=n,this.rounding=i,e=t.s<0?e.minus(r):e.plus(r)):e=this.atan(z(t,r,o,1)):(e=I(this,o,1).times(r.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function tn(t){return new this(t).cbrt()}function ti(t){return S(t=new this(t),t.e+1,2)}function to(t,r,e){return new this(t).clamp(r,e)}function ts(t){if(!t||"object"!=typeof t)throw Error(f+"Object expected");var r,e,n,i=!0===t.defaults,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,9e15,"maxE",0,9e15,"minE",-9e15,0,"modulo",0,9];for(r=0;r<o.length;r+=3)if(e=o[r],i&&(this[e]=u[e]),void 0!==(n=t[e]))if(m(n)===n&&n>=o[r+1]&&n<=o[r+2])this[e]=n;else throw Error(h+e+": "+n);if(e="crypto",i&&(this[e]=u[e]),void 0!==(n=t[e]))if(!0===n||!1===n||0===n||1===n)if(n)if("u">typeof crypto&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[e]=!0;else throw Error(l);else this[e]=!1;else throw Error(h+e+": "+n);return this}function ta(t){return new this(t).cos()}function tu(t){return new this(t).cosh()}function tc(t,r){return new this(t).div(r)}function tf(t){return new this(t).exp()}function th(t){return S(t=new this(t),t.e+1,3)}function tp(){var t,r,e=new this(0);for(t=0,c=!1;t<arguments.length;)if(r=new this(arguments[t++]),r.d)e.d&&(e=e.plus(r.times(r)));else{if(r.s)return c=!0,new this(1/0);e=r}return c=!0,e.sqrt()}function tl(t){return t instanceof tT||t&&t.toStringTag===d||!1}function td(t){return new this(t).ln()}function tm(t,r){return new this(t).log(r)}function tg(t){return new this(t).log(2)}function tv(t){return new this(t).log(10)}function ty(){return R(this,arguments,-1)}function tw(){return R(this,arguments,1)}function tx(t,r){return new this(t).mod(r)}function tN(t,r){return new this(t).mul(r)}function tb(t,r){return new this(t).pow(r)}function t_(t){var r,e,n,i,o=0,s=new this(1),a=[];if(void 0===t?t=this.precision:E(t,1,1e9),n=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(r=crypto.getRandomValues(new Uint32Array(n));o<n;)(i=r[o])>=429e7?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o<n;)(i=r[o]+(r[o+1]<<8)+(r[o+2]<<16)+((127&r[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(l);else for(;o<n;)a[o++]=1e7*Math.random()|0;for(n=a[--o],t%=7,n&&t&&(i=g(10,7-t),a[o]=(n/i|0)*i);0===a[o];o--)a.pop();if(o<0)e=0,a=[0];else{for(e=-1;0===a[0];e-=7)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<7&&(e-=7-n)}return s.e=e,s.d=a,s}function tM(t){return S(t=new this(t),t.e+1,this.rounding)}function tE(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function tO(t){return new this(t).sin()}function tA(t){return new this(t).sinh()}function tz(t){return new this(t).sqrt()}function tS(t,r){return new this(t).sub(r)}function tC(){var t=0,r=arguments,e=new this(r[0]);for(c=!1;e.s&&++t<r.length;)e=e.plus(r[t]);return c=!0,S(e,this.precision,this.rounding)}function tP(t){return new this(t).tan()}function tF(t){return new this(t).tanh()}function tI(t){return S(t=new this(t),t.e+1,1)}_[Symbol.for("nodejs.util.inspect.custom")]=_.toString,_[Symbol.toStringTag]="Decimal";var tT=_.constructor=function t(r){var e,n,i;function o(t){var r,e,n;if(!(this instanceof o))return new o(t);if(this.constructor=o,tl(t)){this.s=t.s,c?!t.d||t.e>o.maxE?(this.e=NaN,this.d=null):t.e<o.minE?(this.e=0,this.d=[0]):(this.e=t.e,this.d=t.d.slice()):(this.e=t.e,this.d=t.d?t.d.slice():t.d);return}if("number"==(n=typeof t)){if(0===t){this.s=1/t<0?-1:1,this.e=0,this.d=[0];return}if(t<0?(t=-t,this.s=-1):this.s=1,t===~~t&&t<1e7){for(r=0,e=t;e>=10;e/=10)r++;c?r>o.maxE?(this.e=NaN,this.d=null):r<o.minE?(this.e=0,this.d=[0]):(this.e=r,this.d=[t]):(this.e=r,this.d=[t]);return}if(0*t!=0){t||(this.s=NaN),this.e=NaN,this.d=null;return}return L(this,t.toString())}if("string"===n)return 45===(e=t.charCodeAt(0))?(t=t.slice(1),this.s=-1):(43===e&&(t=t.slice(1)),this.s=1),x.test(t)?L(this,t):function(t,r){var e,n,i,o,s,a,u,f,p;if(r.indexOf("_")>-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),x.test(r))return L(t,r)}else if("Infinity"===r||"NaN"===r)return+r||(t.s=NaN),t.e=NaN,t.d=null,t;if(y.test(r))e=16,r=r.toLowerCase();else if(v.test(r))e=2;else if(w.test(r))e=8;else throw Error(h+r);for((o=r.search(/p/i))>0?(u=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),s=(o=r.indexOf("."))>=0,n=t.constructor,s&&(o=(a=(r=r.replace(".","")).length)-o,i=j(n,new n(e),o,2*o)),o=p=(f=A(r,e,1e7)).length-1;0===f[o];--o)f.pop();return o<0?new n(0*t.s):(t.e=P(f,p),t.d=f,c=!1,s&&(t=z(t,i,4*a)),u&&(t=t.times(54>Math.abs(u)?g(2,u):tT.pow(2,u))),c=!0,t)}(this,t);if("bigint"===n)return t<0?(t=-t,this.s=-1):this.s=1,L(this,t.toString());throw Error(h+t)}if(o.prototype=_,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=ts,o.clone=t,o.isDecimal=tl,o.abs=H,o.acos=J,o.acosh=W,o.add=V,o.asin=K,o.asinh=X,o.atan=tt,o.atanh=tr,o.atan2=te,o.cbrt=tn,o.ceil=ti,o.clamp=to,o.cos=ta,o.cosh=tu,o.div=tc,o.exp=tf,o.floor=th,o.hypot=tp,o.ln=td,o.log=tm,o.log10=tv,o.log2=tg,o.max=ty,o.min=tw,o.mod=tx,o.mul=tN,o.pow=tb,o.random=t_,o.round=tM,o.sign=tE,o.sin=tO,o.sinh=tA,o.sqrt=tz,o.sub=tS,o.sum=tC,o.tan=tP,o.tanh=tF,o.trunc=tI,void 0===r&&(r={}),r&&!0!==r.defaults)for(e=0,i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"];e<i.length;)r.hasOwnProperty(n=i[e++])||(r[n]=this[n]);return o.config(r),o}(u);s=new tT(s),a=new tT(a);var tD=e(1207),tj={createBigNumberClass:(0,tD.P9)("BigNumber",["?on","config"],t=>{var{on:r,config:e}=t,n=tT.clone({precision:e.precision,modulo:tT.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(t){return new n(t.value)},r&&r("config",function(t,r){t.precision!==r.precision&&n.config({precision:t.precision})}),n},{isClass:!0})},tk={createMatrixClass:(0,tD.P9)("Matrix",[],()=>{function t(){if(!(this instanceof t))throw SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,r){throw Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,r,e){throw Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,r,e){throw Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,r){throw Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,r){throw Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,r){throw Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0})},tR=e(46797),tq=e(49204),tB=e(93988),tZ=e(55624),tL=e(32718),tU=e(15562),tY={MatrixDependencies:tk,createDenseMatrixClass:(0,tD.P9)("DenseMatrix",["Matrix"],t=>{var{Matrix:r}=t;function e(t,r){if(!(this instanceof e))throw SyntaxError("Constructor must be called with the new operator");if(r&&!(0,tR.Kg)(r))throw Error("Invalid datatype: "+r);if((0,tR.OA)(t))"DenseMatrix"===t.type?(this._data=(0,tL.o8)(t._data),this._size=(0,tL.o8)(t._size)):(this._data=t.toArray(),this._size=t.size()),this._datatype=r||t._datatype;else if(t&&(0,tR.cy)(t.data)&&(0,tR.cy)(t.size))this._data=t.data,this._size=t.size,(0,tq.tf)(this._data,this._size),this._datatype=r||t.datatype;else if((0,tR.cy)(t))this._data=function t(r){for(var e=0,n=r.length;e<n;e++){var i=r[e];(0,tR.cy)(i)?r[e]=t(i):i&&!0===i.isMatrix&&(r[e]=t(i.valueOf()))}return r}(t),this._size=(0,tq.LO)(this._data),(0,tq.tf)(this._data,this._size),this._datatype=r;else if(t)throw TypeError("Unsupported type of data ("+(0,tR.QP)(t)+")");else this._data=[],this._size=[0],this._datatype=r}function n(t,r,e){if(0===r.length){for(var n=t._data;(0,tR.cy)(n);)n=n[0];return n}return t._size=r.slice(0),t._data=(0,tq.XR)(t._data,t._size,e),t}function i(t,r,e){for(var i=t._size.slice(0),o=!1;i.length<r.length;)i.push(0),o=!0;for(var s=0,a=r.length;s<a;s++)r[s]>i[s]&&(i[s]=r[s],o=!0);o&&n(t,i,e)}return e.prototype=new r,e.prototype.createDenseMatrix=function(t,r){return new e(t,r)},e.prototype.type="DenseMatrix",e.prototype.isDenseMatrix=!0,e.prototype.getDataType=function(){return(0,tq.ig)(this._data,tR.QP)},e.prototype.storage=function(){return"dense"},e.prototype.datatype=function(){return this._datatype},e.prototype.create=function(t,r){return new e(t,r)},e.prototype.subset=function(t,r,n){switch(arguments.length){case 1:return function(t,r){if(!(0,tR.nw)(r))throw TypeError("Invalid index");if(r.isScalar())return t.get(r.min());var n=r.size();if(n.length!==t._size.length)throw new tU.h(n.length,t._size.length);for(var i=r.min(),o=r.max(),s=0,a=t._size.length;s<a;s++)(0,tq.r7)(i[s],t._size[s]),(0,tq.r7)(o[s],t._size[s]);return new e(function t(r,e,n,i){var o=i===n-1,s=e.dimension(i);return o?s.map(function(t){return(0,tq.r7)(t,r.length),r[t]}).valueOf():s.map(function(o){return(0,tq.r7)(o,r.length),t(r[o],e,n,i+1)}).valueOf()}(t._data,r,n.length,0),t._datatype)}(this,t);case 2:case 3:return function(t,r,e,n){if(!r||!0!==r.isIndex)throw TypeError("Invalid index");var o,s=r.size(),a=r.isScalar();if((0,tR.OA)(e)?(o=e.size(),e=e.valueOf()):o=(0,tq.LO)(e),a){if(0!==o.length)throw TypeError("Scalar expected");t.set(r.min(),e,n)}else{if(s.length<t._size.length)throw new tU.h(s.length,t._size.length,"<");if(o.length<s.length){for(var u=0,c=0;1===s[u]&&1===o[u];)u++;for(;1===s[u];)c++,u++;e=(0,tq.iD)(e,s.length,c,o)}if(!(0,tL.QO)(s,o))throw new tU.h(s,o,">");i(t,r.max().map(function(t){return t+1}),n);var f=s.length;!function t(r,e,n,i,o){var s=o===i-1,a=e.dimension(o);s?a.forEach(function(t,e){(0,tq.r7)(t),r[t]=n[e[0]]}):a.forEach(function(s,a){(0,tq.r7)(s),t(r[s],e,n[a[0]],i,o+1)})}(t._data,r,e,f,0)}return t}(this,t,r,n);default:throw SyntaxError("Wrong number of arguments")}},e.prototype.get=function(t){if(!(0,tR.cy)(t))throw TypeError("Array expected");if(t.length!==this._size.length)throw new tU.h(t.length,this._size.length);for(var r=0;r<t.length;r++)(0,tq.r7)(t[r],this._size[r]);for(var e=this._data,n=0,i=t.length;n<i;n++){var o=t[n];(0,tq.r7)(o,e.length),e=e[o]}return e},e.prototype.set=function(t,r,e){if(!(0,tR.cy)(t))throw TypeError("Array expected");if(t.length<this._size.length)throw new tU.h(t.length,this._size.length,"<");i(this,t.map(function(t){return t+1}),e);var n,o,s,a=this._data;for(n=0,o=t.length-1;n<o;n++)s=t[n],(0,tq.r7)(s,a.length),a=a[s];return s=t[t.length-1],(0,tq.r7)(s,a.length),a[s]=r,this},e.prototype.resize=function(t,r,e){if(!(0,tR.P3)(t))throw TypeError("Array or Matrix expected");var i=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);return n(e?this.clone():this,i,r)},e.prototype.reshape=function(t,r){var e=r?this.clone():this;e._data=(0,tq.tQ)(e._data,t);var n=e._size.reduce((t,r)=>t*r);return e._size=(0,tq.cs)(t,n),e},e.prototype.clone=function(){return new e({data:(0,tL.o8)(this._data),size:(0,tL.o8)(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var r=this,n=function e(n,i){return(0,tR.cy)(n)?n.map(function(t,r){return e(t,i.concat(r))}):t(n,i,r)}(this._data,[]),i=void 0!==this._datatype?(0,tq.ig)(n,tR.QP):void 0;return new e(n,i)},e.prototype.forEach=function(t){var r=this;!function e(n,i){(0,tR.cy)(n)?n.forEach(function(t,r){e(t,i.concat(r))}):t(n,i,r)}(this._data,[])},e.prototype[Symbol.iterator]=function*(){var t=function* t(r,e){if((0,tR.cy)(r))for(var n=0;n<r.length;n++)yield*t(r[n],e.concat(n));else yield{value:r,index:e}};yield*t(this._data,[])},e.prototype.rows=function(){var t=[];if(2!==this.size().length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var r of this._data)t.push(new e([r],this._datatype));return t},e.prototype.columns=function(){var t=this,r=[],n=this.size();if(2!==n.length)throw TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,o=function(n){var o=i.map(t=>[t[n]]);r.push(new e(o,t._datatype))},s=0;s<n[1];s++)o(s);return r},e.prototype.toArray=function(){return(0,tL.o8)(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return(0,tB.GP)(this._data,t)},e.prototype.toString=function(){return(0,tB.GP)(this._data)},e.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},e.prototype.diagonal=function(t){if(t){if((0,tR.C4)(t)&&(t=t.toNumber()),!(0,tR.Et)(t)||!(0,tZ.YN)(t))throw TypeError("The parameter k must be an integer number")}else t=0;for(var r=t>0?t:0,n=t<0?-t:0,i=Math.min(this._size[0]-n,this._size[1]-r),o=[],s=0;s<i;s++)o[s]=this._data[s+n][s+r];return new e({data:o,size:[i],datatype:this._datatype})},e.diagonal=function(t,r,n,i){if(!(0,tR.cy)(t))throw TypeError("Array expected, size parameter");if(2!==t.length)throw Error("Only two dimensions matrix are supported");if(t=t.map(function(t){if((0,tR.C4)(t)&&(t=t.toNumber()),!(0,tR.Et)(t)||!(0,tZ.YN)(t)||t<1)throw Error("Size values must be positive integers");return t}),n){if((0,tR.C4)(n)&&(n=n.toNumber()),!(0,tR.Et)(n)||!(0,tZ.YN)(n))throw TypeError("The parameter k must be an integer number")}else n=0;var o,s=n>0?n:0,a=n<0?-n:0,u=t[0],c=t[1],f=Math.min(u-a,c-s);if((0,tR.cy)(r)){if(r.length!==f)throw Error("Invalid value array length");o=function(t){return r[t]}}else if((0,tR.OA)(r)){var h=r.size();if(1!==h.length||h[0]!==f)throw Error("Invalid matrix length");o=function(t){return r.get([t])}}else o=function(){return r};i||(i=(0,tR.C4)(o(0))?o(0).mul(0):0);var p=[];if(t.length>0){p=(0,tq.XR)(p,t,i);for(var l=0;l<f;l++)p[l+a][l+s]=o(l)}return new e({data:p,size:[u,c]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,r){if(!(0,tR.Et)(t)||!(0,tZ.YN)(t)||!(0,tR.Et)(r)||!(0,tZ.YN)(r))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return(0,tq.r7)(t,this._size[0]),(0,tq.r7)(r,this._size[0]),e._swapRows(t,r,this._data),this},e._swapRows=function(t,r,e){var n=e[t];e[t]=e[r],e[r]=n},e},{isClass:!0})};let t$=Math.cosh||function(t){return 1e-9>Math.abs(t)?1-t:(Math.exp(t)+Math.exp(-t))*.5},tG=Math.sinh||function(t){return 1e-9>Math.abs(t)?t:(Math.exp(t)-Math.exp(-t))*.5},tQ=function(t,r){return((t=Math.abs(t))<(r=Math.abs(r))&&([t,r]=[r,t]),t<1e8)?Math.sqrt(t*t+r*r):(r/=t,t*Math.sqrt(1+r*r))},tH=function(){throw SyntaxError("Invalid Param")};function tJ(t,r){let e=Math.abs(t),n=Math.abs(r);return 0===t?Math.log(n):0===r?Math.log(e):e<3e3&&n<3e3?.5*Math.log(t*t+r*r):.5*Math.log((t*=.5)*t+(r*=.5)*r)+Math.LN2}let tW={re:0,im:0},tV=function(t,r){if(null==t)tW.re=tW.im=0;else if(void 0!==r)tW.re=t,tW.im=r;else switch(typeof t){case"object":if("im"in t&&"re"in t)tW.re=t.re,tW.im=t.im;else if("abs"in t&&"arg"in t){if(!isFinite(t.abs)&&isFinite(t.arg))return tK.INFINITY;tW.re=t.abs*Math.cos(t.arg),tW.im=t.abs*Math.sin(t.arg)}else if("r"in t&&"phi"in t){if(!isFinite(t.r)&&isFinite(t.phi))return tK.INFINITY;tW.re=t.r*Math.cos(t.phi),tW.im=t.r*Math.sin(t.phi)}else 2===t.length?(tW.re=t[0],tW.im=t[1]):tH();break;case"string":tW.im=tW.re=0;let e=t.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),n=1,i=0;null===e&&tH();for(let t=0;t<e.length;t++){let r=e[t];" "===r||" "===r||"\n"===r||("+"===r?n++:"-"===r?i++:("i"===r||"I"===r?(n+i===0&&tH()," "===e[t+1]||isNaN(e[t+1])?tW.im+=parseFloat((i%2?"-":"")+"1"):(tW.im+=parseFloat((i%2?"-":"")+e[t+1]),t++)):((n+i===0||isNaN(r))&&tH(),"i"===e[t+1]||"I"===e[t+1]?(tW.im+=parseFloat((i%2?"-":"")+r),t++):tW.re+=parseFloat((i%2?"-":"")+r)),n=i=0))}n+i>0&&tH();break;case"number":tW.im=0,tW.re=t;break;default:tH()}return isNaN(tW.re)||isNaN(tW.im),tW};function tK(t,r){if(!(this instanceof tK))return new tK(t,r);let e=tV(t,r);this.re=e.re,this.im=e.im}tK.prototype={re:0,im:0,sign:function(){let t=tQ(this.re,this.im);return new tK(this.re/t,this.im/t)},add:function(t,r){let e=tV(t,r),n=this.isInfinite(),i=!(isFinite(e.re)&&isFinite(e.im));return n||i?n&&i?tK.NAN:tK.INFINITY:new tK(this.re+e.re,this.im+e.im)},sub:function(t,r){let e=tV(t,r),n=this.isInfinite(),i=!(isFinite(e.re)&&isFinite(e.im));return n||i?n&&i?tK.NAN:tK.INFINITY:new tK(this.re-e.re,this.im-e.im)},mul:function(t,r){let e=tV(t,r),n=this.isInfinite(),i=!(isFinite(e.re)&&isFinite(e.im)),o=0===this.re&&0===this.im,s=0===e.re&&0===e.im;return n&&s||i&&o?tK.NAN:n||i?tK.INFINITY:0===e.im&&0===this.im?new tK(this.re*e.re,0):new tK(this.re*e.re-this.im*e.im,this.re*e.im+this.im*e.re)},div:function(t,r){let e=tV(t,r),n=this.isInfinite(),i=!(isFinite(e.re)&&isFinite(e.im)),o=0===this.re&&0===this.im,s=0===e.re&&0===e.im;if(o&&s||n&&i)return tK.NAN;if(s||n)return tK.INFINITY;if(o||i)return tK.ZERO;if(0===e.im)return new tK(this.re/e.re,this.im/e.re);if(Math.abs(e.re)<Math.abs(e.im)){let t=e.re/e.im,r=e.re*t+e.im;return new tK((this.re*t+this.im)/r,(this.im*t-this.re)/r)}{let t=e.im/e.re,r=e.im*t+e.re;return new tK((this.re+this.im*t)/r,(this.im-this.re*t)/r)}},pow:function(t,r){let e=tV(t,r),n=0===this.re&&0===this.im;if(0===e.re&&0===e.im)return tK.ONE;if(0===e.im){if(0===this.im&&this.re>0)return new tK(Math.pow(this.re,e.re),0);else if(0===this.re)switch((e.re%4+4)%4){case 0:return new tK(Math.pow(this.im,e.re),0);case 1:return new tK(0,Math.pow(this.im,e.re));case 2:return new tK(-Math.pow(this.im,e.re),0);case 3:return new tK(0,-Math.pow(this.im,e.re))}}if(n&&e.re>0)return tK.ZERO;let i=Math.atan2(this.im,this.re),o=tJ(this.re,this.im),s=Math.exp(e.re*o-e.im*i),a=e.im*o+e.re*i;return new tK(s*Math.cos(a),s*Math.sin(a))},sqrt:function(){let t=this.re,r=this.im;if(0===r)if(t>=0)return new tK(Math.sqrt(t),0);else return new tK(0,Math.sqrt(-t));let e=Math.sqrt(.5*(tQ(t,r)+Math.abs(t))),n=Math.abs(r)/(2*e);return t>=0?new tK(e,r<0?-n:n):new tK(n,r<0?-e:e)},exp:function(){let t=Math.exp(this.re);return 0===this.im?new tK(t,0):new tK(t*Math.cos(this.im),t*Math.sin(this.im))},expm1:function(){let t,r=this.re,e=this.im;return new tK(Math.expm1(r)*Math.cos(e)+-2*(t=Math.sin(.5*e))*t,Math.exp(r)*Math.sin(e))},log:function(){let t=this.re,r=this.im;return 0===r&&t>0?new tK(Math.log(t),0):new tK(tJ(t,r),Math.atan2(r,t))},abs:function(){return tQ(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let t=this.re,r=this.im;return new tK(Math.sin(t)*t$(r),Math.cos(t)*tG(r))},cos:function(){let t=this.re,r=this.im;return new tK(Math.cos(t)*t$(r),-Math.sin(t)*tG(r))},tan:function(){let t=2*this.re,r=2*this.im,e=Math.cos(t)+t$(r);return new tK(Math.sin(t)/e,tG(r)/e)},cot:function(){let t=2*this.re,r=2*this.im,e=Math.cos(t)-t$(r);return new tK(-Math.sin(t)/e,tG(r)/e)},sec:function(){let t=this.re,r=this.im,e=.5*t$(2*r)+.5*Math.cos(2*t);return new tK(Math.cos(t)*t$(r)/e,Math.sin(t)*tG(r)/e)},csc:function(){let t=this.re,r=this.im,e=.5*t$(2*r)-.5*Math.cos(2*t);return new tK(Math.sin(t)*t$(r)/e,-Math.cos(t)*tG(r)/e)},asin:function(){let t=this.re,r=this.im,e=new tK(r*r-t*t+1,-2*t*r).sqrt(),n=new tK(e.re-r,e.im+t).log();return new tK(n.im,-n.re)},acos:function(){let t=this.re,r=this.im,e=new tK(r*r-t*t+1,-2*t*r).sqrt(),n=new tK(e.re-r,e.im+t).log();return new tK(Math.PI/2-n.im,n.re)},atan:function(){let t=this.re,r=this.im;if(0===t){if(1===r)return new tK(0,1/0);if(-1===r)return new tK(0,-1/0)}let e=t*t+(1-r)*(1-r),n=new tK((1-r*r-t*t)/e,-2*t/e).log();return new tK(-.5*n.im,.5*n.re)},acot:function(){let t=this.re,r=this.im;if(0===r)return new tK(Math.atan2(1,t),0);let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).atan():new tK(0!==t?t/0:0,0!==r?-r/0:0).atan()},asec:function(){let t=this.re,r=this.im;if(0===t&&0===r)return new tK(0,1/0);let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).acos():new tK(0!==t?t/0:0,0!==r?-r/0:0).acos()},acsc:function(){let t=this.re,r=this.im;if(0===t&&0===r)return new tK(Math.PI/2,1/0);let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).asin():new tK(0!==t?t/0:0,0!==r?-r/0:0).asin()},sinh:function(){let t=this.re,r=this.im;return new tK(tG(t)*Math.cos(r),t$(t)*Math.sin(r))},cosh:function(){let t=this.re,r=this.im;return new tK(t$(t)*Math.cos(r),tG(t)*Math.sin(r))},tanh:function(){let t=2*this.re,r=2*this.im,e=t$(t)+Math.cos(r);return new tK(tG(t)/e,Math.sin(r)/e)},coth:function(){let t=2*this.re,r=2*this.im,e=t$(t)-Math.cos(r);return new tK(tG(t)/e,-Math.sin(r)/e)},csch:function(){let t=this.re,r=this.im,e=Math.cos(2*r)-t$(2*t);return new tK(-2*tG(t)*Math.cos(r)/e,2*t$(t)*Math.sin(r)/e)},sech:function(){let t=this.re,r=this.im,e=Math.cos(2*r)+t$(2*t);return new tK(2*t$(t)*Math.cos(r)/e,-2*tG(t)*Math.sin(r)/e)},asinh:function(){let t=this.re,r=this.im;if(0===r){if(0===t)return new tK(0,0);let r=Math.abs(t),e=Math.log(r+Math.sqrt(r*r+1));return new tK(t<0?-e:e,0)}let e=new tK(t*t-r*r+1,2*t*r).sqrt();return new tK(t+e.re,r+e.im).log()},acosh:function(){let t=this.re,r=this.im;if(0===r){if(t>1)return new tK(Math.log(t+Math.sqrt(t-1)*Math.sqrt(t+1)),0);if(t<-1){let r=Math.sqrt(t*t-1);return new tK(Math.log(-t+r),Math.PI)}return new tK(0,Math.acos(t))}let e=new tK(t-1,r).sqrt(),n=new tK(t+1,r).sqrt();return new tK(t+e.re*n.re-e.im*n.im,r+e.re*n.im+e.im*n.re).log()},atanh:function(){let t=this.re,r=this.im;if(0===r)return 0===t?new tK(0,0):1===t?new tK(1/0,0):-1===t?new tK(-1/0,0):-1<t&&t<1?new tK(.5*Math.log((1+t)/(1-t)),0):t>1?new tK(.5*Math.log((t+1)/(t-1)),-Math.PI/2):new tK(.5*Math.log(-((1+t)/(1-t))),Math.PI/2);let e=1-t,n=1+t,i=e*e+r*r;if(0===i)return new tK(-1!==t?t/0:0,0!==r?r/0:0);let o=(n*e-r*r)/i,s=(r*e+n*r)/i;return new tK(tJ(o,s)/2,Math.atan2(s,o)/2)},acoth:function(){let t=this.re,r=this.im;if(0===t&&0===r)return new tK(0,Math.PI/2);let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).atanh():new tK(0!==t?t/0:0,0!==r?-r/0:0).atanh()},acsch:function(){let t=this.re,r=this.im;if(0===r){if(0===t)return new tK(1/0,0);let r=1/t;return new tK(Math.log(r+Math.sqrt(r*r+1)),0)}let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).asinh():new tK(0!==t?t/0:0,0!==r?-r/0:0).asinh()},asech:function(){let t=this.re,r=this.im;if(this.isZero())return tK.INFINITY;let e=t*t+r*r;return 0!==e?new tK(t/e,-r/e).acosh():new tK(0!==t?t/0:0,0!==r?-r/0:0).acosh()},inverse:function(){if(this.isZero())return tK.INFINITY;if(this.isInfinite())return tK.ZERO;let t=this.re,r=this.im,e=t*t+r*r;return new tK(t/e,-r/e)},conjugate:function(){return new tK(this.re,-this.im)},neg:function(){return new tK(-this.re,-this.im)},ceil:function(t){return t=Math.pow(10,t||0),new tK(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new tK(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new tK(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,r){let e=tV(t,r);return Math.abs(e.re-this.re)<=tK.EPSILON&&Math.abs(e.im-this.im)<=tK.EPSILON},clone:function(){return new tK(this.re,this.im)},toString:function(){let t=this.re,r=this.im,e="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(t)<tK.EPSILON&&(t=0),Math.abs(r)<tK.EPSILON&&(r=0),0===r)?e+t:(0!==t?(e+=t,e+=" ",r<0?(r=-r,e+="-"):e+="+",e+=" "):r<0&&(r=-r,e+="-"),1!==r&&(e+=r),e+"i")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},tK.ZERO=new tK(0,0),tK.ONE=new tK(1,0),tK.I=new tK(0,1),tK.PI=new tK(Math.PI,0),tK.E=new tK(Math.E,0),tK.INFINITY=new tK(1/0,1/0),tK.NAN=new tK(NaN,NaN),tK.EPSILON=1e-15;var tX=(0,tD.P9)("Complex",[],()=>(tK.prototype.type="Complex",tK.prototype.isComplex=!0,tK.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},tK.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},tK.prototype.format=function(t){var r=this.im,e=this.re,n=(0,tZ.GP)(this.re,t),i=(0,tZ.GP)(this.im,t),o=(0,tR.Et)(t)?t:t?t.precision:null;if(null!==o){var s=Math.pow(10,-o);Math.abs(e/r)<s&&(e=0),Math.abs(r/e)<s&&(r=0)}return 0===r?n:0===e?1===r?"i":-1===r?"-i":i+"i":r<0?-1===r?n+" - i":n+" - "+i.substring(1)+"i":1===r?n+" + i":n+" + "+i+"i"},tK.fromPolar=function(t){switch(arguments.length){case 1:var r=arguments[0];if("object"==typeof r)return tK(r);throw TypeError("Input has to be an object with r and phi keys.");case 2:var e=arguments[0],n=arguments[1];if((0,tR.Et)(e)){if((0,tR.vO)(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),(0,tR.Et)(n))return new tK({r:e,phi:n});throw TypeError("Phi is not a number nor an angle unit.")}throw TypeError("Radius r is not a number.");default:throw SyntaxError("Wrong number of arguments in function fromPolar")}},tK.prototype.valueOf=tK.prototype.toString,tK.fromJSON=function(t){return new tK(t)},tK.compare=function(t,r){return t.re>r.re?1:t.re<r.re?-1:t.im>r.im?1:t.im<r.im?-1:0},tK),{isClass:!0}),t0={s:1,n:0,d:1};function t1(t,r){if(isNaN(t=parseInt(t,10)))throw t8();return t*r}function t2(t,r){if(0===r)throw t3();var e=Object.create(t5.prototype);e.s=t<0?-1:1;var n=t9(t=t<0?-t:t,r);return e.n=t/n,e.d=r/n,e}function t7(t){for(var r={},e=t,n=2,i=4;i<=e;){for(;e%n==0;)e/=n,r[n]=(r[n]||0)+1;i+=1+2*n++}return e!==t?e>1&&(r[e]=(r[e]||0)+1):r[t]=(r[t]||0)+1,r}var t4=function(t,r){var e,n=0,i=1,o=1,s=0,a=0,u=0,c=1,f=1,h=0,p=1,l=1,d=1;if(null==t);else if(void 0!==r){if(o=(n=t)*(i=r),n%1!=0||i%1!=0)throw t6()}else switch(typeof t){case"object":if("d"in t&&"n"in t)n=t.n,i=t.d,"s"in t&&(n*=t.s);else if(0 in t)n=t[0],1 in t&&(i=t[1]);else throw t8();o=n*i;break;case"number":if(t<0&&(o=t,t=-t),t%1==0)n=t;else if(t>0){for(t>=1&&(f=Math.pow(10,Math.floor(1+Math.log(t)/Math.LN10)),t/=f);p<=1e7&&d<=1e7;){if(t===(e=(h+l)/(p+d))){p+d<=1e7?(n=h+l,i=p+d):d>p?(n=l,i=d):(n=h,i=p);break}t>e?(h+=l,p+=d):(l+=h,d+=p),p>1e7?(n=l,i=d):(n=h,i=p)}n*=f}else(isNaN(t)||isNaN(r))&&(i=n=NaN);break;case"string":if(null===(p=t.match(/\d+|./g)))throw t8();if("-"===p[h]?(o=-1,h++):"+"===p[h]&&h++,p.length===h+1?a=t1(p[h++],o):"."===p[h+1]||"."===p[h]?("."!==p[h]&&(s=t1(p[h++],o)),(++h+1===p.length||"("===p[h+1]&&")"===p[h+3]||"'"===p[h+1]&&"'"===p[h+3])&&(a=t1(p[h],o),c=Math.pow(10,p[h].length),h++),("("===p[h]&&")"===p[h+2]||"'"===p[h]&&"'"===p[h+2])&&(u=t1(p[h+1],o),f=Math.pow(10,p[h+1].length)-1,h+=3)):"/"===p[h+1]||":"===p[h+1]?(a=t1(p[h],o),c=t1(p[h+2],1),h+=3):"/"===p[h+3]&&" "===p[h+1]&&(s=t1(p[h],o),a=t1(p[h+2],o),c=t1(p[h+4],1),h+=5),p.length<=h){o=n=u+(i=c*f)*s+f*a;break}default:throw t8()}if(0===i)throw t3();t0.s=o<0?-1:1,t0.n=Math.abs(n),t0.d=Math.abs(i)};function t9(t,r){if(!t)return r;if(!r)return t;for(;;){if(!(t%=r))return r;if(!(r%=t))return t}}function t5(t,r){if(t4(t,r),!(this instanceof t5))return t2(t0.s*t0.n,t0.d);t=t9(t0.d,t0.n),this.s=t0.s,this.n=t0.n/t,this.d=t0.d/t}var t3=function(){return Error("Division by Zero")},t8=function(){return Error("Invalid argument")},t6=function(){return Error("Parameters must be integer")};t5.prototype={s:1,n:0,d:1,abs:function(){return t2(this.n,this.d)},neg:function(){return t2(-this.s*this.n,this.d)},add:function(t,r){return t4(t,r),t2(this.s*this.n*t0.d+t0.s*this.d*t0.n,this.d*t0.d)},sub:function(t,r){return t4(t,r),t2(this.s*this.n*t0.d-t0.s*this.d*t0.n,this.d*t0.d)},mul:function(t,r){return t4(t,r),t2(this.s*t0.s*this.n*t0.n,this.d*t0.d)},div:function(t,r){return t4(t,r),t2(this.s*t0.s*this.n*t0.d,this.d*t0.n)},clone:function(){return t2(this.s*this.n,this.d)},mod:function(t,r){if(isNaN(this.n)||isNaN(this.d))return new t5(NaN);if(void 0===t)return t2(this.s*this.n%this.d,1);if(t4(t,r),0===t0.n&&0===this.d)throw t3();return t2(this.s*(t0.d*this.n)%(t0.n*this.d),t0.d*this.d)},gcd:function(t,r){return t4(t,r),t2(t9(t0.n,this.n)*t9(t0.d,this.d),t0.d*this.d)},lcm:function(t,r){return(t4(t,r),0===t0.n&&0===this.n)?t2(0,1):t2(t0.n*this.n,t9(t0.n,this.n)*t9(t0.d,this.d))},ceil:function(t){return(t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d))?new t5(NaN):t2(Math.ceil(t*this.s*this.n/this.d),t)},floor:function(t){return(t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d))?new t5(NaN):t2(Math.floor(t*this.s*this.n/this.d),t)},round:function(t){return(t=Math.pow(10,t||0),isNaN(this.n)||isNaN(this.d))?new t5(NaN):t2(Math.round(t*this.s*this.n/this.d),t)},roundTo:function(t,r){return t4(t,r),t2(this.s*Math.round(this.n*t0.d/(this.d*t0.n))*t0.n,t0.d)},inverse:function(){return t2(this.s*this.d,this.n)},pow:function(t,r){if(t4(t,r),1===t0.d)if(t0.s<0)return t2(Math.pow(this.s*this.d,t0.n),Math.pow(this.n,t0.n));else return t2(Math.pow(this.s*this.n,t0.n),Math.pow(this.d,t0.n));if(this.s<0)return null;var e=t7(this.n),n=t7(this.d),i=1,o=1;for(var s in e)if("1"!==s){if("0"===s){i=0;break}if(e[s]*=t0.n,e[s]%t0.d!=0)return null;e[s]/=t0.d,i*=Math.pow(s,e[s])}for(var s in n)if("1"!==s){if(n[s]*=t0.n,n[s]%t0.d!=0)return null;n[s]/=t0.d,o*=Math.pow(s,n[s])}return t0.s<0?t2(o,i):t2(i,o)},equals:function(t,r){return t4(t,r),this.s*this.n*t0.d==t0.s*t0.n*this.d},compare:function(t,r){t4(t,r);var e=this.s*this.n*t0.d-t0.s*t0.n*this.d;return(0<e)-(e<0)},simplify:function(t){if(isNaN(this.n)||isNaN(this.d))return this;t=t||.001;for(var r=this.abs(),e=r.toContinued(),n=1;n<e.length;n++){for(var i=t2(e[n-1],1),o=n-2;o>=0;o--)i=i.inverse().add(e[o]);if(Math.abs(i.sub(r).valueOf())<t)return i.mul(this.s)}return this},divisible:function(t,r){return t4(t,r),!(!(t0.n*this.d)||this.n*t0.d%(t0.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(t){var r,e="",n=this.n,i=this.d;return this.s<0&&(e+="-"),1===i?e+=n:(t&&(r=Math.floor(n/i))>0&&(e+=r,e+=" ",n%=i),e+=n,e+="/",e+=i),e},toLatex:function(t){var r,e="",n=this.n,i=this.d;return this.s<0&&(e+="-"),1===i?e+=n:(t&&(r=Math.floor(n/i))>0&&(e+=r,n%=i),e+="\\frac{",e+=n,e+="}{",e+=i,e+="}"),e},toContinued:function(){var t,r=this.n,e=this.d,n=[];if(isNaN(r)||isNaN(e))return n;do n.push(Math.floor(r/e)),t=r%e,r=e,e=t;while(1!==r);return n},toString:function(t){var r=this.n,e=this.d;if(isNaN(r)||isNaN(e))return"NaN";t=t||15;var n=function(t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,e=1;1!==r;e++)if(r=10*r%t,e>2e3)return 0;return e}(e),i=function(t,r){for(var e=1,n=function(t,r,e){for(var n=1;r>0;t=t*t%e,r>>=1)1&r&&(n=n*t%e);return n}(10,r,t),i=0;i<300;i++){if(e===n)return i;e=10*e%t,n=10*n%t}return 0}(e,n),o=this.s<0?"-":"";if(o+=r/e|0,r%=e,(r*=10)&&(o+="."),n){for(var s=i;s--;)o+=r/e|0,r%=e,r*=10;o+="(";for(var s=n;s--;)o+=r/e|0,r%=e,r*=10;o+=")"}else for(var s=t;r&&s--;)o+=r/e|0,r%=e,r*=10;return o}};var rt=(0,tD.P9)("Fraction",[],()=>(t5.prototype.type="Fraction",t5.prototype.isFraction=!0,t5.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},t5.fromJSON=function(t){return new t5(t)},t5),{isClass:!0}),rr=e(42915);function re(t,r){return!!t&&"object"==typeof t&&(!!(0,tL.mQ)(ri,r)||!(r in Object.prototype)&&!(r in Function.prototype))}function rn(t){return"object"==typeof t&&t&&t.constructor===Object}var ri={length:!0,name:!0},ro={toString:!0,valueOf:!0,toLocaleString:!0};class rs{constructor(t){this.wrappedObject=t}keys(){return Object.keys(this.wrappedObject)}get(t){var r,e,n=this.wrappedObject;if(rn(n)&&re(n,t))return n[t];if("function"==typeof n[t]&&(r=n,e=t,!(null==r||"function"!=typeof r[e]||(0,tL.mQ)(r,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(r))&&((0,tL.mQ)(ro,e)||!(e in Object.prototype)&&!(e in Function.prototype))))throw Error('Cannot access method "'+t+'" as a property');throw Error('No access to property "'+t+'"')}set(t,r){return!function(t,r,e){if(rn(t)&&re(t,r))return t[r]=e;throw Error('No access to property "'+r+'"')}(this.wrappedObject,t,r),this}has(t){return t in this.wrappedObject}}function ra(t){return!!t&&(t instanceof Map||t instanceof rs||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var ru=function(){return ru=rr.create,rr};function rc(t){throw Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function rf(t){throw Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function rh(t){throw Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var rp={BigNumberDependencies:tj,ComplexDependencies:{createComplexClass:tX},DenseMatrixDependencies:tY,FractionDependencies:{createFractionClass:rt},createTyped:(0,tD.P9)("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(t){var{BigNumber:r,Complex:e,DenseMatrix:n,Fraction:i}=t,o=ru();return o.types=[{name:"number",test:tR.Et},{name:"Complex",test:tR.Zd},{name:"BigNumber",test:tR.C4},{name:"Fraction",test:tR.fU},{name:"Unit",test:tR.vO},{name:"string",test:tR.Kg},{name:"Chain",test:tR.o_},{name:"Array",test:tR.cy},{name:"Matrix",test:tR.OA},{name:"DenseMatrix",test:tR.zR},{name:"SparseMatrix",test:tR.AF},{name:"Range",test:tR._Z},{name:"Index",test:tR.nw},{name:"boolean",test:tR.Lm},{name:"ResultSet",test:tR.eW},{name:"Help",test:tR.gS},{name:"function",test:tR.Tn},{name:"Date",test:tR.$P},{name:"RegExp",test:tR.gd},{name:"null",test:tR.kZ},{name:"undefined",test:tR.b0},{name:"AccessorNode",test:tR.AS},{name:"ArrayNode",test:tR.gO},{name:"AssignmentNode",test:tR.qM},{name:"BlockNode",test:tR.CD},{name:"ConditionalNode",test:tR.PO},{name:"ConstantNode",test:tR.BA},{name:"FunctionNode",test:tR.Px},{name:"FunctionAssignmentNode",test:tR.m2},{name:"IndexNode",test:tR.$I},{name:"Node",test:tR.Ll},{name:"ObjectNode",test:tR.GJ},{name:"OperatorNode",test:tR.$$},{name:"ParenthesisNode",test:tR.tv},{name:"RangeNode",test:tR.Ye},{name:"SymbolNode",test:tR.li},{name:"Map",test:ra},{name:"Object",test:tR.Gv}],o.conversions=[{from:"number",to:"BigNumber",convert:function(t){if(r||rc(t),(0,tZ.vm)(t)>15)throw TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new r(t)}},{from:"number",to:"Complex",convert:function(t){return e||rf(t),new e(t,0)}},{from:"number",to:"string",convert:function(t){return t+""}},{from:"BigNumber",to:"Complex",convert:function(t){return e||rf(t),new e(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw 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(t){return e||rf(t),new e(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||rh(t);var r=new i(t);if(r.valueOf()!==t)throw TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return r}},{from:"string",to:"number",convert:function(t){var r=Number(t);if(isNaN(r))throw Error('Cannot convert "'+t+'" to a number');return r}},{from:"string",to:"BigNumber",convert:function(t){r||rc(t);try{return new r(t)}catch(r){throw Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||rh(t);try{return new i(t)}catch(r){throw Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){e||rf(t);try{return new e(t)}catch(r){throw Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return r||rc(t),new r(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||rh(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return n||function(){throw Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}],o})},rl="equalScalar",rd=(0,tD.P9)(rl,["typed","config"],t=>{var{typed:r,config:e}=t;return r(rl,{"boolean, boolean":function(t,r){return t===r},"number, number":function(t,r){return(0,tZ.q8)(t,r,e.epsilon)},"BigNumber, BigNumber":function(t,r){return t.eq(r)||function(t,r,e){if(null==e)return t.eq(r);if(t.eq(r))return!0;if(t.isNaN()||r.isNaN())return!1;if(t.isFinite()&&r.isFinite()){var n=t.minus(r).abs();if(n.isZero())return!0;var i=t.constructor.max(t.abs(),r.abs());return n.lte(i.times(e))}return!1}(t,r,e.epsilon)},"Fraction, Fraction":function(t,r){return t.equals(r)},"Complex, Complex":function(t,r){var n;return n=e.epsilon,(0,tZ.q8)(t.re,r.re,n)&&(0,tZ.q8)(t.im,r.im,n)},"Unit, Unit":function(t,r){if(!t.equalBase(r))throw Error("Cannot compare units with different base");return this(t.value,r.value)}})});(0,tD.P9)(rl,["typed","config"],t=>{var{typed:r,config:e}=t;return r(rl,{"number, number":function(t,r){return(0,tZ.q8)(t,r,e.epsilon)}})});var rm={typedDependencies:rp,createEqualScalar:rd},rg=(0,tD.P9)("SparseMatrix",["typed","equalScalar","Matrix"],t=>{var{typed:r,equalScalar:e,Matrix:n}=t;function i(t,r){if(!(this instanceof i))throw SyntaxError("Constructor must be called with the new operator");if(r&&!(0,tR.Kg)(r))throw Error("Invalid datatype: "+r);if((0,tR.OA)(t)){var e,n,s;e=this,n=t,s=r,"SparseMatrix"===n.type?(e._values=n._values?(0,tL.o8)(n._values):void 0,e._index=(0,tL.o8)(n._index),e._ptr=(0,tL.o8)(n._ptr),e._size=(0,tL.o8)(n._size),e._datatype=s||n._datatype):o(e,n.valueOf(),s||n._datatype)}else if(t&&(0,tR.cy)(t.index)&&(0,tR.cy)(t.ptr)&&(0,tR.cy)(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=r||t.datatype;else if((0,tR.cy)(t))o(this,t,r);else if(t)throw TypeError("Unsupported type of data ("+(0,tR.QP)(t)+")");else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=r}function o(t,n,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var o=n.length,s=0,a=e,u=0;if((0,tR.Kg)(i)&&(a=r.find(e,[i,i])||e,u=r.convert(0,i)),o>0){var c=0;do{t._ptr.push(t._index.length);for(var f=0;f<o;f++){var h=n[f];if((0,tR.cy)(h)){if(0===c&&s<h.length&&(s=h.length),c<h.length){var p=h[c];a(p,u)||(t._values.push(p),t._index.push(f))}}else 0===c&&s<1&&(s=1),a(h,u)||(t._values.push(h),t._index.push(f))}c++}while(c<s)}t._ptr.push(t._index.length),t._size=[o,s]}function s(t,r,e,n){if(e-r==0)return e;for(var i=r;i<e;i++)if(n[i]===t)return i;return r}function a(t,r,e,n,i,o,s){i.splice(t,0,n),o.splice(t,0,r);for(var a=e+1;a<s.length;a++)s[a]++}function u(t,n,i,o){var s,a,u,c=o||0,f=e,h=0;(0,tR.Kg)(t._datatype)&&(f=r.find(e,[t._datatype,t._datatype])||e,h=r.convert(0,t._datatype),c=r.convert(c,t._datatype));var p=!f(c,h),l=t._size[0],d=t._size[1];if(i>d){for(a=d;a<i;a++)if(t._ptr[a]=t._values.length,p)for(s=0;s<l;s++)t._values.push(c),t._index.push(s);t._ptr[i]=t._values.length}else i<d&&(t._ptr.splice(i+1,d-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(d=i,n>l){if(p){var m=0;for(a=0;a<d;a++){t._ptr[a]=t._ptr[a]+m,u=t._ptr[a+1]+m;var g=0;for(s=l;s<n;s++,g++)t._values.splice(u+g,0,c),t._index.splice(u+g,0,s),m++}t._ptr[d]=t._values.length}}else if(n<l){var v=0;for(a=0;a<d;a++){t._ptr[a]=t._ptr[a]-v;var y=t._ptr[a],w=t._ptr[a+1]-v;for(u=y;u<w;u++)(s=t._index[u])>n-1&&(t._values.splice(u,1),t._index.splice(u,1),v++)}t._ptr[a]=t._values.length}return t._size[0]=n,t._size[1]=i,t}function c(t,r,e,n,i){var o,s,a=n[0],u=n[1],c=[];for(o=0;o<a;o++)for(s=0,c[o]=[];s<u;s++)c[o][s]=0;for(s=0;s<u;s++)for(var f=e[s],h=e[s+1],p=f;p<h;p++)c[o=r[p]][s]=t?i?(0,tL.o8)(t[p]):t[p]:1;return c}return i.prototype=new n,i.prototype.createSparseMatrix=function(t,r){return new i(t,r)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return(0,tq.ig)(this._values,tR.QP)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,r){return new i(t,r)},i.prototype.density=function(){var t=this._size[0],r=this._size[1];return 0!==t&&0!==r?this._index.length/(t*r):0},i.prototype.subset=function(t,r,e){if(!this._values)throw Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(t,r){if(!(0,tR.nw)(r))throw TypeError("Invalid index");if(r.isScalar())return t.get(r.min());var e,n,o,s,a=r.size();if(a.length!==t._size.length)throw new tU.h(a.length,t._size.length);var u=r.min(),c=r.max();for(e=0,n=t._size.length;e<n;e++)(0,tq.r7)(u[e],t._size[e]),(0,tq.r7)(c[e],t._size[e]);var f=t._values,h=t._index,p=t._ptr,l=r.dimension(0),d=r.dimension(1),m=[],g=[];l.forEach(function(t,r){g[t]=r[0],m[t]=!0});var v=f?[]:void 0,y=[],w=[];return d.forEach(function(t){for(w.push(y.length),o=p[t],s=p[t+1];o<s;o++)!0===m[e=h[o]]&&(y.push(g[e]),v&&v.push(f[o]))}),w.push(y.length),new i({values:v,index:y,ptr:w,size:a,datatype:t._datatype})}(this,t);case 2:case 3:return function(t,r,e,n){if(!r||!0!==r.isIndex)throw TypeError("Invalid index");var i,o=r.size(),s=r.isScalar();if((0,tR.OA)(e)?(i=e.size(),e=e.toArray()):i=(0,tq.LO)(e),s){if(0!==i.length)throw TypeError("Scalar expected");t.set(r.min(),e,n)}else{if(1!==o.length&&2!==o.length)throw new tU.h(o.length,t._size.length,"<");if(i.length<o.length){for(var a=0,u=0;1===o[a]&&1===i[a];)a++;for(;1===o[a];)u++,a++;e=(0,tq.iD)(e,o.length,u,i)}if(!(0,tL.QO)(o,i))throw new tU.h(o,i,">");if(1===o.length)r.dimension(0).forEach(function(r,i){(0,tq.r7)(r),t.set([r,0],e[i[0]],n)});else{var c=r.dimension(0),f=r.dimension(1);c.forEach(function(r,i){(0,tq.r7)(r),f.forEach(function(o,s){(0,tq.r7)(o),t.set([r,o],e[i[0]][s[0]],n)})})}}return t}(this,t,r,e);default:throw SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!(0,tR.cy)(t))throw TypeError("Array expected");if(t.length!==this._size.length)throw new tU.h(t.length,this._size.length);if(!this._values)throw Error("Cannot invoke get on a Pattern only matrix");var r=t[0],e=t[1];(0,tq.r7)(r,this._size[0]),(0,tq.r7)(e,this._size[1]);var n=s(r,this._ptr[e],this._ptr[e+1],this._index);return n<this._ptr[e+1]&&this._index[n]===r?this._values[n]:0},i.prototype.set=function(t,n,i){if(!(0,tR.cy)(t))throw TypeError("Array expected");if(t.length!==this._size.length)throw new tU.h(t.length,this._size.length);if(!this._values)throw Error("Cannot invoke set on a Pattern only matrix");var o=t[0],c=t[1],f=this._size[0],h=this._size[1],p=e,l=0;(0,tR.Kg)(this._datatype)&&(p=r.find(e,[this._datatype,this._datatype])||e,l=r.convert(0,this._datatype)),(o>f-1||c>h-1)&&(u(this,Math.max(o+1,f),Math.max(c+1,h),i),f=this._size[0],h=this._size[1]),(0,tq.r7)(o,f),(0,tq.r7)(c,h);var d=s(o,this._ptr[c],this._ptr[c+1],this._index);return d<this._ptr[c+1]&&this._index[d]===o?p(n,l)?function(t,r,e,n,i){e.splice(t,1),n.splice(t,1);for(var o=r+1;o<i.length;o++)i[o]--}(d,c,this._values,this._index,this._ptr):this._values[d]=n:a(d,o,c,n,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,r,e){if(!(0,tR.P3)(t))throw TypeError("Array or Matrix expected");var n=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);if(2!==n.length)throw Error("Only two dimensions matrix are supported");return n.forEach(function(t){if(!(0,tR.Et)(t)||!(0,tZ.YN)(t)||t<0)throw TypeError("Invalid size, must contain positive integers (size: "+(0,tB.GP)(n)+")")}),u(e?this.clone():this,n[0],n[1],r)},i.prototype.reshape=function(t,r){if(!(0,tR.cy)(t))throw TypeError("Array expected");if(2!==t.length)throw Error("Sparse matrices can only be reshaped in two dimensions");t.forEach(function(r){if(!(0,tR.Et)(r)||!(0,tZ.YN)(r)||r<=-2||0===r)throw TypeError("Invalid size, must contain positive integers or -1 (size: "+(0,tB.GP)(t)+")")});var e=this._size[0]*this._size[1],n=(t=(0,tq.cs)(t,e))[0]*t[1];if(e!==n)throw Error("Reshaping sparse matrix will result in the wrong number of elements");var i=r?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return i;for(var o=[],u=0;u<i._ptr.length;u++)for(var c=0;c<i._ptr[u+1]-i._ptr[u];c++)o.push(u);for(var f=i._values.slice(),h=i._index.slice(),p=0;p<i._index.length;p++){var l=h[p],d=o[p],m=l*i._size[1]+d;o[p]=m%t[1],h[p]=Math.floor(m/t[1])}i._values.length=0,i._index.length=0,i._ptr.length=t[1]+1,i._size=t.slice();for(var g=0;g<i._ptr.length;g++)i._ptr[g]=0;for(var v=0;v<f.length;v++){var y=h[v],w=o[v],x=f[v];a(s(y,i._ptr[w],i._ptr[w+1],i._index),y,w,x,i._values,i._index,i._ptr)}return i},i.prototype.clone=function(){return new i({values:this._values?(0,tL.o8)(this._values):void 0,index:(0,tL.o8)(this._index),ptr:(0,tL.o8)(this._ptr),size:(0,tL.o8)(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,n){if(!this._values)throw Error("Cannot invoke map on a Pattern only matrix");var o=this;return function(t,n,o,s,a){var u=[],c=[],f=[],h=e,p=0;(0,tR.Kg)(t._datatype)&&(h=r.find(e,[t._datatype,t._datatype])||e,p=r.convert(0,t._datatype));for(var l=function(t,r,e){t=s(t,r,e),h(t,p)||(u.push(t),c.push(r))},d=0;d<=o;d++){f.push(u.length);var m=t._ptr[d],g=t._ptr[d+1];if(a)for(var v=m;v<g;v++){var y=t._index[v];y>=0&&y<=n&&l(t._values[v],y-0,d-0)}else{for(var w={},x=m;x<g;x++)w[t._index[x]]=t._values[x];for(var N=0;N<=n;N++)l(N in w?w[N]:0,N-0,d-0)}}return f.push(u.length),new i({values:u,index:c,ptr:f,size:[n-0+1,o-0+1]})}(this,this._size[0]-1,this._size[1]-1,function(r,e,n){return t(r,[e,n],o)},n)},i.prototype.forEach=function(t,r){if(!this._values)throw Error("Cannot invoke forEach on a Pattern only matrix");for(var e=this._size[0],n=this._size[1],i=0;i<n;i++){var o=this._ptr[i],s=this._ptr[i+1];if(r)for(var a=o;a<s;a++){var u=this._index[a];t(this._values[a],[u,i],this)}else{for(var c={},f=o;f<s;f++)c[this._index[f]]=this._values[f];for(var h=0;h<e;h++)t(h in c?c[h]:0,[h,i],this)}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error("Cannot iterate a Pattern only matrix");for(var t=this._size[1],r=0;r<t;r++)for(var e=this._ptr[r],n=this._ptr[r+1],i=e;i<n;i++){var o=this._index[i];yield{value:this._values[i],index:[o,r]}}},i.prototype.toArray=function(){return c(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return c(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var r=this._size[0],e=this._size[1],n=this.density(),i="Sparse Matrix ["+(0,tB.GP)(r,t)+" x "+(0,tB.GP)(e,t)+"] density: "+(0,tB.GP)(n,t)+"\n",o=0;o<e;o++)for(var s=this._ptr[o],a=this._ptr[o+1],u=s;u<a;u++){var c=this._index[u];i+="\n ("+(0,tB.GP)(c,t)+", "+(0,tB.GP)(o,t)+") ==> "+(this._values?(0,tB.GP)(this._values[u],t):"X")}return i},i.prototype.toString=function(){return(0,tB.GP)(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(t){if(t){if((0,tR.C4)(t)&&(t=t.toNumber()),!(0,tR.Et)(t)||!(0,tZ.YN)(t))throw TypeError("The parameter k must be an integer number")}else t=0;var r=t>0?t:0,e=t<0?-t:0,n=this._size[0],o=this._size[1],s=Math.min(n-e,o-r),a=[],u=[],c=[];c[0]=0;for(var f=r;f<o&&a.length<s;f++)for(var h=this._ptr[f],p=this._ptr[f+1],l=h;l<p;l++){var d=this._index[l];if(d===f-r+e){a.push(this._values[l]),u[a.length-1]=d-e;break}}return c.push(a.length),new i({values:a,index:u,ptr:c,size:[s,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,n,o,s,a){if(!(0,tR.cy)(t))throw TypeError("Array expected, size parameter");if(2!==t.length)throw Error("Only two dimensions matrix are supported");if(t=t.map(function(t){if((0,tR.C4)(t)&&(t=t.toNumber()),!(0,tR.Et)(t)||!(0,tZ.YN)(t)||t<1)throw Error("Size values must be positive integers");return t}),o){if((0,tR.C4)(o)&&(o=o.toNumber()),!(0,tR.Et)(o)||!(0,tZ.YN)(o))throw TypeError("The parameter k must be an integer number")}else o=0;var u,c=e,f=0;(0,tR.Kg)(a)&&(c=r.find(e,[a,a])||e,f=r.convert(0,a));var h=o>0?o:0,p=o<0?-o:0,l=t[0],d=t[1],m=Math.min(l-p,d-h);if((0,tR.cy)(n)){if(n.length!==m)throw Error("Invalid value array length");u=function(t){return n[t]}}else if((0,tR.OA)(n)){var g=n.size();if(1!==g.length||g[0]!==m)throw Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};for(var v=[],y=[],w=[],x=0;x<d;x++){w.push(v.length);var N=x-h;if(N>=0&&N<m){var b=u(N);c(b,f)||(y.push(N+p),v.push(b))}}return w.push(v.length),new i({values:v,index:y,ptr:w,size:[l,d]})},i.prototype.swapRows=function(t,r){if(!(0,tR.Et)(t)||!(0,tZ.YN)(t)||!(0,tR.Et)(r)||!(0,tZ.YN)(r))throw Error("Row index must be positive integers");if(2!==this._size.length)throw Error("Only two dimensional matrix is supported");return(0,tq.r7)(t,this._size[0]),(0,tq.r7)(r,this._size[0]),i._swapRows(t,r,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,r,e,n,i){for(var o=n[t],s=n[t+1],a=o;a<s;a++)i(e[a],r[a])},i._swapRows=function(t,r,e,n,i,o){for(var a=0;a<e;a++){var u=o[a],c=o[a+1],f=s(t,u,c,i),h=s(r,u,c,i);if(f<c&&h<c&&i[f]===t&&i[h]===r){if(n){var p=n[f];n[f]=n[h],n[h]=p}continue}if(f<c&&i[f]===t&&(h>=c||i[h]!==r)){var l=n?n[f]:void 0;i.splice(h,0,r),n&&n.splice(h,0,l),i.splice(h<=f?f+1:f,1),n&&n.splice(h<=f?f+1:f,1);continue}if(h<c&&i[h]===r&&(f>=c||i[f]!==t)){var d=n?n[h]:void 0;i.splice(f,0,t),n&&n.splice(f,0,d),i.splice(f<=h?h+1:h,1),n&&n.splice(f<=h?h+1:h,1)}}},i},{isClass:!0}),rv="matrix",ry=(0,tD.P9)(rv,["typed","Matrix","DenseMatrix","SparseMatrix"],t=>{var{typed:r,Matrix:e,DenseMatrix:n,SparseMatrix:i}=t;return r(rv,{"":function(){return o([])},string:function(t){return o([],t)},"string, string":function(t,r){return o([],t,r)},Array:function(t){return o(t)},Matrix:function(t){return o(t,t.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(t,r,e){if("dense"===r||"default"===r||void 0===r)return new n(t,e);if("sparse"===r)return new i(t,e);throw TypeError("Unknown matrix type "+JSON.stringify(r)+".")}}),rw=(0,tD.P9)("algorithm01",["typed"],t=>{var{typed:r}=t;return function(t,e,n,i){var o,s,a=t._data,u=t._size,c=t._datatype,f=e._values,h=e._index,p=e._ptr,l=e._size,d=e._datatype;if(u.length!==l.length)throw new tU.h(u.length,l.length);if(u[0]!==l[0]||u[1]!==l[1])throw RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+l+")");if(!f)throw Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m=u[0],g=u[1],v="string"==typeof c&&c===d?c:void 0,y=v?r.find(n,[v,v]):n,w=[];for(o=0;o<m;o++)w[o]=[];var x=[],N=[];for(s=0;s<g;s++){for(var b=s+1,_=p[s],M=p[s+1],E=_;E<M;E++)x[o=h[E]]=i?y(f[E],a[o][s]):y(a[o][s],f[E]),N[o]=b;for(o=0;o<m;o++)N[o]===b?w[o][s]=x[o]:w[o][s]=a[o][s]}return t.createDenseMatrix({data:w,size:[m,g],datatype:v})}}),rx=(0,tD.P9)("algorithm04",["typed","equalScalar"],t=>{var{typed:r,equalScalar:e}=t;return function(t,n,i){var o,s,a,u,c,f,h=t._values,p=t._index,l=t._ptr,d=t._size,m=t._datatype,g=n._values,v=n._index,y=n._ptr,w=n._size,x=n._datatype;if(d.length!==w.length)throw new tU.h(d.length,w.length);if(d[0]!==w[0]||d[1]!==w[1])throw RangeError("Dimension mismatch. Matrix A ("+d+") must match Matrix B ("+w+")");var N=d[0],b=d[1],_=e,M=0,E=i;"string"==typeof m&&m===x&&(o=m,_=r.find(e,[o,o]),M=r.convert(0,o),E=r.find(i,[o,o]));var O=h&&g?[]:void 0,A=[],z=[],S=h&&g?[]:void 0,C=h&&g?[]:void 0,P=[],F=[];for(a=0;a<b;a++){z[a]=A.length;var I=a+1;for(c=l[a],f=l[a+1],u=c;u<f;u++)s=p[u],A.push(s),P[s]=I,S&&(S[s]=h[u]);for(c=y[a],f=y[a+1],u=c;u<f;u++)if(P[s=v[u]]===I){if(S){var T=E(S[s],g[u]);_(T,M)?P[s]=null:S[s]=T}}else A.push(s),F[s]=I,C&&(C[s]=g[u]);if(S&&C)for(u=z[a];u<A.length;)P[s=A[u]]===I?(O[u]=S[s],u++):F[s]===I?(O[u]=C[s],u++):A.splice(u,1)}return z[b]=A.length,t.createSparseMatrix({values:O,index:A,ptr:z,size:[N,b],datatype:o})}}),rN=(0,tD.P9)("algorithm10",["typed","DenseMatrix"],t=>{var{typed:r,DenseMatrix:e}=t;return function(t,n,i,o){var s,a=t._values,u=t._index,c=t._ptr,f=t._size,h=t._datatype;if(!a)throw Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],l=f[1],d=i;"string"==typeof h&&(s=h,n=r.convert(n,s),d=r.find(i,[s,s]));for(var m=[],g=[],v=[],y=0;y<l;y++){for(var w=y+1,x=c[y],N=c[y+1],b=x;b<N;b++){var _=u[b];g[_]=a[b],v[_]=w}for(var M=0;M<p;M++)0===y&&(m[M]=[]),v[M]===w?m[M][y]=o?d(n,g[M]):d(g[M],n):m[M][y]=n}return new e({data:m,size:[p,l],datatype:s})}}),rb=(0,tD.P9)("algorithm13",["typed"],t=>{var{typed:r}=t;return function(t,e,n){var i,o=t._data,s=t._size,a=t._datatype,u=e._data,c=e._size,f=e._datatype,h=[];if(s.length!==c.length)throw new tU.h(s.length,c.length);for(var p=0;p<s.length;p++){if(s[p]!==c[p])throw RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+c+")");h[p]=s[p]}var l=n;"string"==typeof a&&a===f&&(i=a,l=r.find(n,[i,i]));var d=h.length>0?function t(r,e,n,i,o,s){var a=[];if(e===n.length-1)for(var u=0;u<i;u++)a[u]=r(o[u],s[u]);else for(var c=0;c<i;c++)a[c]=t(r,e+1,n,n[e+1],o[c],s[c]);return a}(l,0,h,h[0],o,u):[];return t.createDenseMatrix({data:d,size:h,datatype:i})}}),r_=(0,tD.P9)("algorithm14",["typed"],t=>{var{typed:r}=t;return function(t,e,n,i){var o,s=t._data,a=t._size,u=t._datatype,c=n;"string"==typeof u&&(o=u,e=r.convert(e,o),c=r.find(n,[o,o]));var f=a.length>0?function t(r,e,n,i,o,s,a){var u=[];if(e===n.length-1)for(var c=0;c<i;c++)u[c]=a?r(s,o[c]):r(o[c],s);else for(var f=0;f<i;f++)u[f]=t(r,e+1,n,n[e+1],o[f],s,a);return u}(c,0,a,a[0],s,e,i):[];return t.createDenseMatrix({data:f,size:(0,tL.o8)(a),datatype:o})}});function rM(t,r){var e;if(!(0,tZ.YN)(t)||!(0,tZ.YN)(r))throw Error("Parameters in function gcd must be integer numbers");for(;0!==r;)e=t%r,t=r,r=e;return t<0?-t:t}rM.signature="number, number";var rE={BigNumberDependencies:tj,DenseMatrixDependencies:tY,equalScalarDependencies:rm,matrixDependencies:{DenseMatrixDependencies:tY,MatrixDependencies:tk,SparseMatrixDependencies:{MatrixDependencies:tk,equalScalarDependencies:rm,typedDependencies:rp,createSparseMatrixClass:rg},typedDependencies:rp,createMatrix:ry},typedDependencies:rp,createGcd:(0,tD.P9)("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],t=>{var{typed:r,matrix:e,equalScalar:n,BigNumber:i,DenseMatrix:o}=t,s=rw({typed:r}),a=rx({typed:r,equalScalar:n}),u=rN({typed:r,DenseMatrix:o}),c=rb({typed:r}),f=r_({typed:r});return r("gcd",{"number, number":rM,"BigNumber, BigNumber":function(t,r){if(!t.isInt()||!r.isInt())throw Error("Parameters in function gcd must be integer numbers");for(var e=new i(0);!r.isZero();){var n=t.mod(r);t=r,r=n}return t.lt(e)?t.neg():t},"Fraction, Fraction":function(t,r){return t.gcd(r)},"SparseMatrix, SparseMatrix":function(t,r){return a(t,r,this)},"SparseMatrix, DenseMatrix":function(t,r){return s(r,t,this,!0)},"DenseMatrix, SparseMatrix":function(t,r){return s(t,r,this,!1)},"DenseMatrix, DenseMatrix":function(t,r){return c(t,r,this)},"Array, Array":function(t,r){return this(e(t),e(r)).valueOf()},"Array, Matrix":function(t,r){return this(e(t),r)},"Matrix, Array":function(t,r){return this(t,e(r))},"SparseMatrix, number | BigNumber":function(t,r){return u(t,r,this,!1)},"DenseMatrix, number | BigNumber":function(t,r){return f(t,r,this,!1)},"number | BigNumber, SparseMatrix":function(t,r){return u(r,t,this,!0)},"number | BigNumber, DenseMatrix":function(t,r){return f(r,t,this,!0)},"Array, number | BigNumber":function(t,r){return f(e(t),r,this,!1).valueOf()},"number | BigNumber, Array":function(t,r){return f(e(r),t,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(t,r,e){for(var n=this(t,r),i=0;i<e.length;i++)n=this(n,e[i]);return n}})})}},15562(t,r,e){"use strict";function n(t,r,e){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=r,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=Error().stack}e.d(r,{h:()=>n}),n.prototype=RangeError(),n.prototype.constructor=RangeError,n.prototype.name="DimensionError",n.prototype.isDimensionError=!0},16086(t,r,e){"use strict";function n(t,r,e){if(!(this instanceof n))throw SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=e),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&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=Error().stack}e.d(r,{d:()=>n}),n.prototype=RangeError(),n.prototype.constructor=RangeError,n.prototype.name="IndexError",n.prototype.isIndexError=!0},49204(t,r,e){"use strict";e.d(r,{LO:()=>u,XR:()=>h,cs:()=>l,gR:()=>g,iD:()=>m,ig:()=>function t(r,e){for(var n,i=0,o=0;o<r.length;o++){var s=r[o],a=Array.isArray(s);if(0===o&&a&&(i=s.length),a&&s.length!==i)return;var u=a?t(s,e):e(s);if(void 0===n)n=u;else if(n!==u)return"mixed"}return n},r7:()=>f,tQ:()=>p,tf:()=>c});var n=e(55624),i=e(46797),o=e(93988),s=e(15562),a=e(16086);function u(t){for(var r=[];Array.isArray(t);)r.push(t.length),t=t[0];return r}function c(t,r){if(0===r.length){if(Array.isArray(t))throw new s.h(t.length,0)}else!function t(r,e,n){var i,o=r.length;if(o!==e[n])throw new s.h(o,e[n]);if(n<e.length-1){var a=n+1;for(i=0;i<o;i++){if(!Array.isArray(r[i]))throw new s.h(e.length-1,e.length,"<");t(r[i],e,a)}}else for(i=0;i<o;i++)if(Array.isArray(r[i]))throw new s.h(e.length+1,e.length,">")}(t,r,0)}function f(t,r){if(!(0,i.Et)(t)||!(0,n.YN)(t))throw TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof r&&t>=r)throw new a.d(t,r)}function h(t,r,e){if(!Array.isArray(t)||!Array.isArray(r))throw TypeError("Array expected");if(0===r.length)throw Error("Resizing to scalar is not supported");return r.forEach(function(t){if(!(0,i.Et)(t)||!(0,n.YN)(t)||t<0)throw TypeError("Invalid size, must contain positive integers (size: "+(0,o.GP)(r)+")")}),function t(r,e,n,i){var o,s,a=r.length,u=e[n],c=Math.min(a,u);if(r.length=u,n<e.length-1){var f=n+1;for(o=0;o<c;o++)Array.isArray(s=r[o])||(s=[s],r[o]=s),t(s,e,f,i);for(o=c;o<u;o++)s=[],r[o]=s,t(s,e,f,i)}else{for(o=0;o<c;o++)for(;Array.isArray(r[o]);)r[o]=r[o][0];for(o=c;o<u;o++)r[o]=i}}(t,r,0,void 0!==e?e:0),t}function p(t,r){var e=function(t){if(!Array.isArray(t))return t;var r=[];return t.forEach(function t(e){Array.isArray(e)?e.forEach(t):r.push(e)}),r}(t),n=e.length;if(!Array.isArray(t)||!Array.isArray(r))throw TypeError("Array expected");if(0===r.length)throw new s.h(0,n,"!=");var i=d(r=l(r,n));if(n!==i)throw new s.h(i,n,"!=");try{return function(t,r){for(var e,n=t,i=r.length-1;i>0;i--){var o=r[i];e=[];for(var s=n.length/o,a=0;a<s;a++)e.push(n.slice(a*o,(a+1)*o));n=e}return n}(e,r)}catch(t){if(t instanceof s.h)throw new s.h(i,n,"!=");throw t}}function l(t,r){var e=d(t),n=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw Error("More than one wildcard in sizes");if(i>=0)if(r%e==0)n[i]=-r/e;else throw Error("Could not replace wildcard, since "+r+" is no multiple of "+-e);return n}function d(t){return t.reduce((t,r)=>t*r,1)}function m(t,r,e,n){var i=n||u(t);if(e)for(var o=0;o<e;o++)t=[t],i.unshift(1);for(t=function t(r,e,n){var i,o;if(Array.isArray(r)){var s=n+1;for(i=0,o=r.length;i<o;i++)r[i]=t(r[i],e,s)}else for(var a=n;a<e;a++)r=[r];return r}(t,r,0);i.length<r;)i.push(1);return t}function g(t,r){return -1!==t.indexOf(r)}},1207(t,r,e){"use strict";e.d(r,{P9:()=>i,Py:()=>s,T$:()=>o});var n=e(32718);function i(t,r,e,i){function o(i){var o=(0,n.K)(i,r.map(s));return function(t,r,e){if(!r.filter(t=>{var r;return!((r=t)&&"?"===r[0])}).every(t=>void 0!==e[t])){var n=r.filter(t=>void 0===e[t]);throw Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(n.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,r,i),e(o)}return o.isFactory=!0,o.fn=t,o.dependencies=r.slice().sort(),i&&(o.meta=i),o}function o(t){return"function"==typeof t&&"string"==typeof t.fn&&Array.isArray(t.dependencies)}function s(t){return t&&"?"===t[0]?t.slice(1):t}},46797(t,r,e){"use strict";function n(t){return"number"==typeof t}function i(t){return!!t&&"object"==typeof t&&"function"==typeof t.constructor&&(!0===t.isBigNumber&&"object"==typeof t.constructor.prototype&&!0===t.constructor.prototype.isBigNumber||"function"==typeof t.constructor.isDecimal&&!0===t.constructor.isDecimal(t))}function o(t){return t&&"object"==typeof t&&!0===Object.getPrototypeOf(t).isComplex||!1}function s(t){return t&&"object"==typeof t&&!0===Object.getPrototypeOf(t).isFraction||!1}function a(t){return t&&!0===t.constructor.prototype.isUnit||!1}function u(t){return"string"==typeof t}e.d(r,{$$:()=>j,$I:()=>I,$P:()=>x,AF:()=>l,AS:()=>E,BA:()=>C,C4:()=>i,CD:()=>z,Et:()=>n,GJ:()=>D,Gv:()=>b,Kg:()=>u,Ll:()=>T,Lm:()=>g,OA:()=>f,P3:()=>h,PO:()=>S,Px:()=>F,QP:()=>Z,Tn:()=>w,Ye:()=>R,Zd:()=>o,_Z:()=>d,b0:()=>M,cy:()=>c,eW:()=>v,fU:()=>s,gO:()=>O,gS:()=>y,gd:()=>N,kZ:()=>_,li:()=>q,m2:()=>P,nw:()=>m,o_:()=>B,qM:()=>A,tv:()=>k,vO:()=>a,zR:()=>p});var c=Array.isArray;function f(t){return t&&!0===t.constructor.prototype.isMatrix||!1}function h(t){return Array.isArray(t)||f(t)}function p(t){return t&&t.isDenseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function l(t){return t&&t.isSparseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function d(t){return t&&!0===t.constructor.prototype.isRange||!1}function m(t){return t&&!0===t.constructor.prototype.isIndex||!1}function g(t){return"boolean"==typeof t}function v(t){return t&&!0===t.constructor.prototype.isResultSet||!1}function y(t){return t&&!0===t.constructor.prototype.isHelp||!1}function w(t){return"function"==typeof t}function x(t){return t instanceof Date}function N(t){return t instanceof RegExp}function b(t){return!!(t&&"object"==typeof t&&t.constructor===Object&&!o(t)&&!s(t))}function _(t){return null===t}function M(t){return void 0===t}function E(t){return t&&!0===t.isAccessorNode&&!0===t.constructor.prototype.isNode||!1}function O(t){return t&&!0===t.isArrayNode&&!0===t.constructor.prototype.isNode||!1}function A(t){return t&&!0===t.isAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function z(t){return t&&!0===t.isBlockNode&&!0===t.constructor.prototype.isNode||!1}function S(t){return t&&!0===t.isConditionalNode&&!0===t.constructor.prototype.isNode||!1}function C(t){return t&&!0===t.isConstantNode&&!0===t.constructor.prototype.isNode||!1}function P(t){return t&&!0===t.isFunctionAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function F(t){return t&&!0===t.isFunctionNode&&!0===t.constructor.prototype.isNode||!1}function I(t){return t&&!0===t.isIndexNode&&!0===t.constructor.prototype.isNode||!1}function T(t){return t&&!0===t.isNode&&!0===t.constructor.prototype.isNode||!1}function D(t){return t&&!0===t.isObjectNode&&!0===t.constructor.prototype.isNode||!1}function j(t){return t&&!0===t.isOperatorNode&&!0===t.constructor.prototype.isNode||!1}function k(t){return t&&!0===t.isParenthesisNode&&!0===t.constructor.prototype.isNode||!1}function R(t){return t&&!0===t.isRangeNode&&!0===t.constructor.prototype.isNode||!1}function q(t){return t&&!0===t.isSymbolNode&&!0===t.constructor.prototype.isNode||!1}function B(t){return t&&!0===t.constructor.prototype.isChain||!1}function Z(t){var r=typeof t;return"object"===r?null===t?"null":Array.isArray(t)?"Array":t instanceof Date?"Date":t instanceof RegExp?"RegExp":i(t)?"BigNumber":o(t)?"Complex":s(t)?"Fraction":f(t)?"Matrix":a(t)?"Unit":m(t)?"Index":d(t)?"Range":v(t)?"ResultSet":T(t)?t.type:B(t)?"Chain":y(t)?"Help":"Object":"function"===r?"Function":r}},55624(t,r,e){"use strict";e.d(r,{GP:()=>p,IY:()=>f,Kk:()=>u,YL:()=>a,YN:()=>i,_S:()=>o,_n:()=>c,p6:()=>s,q8:()=>w,vm:()=>v});var n=e(46797);function i(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var o=Math.sign||function(t){return t>0?1:t<0?-1:0},s=Math.log2||function(t){return Math.log(t)/Math.LN2},a=Math.log10||function(t){return Math.log(t)/Math.LN10},u=Math.log1p||function(t){return Math.log(t+1)},c=Math.cbrt||function(t){if(0===t)return t;var r,e=t<0;return e&&(t=-t),isFinite(t)?(r=Math.exp(Math.log(t)/3),r=(t/(r*r)+2*r)/3):r=t,e?-r:r},f=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function h(t,r,e){var n="";if(e){if(e<1)throw Error("size must be in greater than 0");if(!i(e))throw Error("size must be an integer");if(t>2**(e-1)-1||t<-(2**(e-1)))throw Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!i(t))throw Error("Value must be an integer");t<0&&(t+=2**e),n="i".concat(e)}var o="";return t<0&&(t=-t,o="-"),"".concat(o).concat({2:"0b",8:"0o",16:"0x"}[r]).concat(t.toString(r)).concat(n)}function p(t,r){if("function"==typeof r)return r(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var e,i,o="auto";if(r&&(r.notation&&(o=r.notation),(0,n.Et)(r)?e=r:(0,n.Et)(r.precision)&&(e=r.precision),r.wordSize)&&"number"!=typeof(i=r.wordSize))throw Error('Option "wordSize" must be a number');switch(o){case"fixed":return function(t,r){if(isNaN(t)||!isFinite(t))return String(t);var e=l(t),n="number"==typeof r?m(e,e.exponent+1+r):e,i=n.coefficients,o=n.exponent+1,s=o+(r||0);return i.length<s&&(i=i.concat(g(s-i.length))),o<0&&(i=g(-o+1).concat(i),o=1),o<i.length&&i.splice(o,0,0===o?"0.":"."),n.sign+i.join("")}(t,e);case"exponential":return d(t,e);case"engineering":return function(t,r){if(isNaN(t)||!isFinite(t))return String(t);var e=m(l(t),r),i=e.exponent,o=e.coefficients,s=i%3==0?i:i<0?i-3-i%3:i-i%3;if((0,n.Et)(r))for(;r>o.length||i-s+1>o.length;)o.push(0);else for(var a=Math.abs(i-s)-(o.length-1),u=0;u<a;u++)o.push(0);for(var c=Math.abs(i-s),f=1;c>0;)f++,c--;var h=o.slice(f).join(""),p=(0,n.Et)(r)&&h.length||h.match(/[1-9]/)?"."+h:"",d=o.slice(0,f).join("")+p+"e"+(i>=0?"+":"")+s.toString();return e.sign+d}(t,e);case"bin":return h(t,2,i);case"oct":return h(t,8,i);case"hex":return h(t,16,i);case"auto":return(function(t,r,e){if(isNaN(t)||!isFinite(t))return String(t);var n=e&&void 0!==e.lowerExp?e.lowerExp:-3,i=e&&void 0!==e.upperExp?e.upperExp:5,o=l(t),s=r?m(o,r):o;if(s.exponent<n||s.exponent>=i)return d(t,r);var a=s.coefficients,u=s.exponent;a.length<r&&(a=a.concat(g(r-a.length))),a=a.concat(g(u-a.length+1+(a.length<r?r-a.length:0))),a=g(-u).concat(a);var c=u>0?u:0;return c<a.length-1&&a.splice(c+1,0,"."),s.sign+a.join("")})(t,e,r&&r).replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],r=arguments[4];return"."!==t?t+r:r});default:throw Error('Unknown notation "'+o+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function l(t){var r=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!r)throw SyntaxError("Invalid number "+t);var e=r[1],n=r[2],i=parseFloat(r[4]||"0"),o=n.indexOf(".");i+=-1!==o?o-1:n.length-1;var s=n.replace(".","").replace(/^0*/,function(t){return i-=t.length,""}).replace(/0*$/,"").split("").map(function(t){return parseInt(t)});return 0===s.length&&(s.push(0),i++),{sign:e,coefficients:s,exponent:i}}function d(t,r){if(isNaN(t)||!isFinite(t))return String(t);var e=l(t),n=r?m(e,r):e,i=n.coefficients,o=n.exponent;i.length<r&&(i=i.concat(g(r-i.length)));var s=i.shift();return n.sign+s+(i.length>0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function m(t,r){for(var e={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},n=e.coefficients;r<=0;)n.unshift(0),e.exponent++,r++;if(n.length>r&&n.splice(r,n.length-r)[0]>=5){var i=r-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),e.exponent++,i++),i--,n[i]++}return e}function g(t){for(var r=[],e=0;e<t;e++)r.push(0);return r}function v(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}var y=Number.EPSILON||2220446049250313e-31;function w(t,r,e){if(null==e)return t===r;if(t===r)return!0;if(isNaN(t)||isNaN(r))return!1;if(isFinite(t)&&isFinite(r)){var n=Math.abs(t-r);return n<y||n<=Math.max(Math.abs(t),Math.abs(r))*e}return!1}},32718(t,r,e){"use strict";e.d(r,{K:()=>c,Mx:()=>u,QO:()=>function t(r,e){var n,i,o;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(i=0,o=r.length;i<o;i++)if(!t(r[i],e[i]))return!1;return!0}if("function"==typeof r)return r===e;if(!(r instanceof Object))return r===e;if(Array.isArray(e)||!(e instanceof Object))return!1;for(n in r)if(!(n in e)||!t(r[n],e[n]))return!1;for(n in e)if(!(n in r))return!1;return!0},RZ:()=>s,mQ:()=>a,o8:()=>function t(r){var e=typeof r;if("number"===e||"string"===e||"boolean"===e||null==r)return r;if("function"==typeof r.clone)return r.clone();if(Array.isArray(r))return r.map(function(r){return t(r)});if(r instanceof Date)return new Date(r.valueOf());if((0,n.C4)(r))return r;if(r instanceof RegExp)throw TypeError("Cannot clone "+r);return i(r,t)},rU:()=>o,s8:()=>i,zu:()=>f,zw:()=>function t(r,e){if(Array.isArray(e))throw TypeError("Arrays are not supported by deepExtend");for(var n in e)if(a(e,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(e[n]&&e[n].constructor===Object)void 0===r[n]&&(r[n]={}),r[n]&&r[n].constructor===Object?t(r[n],e[n]):r[n]=e[n];else if(Array.isArray(e[n]))throw TypeError("Arrays are not supported by deepExtend");else r[n]=e[n];return r}});var n=e(46797);function i(t,r){var e={};for(var n in t)a(t,n)&&(e[n]=r(t[n]));return e}function o(t){var r={};return function t(r,e){for(var n in r)if(a(r,n)){var i=r[n];"object"==typeof i&&null!==i?t(i,e):e[n]=i}}(t,r),r}function s(t,r,e){var n,i=!0;Object.defineProperty(t,r,{get:function(){return i&&(n=e(),i=!1),n},set:function(t){n=t,i=!1},configurable:!0,enumerable:!0})}function a(t,r){return t&&Object.hasOwnProperty.call(t,r)}function u(t){return t&&"function"==typeof t.factory}function c(t,r){for(var e={},n=0;n<r.length;n++){var i=r[n],o=t[i];void 0!==o&&(e[i]=o)}return e}function f(t){return Object.keys(t).map(r=>t[r])}},93988(t,r,e){"use strict";e.d(r,{GP:()=>function t(r,e){var a=function(r,e){var a;if("number"==typeof r)return(0,i.GP)(r,e);if((0,n.C4)(r))return function(t,r){if("function"==typeof r)return r(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var e="auto";if(void 0!==r&&(r.notation&&(e=r.notation),"number"==typeof r?l=r:r.precision&&(l=r.precision),r.wordSize)&&"number"!=typeof(d=r.wordSize))throw Error('Option "wordSize" must be a number');switch(e){case"fixed":return n=t,i=l,n.toFixed(i);case"exponential":return s(t,l);case"engineering":return a=t,u=l,f=(c=a.e)%3==0?c:c<0?c-3-c%3:c-c%3,-1!==(p=(h=a.mul(Math.pow(10,-f))).toPrecision(u)).indexOf("e")&&(p=h.toString()),p+"e"+(c>=0?"+":"")+f.toString();case"bin":return o(t,2,d);case"oct":return o(t,8,d);case"hex":return o(t,16,d);case"auto":var n,i,a,u,c,f,h,p,l,d,m=r&&void 0!==r.lowerExp?r.lowerExp:-3,g=r&&void 0!==r.upperExp?r.upperExp:5;if(t.isZero())return"0";var v=t.toSignificantDigits(l),y=v.e;return(y>=m&&y<g?v.toFixed():s(t,l)).replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],r=arguments[4];return"."!==t?t+r:r});default:throw Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(r,e);if((a=r)&&"object"==typeof a&&"number"==typeof a.s&&"number"==typeof a.n&&"number"==typeof a.d)if(!e||"decimal"!==e.fraction)return r.s*r.n+"/"+r.d;else return r.toString();if(Array.isArray(r))return function r(e,n){if(!Array.isArray(e))return t(e,n);for(var i="[",o=e.length,s=0;s<o;s++)0!==s&&(i+=", "),i+=r(e[s],n);return i+"]"}(r,e);if((0,n.Kg)(r))return'"'+r+'"';if("function"==typeof r)return r.syntax?String(r.syntax):"function";if(r&&"object"==typeof r)if("function"==typeof r.format)return r.format(e);else return r&&r.toString(e)!==({}).toString()?r.toString(e):"{"+Object.keys(r).map(n=>'"'+n+'": '+t(r[n],e)).join(", ")+"}";return String(r)}(r,e);return e&&"object"==typeof e&&"truncate"in e&&a.length>e.truncate?a.substring(0,e.truncate-3)+"...":a}});var n=e(46797),i=e(55624);function o(t,r,e){var n=new t.constructor(2),o="";if(e){if(e<1)throw Error("size must be in greater than 0");if(!(0,i.YN)(e))throw Error("size must be an integer");if(t.greaterThan(n.pow(e-1).sub(1))||t.lessThan(n.pow(e-1).mul(-1)))throw Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!t.isInteger())throw Error("Value must be an integer");t.lessThan(0)&&(t=t.add(n.pow(e))),o="i".concat(e)}switch(r){case 2:return"".concat(t.toBinary()).concat(o);case 8:return"".concat(t.toOctal()).concat(o);case 16:return"".concat(t.toHexadecimal()).concat(o);default:throw Error("Base ".concat(r," not supported "))}}function s(t,r){return void 0!==r?t.toExponential(r-1):t.toExponential()}}}]);
@@ -1,15 +0,0 @@
1
- /*!
2
- * decimal.js v10.6.0
3
- * An arbitrary-precision Decimal type for JavaScript.
4
- * https://github.com/MikeMcl/decimal.js
5
- * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
6
- * MIT Licence
7
- */
8
-
9
- /**
10
- * @license Fraction.js v4.3.7 31/08/2023
11
- * https://www.xarg.org/2014/03/rational-numbers-in-javascript/
12
- *
13
- * Copyright (c) 2023, Robert Eisele (robert@raw.org)
14
- * Dual licensed under the MIT or GPL Version 2 licenses.
15
- **/
@@ -1 +0,0 @@
1
- "use strict";(self["chunk_TimeSeriesChart "]=self["chunk_TimeSeriesChart "]||[]).push([["558"],{23712(){}}]);