@pie-element/number-line 13.1.2-next.3 → 13.1.2-next.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"impureFunctionsAny.generated-oSB8bQ6J.js","names":["name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","ownKeys","_objectSpread","name","dependencies","name","dependencies","isVariableNode","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","createMap","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies"],"sources":["../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/keywords.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/Node.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/utils/access.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/utils/assign.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/operators.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/BlockNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js","../../../../../node_modules/.bun/escape-latex@1.2.0/node_modules/escape-latex/dist/index.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/utils/latex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/IndexNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/utils/scope.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/RangeNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/parse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/compile.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/evaluate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/Parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/Help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/type/chain/Chain.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/fraction/num.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/fraction/den.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/compile.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/nullish.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/bernoulli.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/toBest.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isBounded.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isFinite.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/type/chain/function/chain.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/leafCount.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/resolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/derivative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/rationalize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/json/reviver.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/mapSlices.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/column.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/index.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/map.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/max.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/min.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/range.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/row.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/std.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/print.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/and.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/or.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/nullish.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js"],"sourcesContent":["// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);","import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});","import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}","import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n * @param {boolean} [optionalChaining=false]\n * Optional property, if the accessor was written as optional-chaining\n * using `a?.b`, or `a?.[\"b\"] with bracket notation.\n * Forces evaluate to undefined if the given object is undefined or null.\n */\n constructor(object, index) {\n var optionalChaining = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n this.optionalChaining = optionalChaining;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n var optionalChaining = this.optionalChaining;\n var prevOptionalChaining = isAccessorNode(this.object) && this.object.optionalChaining;\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n var ctx = context || {};\n var object = evalObject(scope, args, ctx);\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true;\n return undefined;\n }\n if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) {\n return undefined;\n }\n\n // get a property from an object evaluated using the scope.\n return getSafeProperty(object, prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var ctx = context || {};\n var object = evalObject(scope, args, ctx);\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true;\n return undefined;\n }\n if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) {\n return undefined;\n }\n\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)), this.optionalChaining);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index, this.optionalChaining);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n var optionalChaining = this.optionalChaining ? this.index.dotNotation ? '?' : '?.' : '';\n return object + optionalChaining + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + object + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n optionalChaining: this.optionalChaining\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index, json.optionalChaining);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '<span class=\"math-parenthesis math-square-parenthesis\">[</span>' + items.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-square-parenthesis\">]</span>';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});","import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}","// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // nullish coalescing\n 'OperatorNode:nullish': {\n op: '??',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '<span class=\"math-paranthesis math-round-parenthesis\">(</span>' + value + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n return object + index + '<span class=\"math-operator math-assignment-operator ' + 'math-variable-assignment-operator math-binary-operator\">=</span>' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : '<span class=\"math-separator\">;</span>');\n }).join('<span class=\"math-separator\"><br /></span>');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + condition + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + trueExpr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + falseExpr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return condition + '<span class=\"math-operator math-conditional-operator\">?</span>' + trueExpr + '<span class=\"math-operator math-conditional-operator\">:</span>' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});","\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};","/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n fraction: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : y^${args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node', 'isBounded'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n isBounded\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '<span class=\"math-number\">' + value + '</span>';\n case 'string':\n return '<span class=\"math-string\">' + value + '</span>';\n case 'boolean':\n return '<span class=\"math-boolean\">' + value + '</span>';\n case 'null':\n return '<span class=\"math-null-symbol\">' + value + '</span>';\n case 'undefined':\n return '<span class=\"math-undefined\">' + value + '</span>';\n default:\n return '<span class=\"math-symbol\">' + value + '</span>';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n if (!isBounded(this.value)) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var expr = this.expr;\n var evalExpr = expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n fn.expr = expr.toString();\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('<span class=\"math-symbol math-parameter\">' + escape(this.params[i]) + '</span>');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + expr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return '<span class=\"math-function\">' + escape(this.name) + '</span>' + '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + params.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>' + '<span class=\"math-operator math-assignment-operator ' + 'math-variable-assignment-operator math-binary-operator\">=</span>' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context);\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '<span class=\"math-operator math-accessor-operator\">.</span>' + '<span class=\"math-symbol math-property\">' + escape(this.getObjectProperty()) + '</span>';\n } else {\n return '<span class=\"math-parenthesis math-square-parenthesis\">[</span>' + dimensions.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-square-parenthesis\">]</span>';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.<string, Node>} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('<span class=\"math-symbol math-property\">' + escape(key) + '</span>' + '<span class=\"math-operator math-assignment-operator ' + 'math-property-assignment-operator math-binary-operator\">' + ':</span>' + this.properties[key].toHTML(options));\n }\n }\n return '<span class=\"math-parenthesis math-curly-parenthesis\">{</span>' + entries.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-curly-parenthesis\">}</span>';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});","import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + operand + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (assoc === 'right') {\n // prefix operator\n return '<span class=\"math-operator math-unary-operator ' + 'math-lefthand-unary-operator\">' + escape(this.op) + '</span>' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '<span class=\"math-operator math-unary-operator ' + 'math-righthand-unary-operator\">' + escape(this.op) + '</span>';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + lhs + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + rhs + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '<span class=\"math-operator math-binary-operator ' + 'math-implicit-binary-operator\"></span>' + rhs;\n }\n return lhs + '<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(this.op) + '</span>' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + arg + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('<span class=\"math-operator math-binary-operator ' + 'math-implicit-binary-operator\"></span>');\n }\n return stringifiedArgs.join('<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(this.op) + '</span>');\n } else {\n // fallback to formatting as a function call\n return '<span class=\"math-function\">' + escape(this.fn) + '</span><span class=\"math-paranthesis math-round-parenthesis\">' + '(</span>' + stringifiedArgs.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + this.content.toHTML(options) + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + start + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + step + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str += '<span class=\"math-operator math-range-operator\">:</span>' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + end + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str += '<span class=\"math-operator math-range-operator\">:</span>' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + p.toHTML(options) + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(operatorMap[this.conditionals[i]]) + '</span>' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});","import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '<span class=\"math-symbol math-boolean\">' + name + '</span>';\n } else if (name === 'i') {\n return '<span class=\"math-symbol math-imaginary-symbol\">' + name + '</span>';\n } else if (name === 'Infinity') {\n return '<span class=\"math-symbol math-infinity-symbol\">' + name + '</span>';\n } else if (name === 'NaN') {\n return '<span class=\"math-symbol math-nan-symbol\">' + name + '</span>';\n } else if (name === 'null') {\n return '<span class=\"math-symbol math-null-symbol\">' + name + '</span>';\n } else if (name === 'undefined') {\n return '<span class=\"math-symbol math-undefined-symbol\">' + name + '</span>';\n }\n return '<span class=\"math-symbol\">' + name + '</span>';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymbolNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args, optional) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n var optionalType = typeof optional;\n if (!(optionalType === 'undefined' || optionalType === 'boolean')) {\n throw new TypeError('optional flag, if specified, must be boolean');\n }\n this.fn = fn;\n this.args = args || [];\n this.optional = !!optional;\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n var fromOptionalChaining = this.optional || isAccessorNode(this.fn) && this.fn.optionalChaining;\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else if (fromOptionalChaining) value = undefined;else return FunctionNode.onUndefinedFunction(_name);\n if (typeof value === 'function' || fromOptionalChaining && value === undefined) {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n\n // the original function can be overwritten in the scope with a non-rawArgs function\n if (fn.rawArgs === true) {\n return fn(rawArgs, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n }\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (fromOptionalChaining && fn === undefined) return undefined;\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n\n // Optional chaining: if the base object is nullish, short-circuit to undefined\n if (fromOptionalChaining && (object == null || object[prop] === undefined)) {\n return undefined;\n }\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (fromOptionalChaining && fn === undefined) return undefined;\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '<span class=\"math-function\">' + escape(this.fn) + '</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>' + args.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate() or transformed into a functional object via node.compile().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b')\n * node2.evaluate(scope) // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * History:\n *\n * v0.9 Created\n * v0.13 Switched to one-based indices\n * v0.14 Added `[1,2;3,4]` notation for matrices\n * v0.18 Dropped the `function` keyword\n * v0.20 Added ternary conditional\n * v0.27 Allow multi-line expressions; allow functions that receive\n * unevaluated parameters (`rawArgs`)\n * v3 Add object notation; allow assignments internal to other\n * expressions\n * v7.3 Supported binary, octal, and hexadecimal notation\n * v9.5 Support for calculations with percentages\n * v12.4 Allow trailing commas in matrices\n * v14.8 Add nullish coalescing operator\n * v15.1 Add optional chaining operator\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object<string, Node>}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function Array__Matrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function string_Object(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '?.': true,\n '??': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n // Special case: the check for '?.' is to prevent a case like 'a?.3:.7' from being interpreted as optional chaining\n // TODO: refactor the tokenization into some better way to deal with cases like 'a?.3:.7', see https://github.com/josdejong/mathjs/pull/3584\n if (c2.length === 2 && DELIMITERS[c2] && (c2 !== '?.' || !parse.isDigit(state.expression.charAt(state.index + 2)))) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (parse.isDecimalMark(nextCharacter(state), state.expression.charAt(state.index + 2))) {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\u00A0' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n if (node.optionalChaining) {\n throw createSyntaxError(state, 'Cannot assign to optional chain');\n }\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && '])},;'.includes(state.token)) {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n if (state.conditionalLevel === state.nestingLevel) {\n // we are in the midst of parsing a conditional operator, so not\n // a range, but rather an empty true-expr, which is considered a\n // syntax error\n throw createSyntaxError(state, 'The true-expression of a conditional operator may not be empty');\n } else {\n // implicit start of range = 1 (one-based)\n node = new ConstantNode(1);\n }\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivideModulus(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivideModulus(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide, modulus\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivideModulus(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide',\n '%': 'mod',\n mod: 'mod'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseUnaryPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(' || state.token === 'in') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseUnaryPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Unary percentage operator (treated as `value / 100`)\n * @return {Node} node\n * @private\n */\n function parseUnaryPercentage(state) {\n var node = parseUnary(state);\n if (state.token === '%') {\n var previousState = _extends({}, state);\n getTokenSkipNewline(state);\n // We need to decide if this is a unary percentage % or binary modulo %\n // So we attempt to parse a unary expression at this point.\n // If it fails, then the only possibility is that this is a unary percentage.\n // If it succeeds, then we presume that this must be binary modulo, since the\n // only things that parseUnary can handle are _higher_ precedence than unary %.\n try {\n parseUnary(state);\n // Not sure if we could somehow use the result of that parseUnary? Without\n // further analysis/testing, safer just to discard and let the parse proceed\n _extends(state, previousState);\n } catch (_unused) {\n // Not seeing a term at this point, so was a unary %\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseNullishCoalescing(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * nullish coalescing operator\n * @return {Node} node\n * @private\n */\n function parseNullishCoalescing(state) {\n var node = parseLeftHandOperators(state);\n while (state.token === '??') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('??', 'nullish', [node, parseLeftHandOperators(state)]);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2) or sqrt?.(2) with optional chaining\n * - index enclosed in square brackets [...], for example A[2,3] or A?.[2,3] with optional chaining\n * - dot notation for properties, like foo.bar or foo?.bar with optional chaining\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n\n // Iterate and handle chained accessors, including repeated optional chaining\n while (true) {\n // eslint-disable-line no-unmodified-loop-condition\n // Track whether an optional chaining operator precedes the next accessor\n var optional = false;\n\n // Consume an optional chaining operator if present\n if (state.token === '?.') {\n optional = true;\n // consume the '?.' token\n getToken(state);\n }\n var hasNextAccessor = (state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token));\n if (!(optional || hasNextAccessor)) {\n break;\n }\n params = [];\n if (state.token === '(') {\n if (optional || isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation: fn(2, 3) or obj.fn(2, 3) or (anything)?.(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params, optional);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params), optional);\n } else {\n // dot notation like variable.prop\n // consume the `.` (if it was ?., already consumed):\n if (!optional) getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n var message = 'Property name expected after ';\n message += optional ? 'optional chain' : 'dot';\n throw createSyntaxError(state, message);\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation), optional);\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});","import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});","import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * The expression parser does not use JavaScript. Its syntax is close\n * to JavaScript but more suited for mathematical expressions.\n * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn\n * the syntax and get an overview of the exact differences from JavaScript.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function string_Map__Object(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function Array__Matrix_Map__Object(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});","import { factory } from '../utils/factory.js';\nimport { isFunction } from '../utils/is.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate', 'parse'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate,\n parse\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n function isValidVariableName(name) {\n if (name.length === 0) {\n return false;\n }\n for (var i = 0; i < name.length; i++) {\n var cPrev = name.charAt(i - 1);\n var c = name.charAt(i);\n var cNext = name.charAt(i + 1);\n var valid = parse.isAlpha(c, cPrev, cNext) || i > 0 && parse.isDigit(c);\n if (!valid) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n if (!isValidVariableName(name)) {\n throw new Error(\"Invalid variable name: '\".concat(name, \"'. Variable names must follow the specified rules.\"));\n }\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n Parser.prototype.toJSON = function () {\n var json = {\n mathjs: 'Parser',\n variables: {},\n functions: {}\n };\n for (var [_name2, value] of this.scope) {\n if (isFunction(value)) {\n if (!isExpressionFunction(value)) {\n throw new Error(\"Cannot serialize external function \".concat(_name2));\n }\n json.functions[_name2] = \"\".concat(value.syntax, \" = \").concat(value.expr);\n } else {\n json.variables[_name2] = value;\n }\n }\n return json;\n };\n Parser.fromJSON = function (json) {\n var parser = new Parser();\n Object.entries(json.variables).forEach(_ref2 => {\n var [name, value] = _ref2;\n return parser.set(name, value);\n });\n Object.entries(json.functions).forEach(_ref3 => {\n var [_name, fn] = _ref3;\n return parser.evaluate(fn);\n });\n return parser;\n };\n return Parser;\n}, {\n isClass: true\n});\nfunction isExpressionFunction(value) {\n return typeof value === 'function' && typeof value.syntax === 'string' && typeof value.expr === 'string';\n}","import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});","import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});","import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});","export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};","export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};","export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};","export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};","export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};","export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};","export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};","export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};","export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};","export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};","export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',\n examples: ['phi'],\n seealso: []\n};","export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n description: 'The number pi is a mathematical constant that is the ratio of a circle\\'s circumference to its diameter, and is approximately equal to 3.14159',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};","export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};","export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};","export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};","export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};","export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};","export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};","export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};","export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};","export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};","export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix', 'number', 'range', 'string', 'unit']\n};","export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], \"sparse\")', 'matrix([3, 4; 5, 6], \"sparse\", \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};","export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};","export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};","export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};","export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};","export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};","export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};","export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};","export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',\n examples: ['derivative(\"2x^3\", \"x\")', 'derivative(\"2x^3\", \"x\", {simplify: false})', 'derivative(\"2x^2 + 3x + 4\", \"x\")', 'derivative(\"sin(2x)\", \"x\")', 'f = parse(\"x^2 + x\")', 'x = parse(\"x\")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};","export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};","export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};","export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};","export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};","export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};","export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};","export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};","export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};","export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n examples: ['resolve(parse(\"1 + x\"), { x: 7 })', 'resolve(parse(\"size(text)\"), { text: \"Hello World\" })', 'resolve(parse(\"x + y\"), { x: parse(\"3z\") })', 'resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};","export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};","export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};","export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};","export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',\n examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};","export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};","export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};","export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};","export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};","export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};","export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};","export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)', 'ceil(x, n)', 'ceil(unit, valuelessUnit)', 'ceil(unit, n, valuelessUnit)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)', 'ceil(3.241cm, cm)', 'ceil(3.241cm, 2, cm)'],\n seealso: ['floor', 'fix', 'round']\n};","export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};","export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};","export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};","export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};","export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};","export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\\'s formula'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};","export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};","export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};","export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)', 'fix(x, n)', 'fix(unit, valuelessUnit)', 'fix(unit, n, valuelessUnit)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)', 'fix(3.241cm, cm)', 'fix(3.241cm, 2, cm)'],\n seealso: ['ceil', 'floor', 'round']\n};","export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)', 'floor(x, n)', 'floor(unit, valuelessUnit)', 'floor(unit, n, valuelessUnit)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)', 'floor(3.241cm, cm)', 'floor(3.241cm, 2, cm)'],\n seealso: ['ceil', 'fix', 'round']\n};","export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};","export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenuse of a list with values.',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};","export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};","export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};","export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',\n examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};","export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};","export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};","export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};","export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};","export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};","export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], \"inf\")', 'norm([[1, 2], [3, 4]], \"fro\")']\n};","export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation \"x^root = A\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};","export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation \"x^root = A\". ' + 'This function returns an array of complex values.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};","export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};","export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',\n examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'],\n seealso: ['ceil', 'floor', 'fix']\n};","export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};","export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};","export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};","export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'],\n seealso: ['schur', 'lyap']\n};","export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};","export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};","export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};","export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};","export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};","export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};","export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};","export var numDocs = {\n name: 'num',\n category: 'Fraction',\n syntax: ['num(x)'],\n description: 'Get the numerator of a fraction.',\n examples: ['num(fraction(2, 3))', 'num(fraction(5, 8))'],\n seealso: ['den', 'fraction']\n};","export var denDocs = {\n name: 'den',\n category: 'Fraction',\n syntax: ['den(x)'],\n description: 'Get the denominator of a fraction.',\n examples: ['den(fraction(2, 3))', 'den(fraction(5, 8))'],\n seealso: ['num', 'fraction']\n};","export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};","export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};","export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};","export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\n description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};","export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\n description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};","export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};","export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n description: 'The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers', 'bernoulli']\n};","export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};","export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};","export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};","export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};","export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n examples: ['evaluate(\"2 + 3\")', 'evaluate(\"sqrt(16)\")', 'evaluate(\"2 inch to cm\")', 'evaluate(\"sin(x * pi)\", { \"x\": 1/2 })', 'evaluate([\"width=2\", \"height=4\",\"width*height\"])'],\n seealso: ['parser', 'parse', 'compile']\n};","export var parserDocs = {\n name: 'parser',\n category: 'Expression',\n syntax: ['parser()'],\n description: 'Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.',\n examples: ['myParser = parser()', 'myParser.evaluate(\"sqrt(3^2 + 4^2)\")', 'myParser.set(\"x\", 3)', 'myParser.evaluate(\"y = x + 3\")', 'myParser.evaluate([\"y = x + 3\", \"y = y + 1\"])', 'myParser.get(\"y\")'],\n seealso: ['evaluate', 'parse', 'compile']\n};","export var parseDocs = {\n name: 'parse',\n category: 'Expression',\n syntax: ['parse(expr)', 'parse(expr, options)', 'parse([expr1, expr2, expr3, ...])', 'parse([expr1, expr2, expr3, ...], options)'],\n description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().',\n examples: ['node1 = parse(\"sqrt(3^2 + 4^2)\")', 'node1.evaluate()', 'code1 = node1.compile()', 'code1.evaluate()', 'scope = {a: 3, b: 4}', 'node2 = parse(\"a * b\")', 'node2.evaluate(scope)', 'code2 = node2.compile()', 'code2.evaluate(scope)'],\n seealso: ['parser', 'evaluate', 'compile']\n};","export var compileDocs = {\n name: 'compile',\n category: 'Expression',\n syntax: ['compile(expr) ', 'compile([expr1, expr2, expr3, ...])'],\n description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.',\n examples: ['code1 = compile(\"sqrt(3^2 + 4^2)\")', 'code1.evaluate() ', 'code2 = compile(\"a * b\")', 'code2.evaluate({a: 3, b: 4})'],\n seealso: ['parser', 'parse', 'evaluate']\n};","export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};","export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};","export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};","export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};","export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};","export var nullishDocs = {\n name: 'nullish',\n category: 'Logical',\n syntax: ['x ?? y', 'nullish(x, y)'],\n description: 'Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.',\n examples: ['null ?? 42', 'undefined ?? 42', '0 ?? 42', 'false ?? 42', 'null ?? undefined ?? 42'],\n seealso: ['and', 'or', 'not']\n};","export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};","export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};","export var mapSlicesDocs = {\n name: 'mapSlices',\n category: 'Matrix',\n syntax: ['mapSlices(A, dim, callback)'],\n description: 'Generate a matrix one dimension less than A by applying callback to ' + 'each slice of A along dimension dim.',\n examples: ['A = [[1, 2], [3, 4]]', 'mapSlices(A, 1, sum)',\n // returns [4, 6]\n 'mapSlices(A, 2, prod)' // returns [2, 12]\n ],\n seealso: ['map', 'forEach']\n};","export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};","export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};","export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};","export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};","export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \\'rectangular\\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'],\n examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'],\n seealso: ['subtract', 'partitionSelect']\n};","export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};","export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};","export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};","export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};","export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};","export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n description: 'Find the data type of all elements in a matrix or array, ' + 'for example \"number\" if all items are a number ' + 'and \"Complex\" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return \"mixed\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};","export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore–Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};","export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the Kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};","export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)', 'map(x, y, ..., callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.',\n examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'],\n seealso: ['filter', 'forEach']\n};","export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};","export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], \"sparse\", g)', 'matrixFromFunction([5], random)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};","export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};","export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \\'desc\\') # returns 2, arr is now: [5, 2, 1]', 'arr'],\n seealso: ['sort']\n};","export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range(\"4:10\")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'],\n seealso: ['size', 'squeeze', 'resize']\n};","export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize(\"hello\", [8], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};","export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit(\"35deg\"))', 'rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],\n seealso: ['matrix', 'rotationMatrix']\n};","export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};","export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};","export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n examples: ['sort([5, 10, 1])', 'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)', 'sort([\"10\", \"1\", \"2\"], \"natural\")'],\n seealso: ['map', 'filter', 'forEach']\n};","export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};","export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.',\n examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};","export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};","export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};","export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};","export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional Fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};","export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse Fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};","export var bernoulliDocs = {\n name: 'bernoulli',\n category: 'Probability',\n syntax: ['bernoulli(n)'],\n description: 'The nth Bernoulli number',\n examples: ['bernoulli(4)', 'bernoulli(fraction(12))'],\n seealso: ['combinations', 'gamma', 'stirlingS2']\n};","export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};","export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};","export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};","export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};","export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\n description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};","export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};","export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};","export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};","export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'],\n seealso: ['random', 'randomInt']\n};","export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};","export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};","export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};","export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural(\"2\", \"10\")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};","export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareText(\"B\", \"A\")', 'compareText(\"A\", \"B\")', 'compareText(\"A\", \"A\")', 'compareText(\"2\", \"10\")', 'compare(\"2\", \"10\")', 'compare(2, 10)', 'compareNatural(\"2\", \"10\")', 'compareText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural']\n};","export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};","export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};","export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};","export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};","export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};","export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};","export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};","export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};","export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};","export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};","export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};","export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};","export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};","export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};","export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n description: 'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};","export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};","export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};","export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};","export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\\'s Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};","export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};","export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.',\n examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};","export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.',\n examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};","export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};","export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};","export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};","export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], \"uncorrected\")', 'std([2, 4, 6, 8], \"biased\")', 'std([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};","export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'variance']\n};","export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], \"uncorrected\")', 'variance([2, 4, 6, 8], \"biased\")', 'variance([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};","export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};","export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};","export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};","export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};","export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};","export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};","export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};","export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};","export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};","export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};","export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};","export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};","export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};","export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};","export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};","export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};","export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};","export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};","export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};","export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};","export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};","export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};","export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};","export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};","export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};","export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};","export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};","export var toBestDocs = {\n name: 'toBest',\n category: 'Units',\n syntax: ['toBest(x)', 'toBest(x, unitList)', 'toBest(x, unitList, options)'],\n description: 'Converts to the most appropriate display unit.',\n examples: ['toBest(unit(5000, \"m\"))', 'toBest(unit(3500000, \"W\"))', 'toBest(unit(0.000000123, \"A\"))', 'toBest(unit(10, \"m\"), \"cm\")', 'toBest(unit(10, \"m\"), \"mm,km\", {offset: 1.5})'],\n seealso: []\n};","export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};","export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};","export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};","export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};","export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};","export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};","export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero', 'isFinite', 'isBounded']\n};","export var isBoundedDocs = {\n name: 'isBounded',\n category: 'Utils',\n syntax: ['isBounded(x)'],\n description: 'Test whether a value or its entries are bounded.',\n examples: ['isBounded(Infinity)', 'isBounded(bigint(3))', 'isBounded([3, -Infinity, -3])'],\n seealso: ['isFinite', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\n};","export var isFiniteDocs = {\n name: 'isFinite',\n category: 'Utils',\n syntax: ['isFinite(x)'],\n description: 'Test whether a value is finite, elementwise on collections.',\n examples: ['isFinite(Infinity)', 'isFinite(bigint(3))', 'isFinite([3, -Infinity, -3])'],\n seealso: ['isBounded', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\n};","export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};","export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue', 'isFinite', 'isBounded']\n};","export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};","export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};","export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};","export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};","export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};","export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n examples: ['print(\"Lucy is $age years old\", {age: 5})', 'print(\"The value of pi is $pi\", {pi: pi}, 3)', 'print(\"Hello, $user.name!\", {user: {name: \"John\"}})', 'print(\"Values: $1, $2, $3\", [6, 9, 4])'],\n seealso: ['format']\n};","export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};","export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],\n seealso: ['derivative', 'simplifyCore']\n};","import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { numDocs } from './function/fraction/num.js';\nimport { denDocs } from './function/fraction/den.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { parserDocs } from './function/expression/parser.js';\nimport { parseDocs } from './function/expression/parse.js';\nimport { compileDocs } from './function/expression/compile.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { nullishDocs } from './function/logical/nullish.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { mapSlicesDocs } from './function/matrix/mapSlices.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { bernoulliDocs } from './function/probability/bernoulli.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { toBestDocs } from './function/units/toBest.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isBoundedDocs } from './function/utils/isBounded.js';\nimport { isFiniteDocs } from './function/utils/isFinite.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant. Deprecated in favor of coulombConstant',\n examples: ['coulombConstant']\n },\n coulombConstant: {\n description: 'Coulomb\\'s constant',\n examples: ['coulombConstant']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Bohr magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Bohr radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n num: numDocs,\n den: denDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n parse: parseDocs,\n parser: parserDocs,\n compile: compileDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n nullish: nullishDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n mapSlices: mapSlicesDocs,\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n bernoulli: bernoulliDocs,\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n toBest: toBestDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isBounded: isBoundedDocs,\n isFinite: isFiniteDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};","import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});","import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});","import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});","import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var _findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n _findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n _findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});","import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['typed', 'parse', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode', 'replacer'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n replacer\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or √3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or √3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i], replacer);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});","import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', 'isBounded', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n isBounded,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function Node_Object(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isBounded(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function string_Object(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function Fraction_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumber_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function number_Object(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigint_Object(s, options) {\n return s;\n },\n 'Complex, Object': function Complex_Object(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function Matrix_Object(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function Array_Object(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n // note: we convert await from bigint values, because bigint values gives issues with divisions: 1n/2n=0n and not 0.5\n var fromBigInt = value => config.number === 'BigNumber' && bignumber ? bignumber(value) : Number(value);\n var numeratorValue = f.s * f.n;\n var numeratorNode = numeratorValue < 0n ? new OperatorNode('-', 'unaryMinus', [new ConstantNode(-fromBigInt(numeratorValue))]) : new ConstantNode(fromBigInt(numeratorValue));\n return f.d === 1n ? numeratorNode : new OperatorNode('/', 'divide', [numeratorNode, new ConstantNode(fromBigInt(f.d))]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});","import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});","import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});","import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});","import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var cache = new Map();\n var variableName = variable.name;\n function isConstCached(node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var res = _isConst(isConstCached, node, variableName);\n cache.set(node, res);\n return res;\n }\n var res = _derivative(expr, isConstCached);\n return options.simplify ? simplify(res) : res;\n }\n function parseIdentifier(string) {\n var symbol = parse(string);\n if (!symbol.isSymbolNode) {\n throw new TypeError('Invalid variable. ' + \"Cannot parse \".concat(JSON.stringify(string), \" into a variable in function derivative\"));\n }\n return symbol;\n }\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative,\n 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)),\n 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options)\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n <create caching isConst>\n res = _derivative(res, isConst)\n }\n return res\n }\n */\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function Node_SymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function Node_ConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function Node_SymbolNode_ConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function string_string_number(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Checks if a node is constants (e.g. 2 + 2).\n * Accepts (usually memoized) version of self as the first parameter for recursive calls.\n * Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {function} isConst Function that tells whether sub-expression is a constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n var _isConst = typed('_isConst', {\n 'function, ConstantNode, string': function function_ConstantNode_string() {\n return true;\n },\n 'function, SymbolNode, string': function function_SymbolNode_string(isConst, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n return node.name !== varName;\n },\n 'function, ParenthesisNode, string': function function_ParenthesisNode_string(isConst, node, varName) {\n return isConst(node.content, varName);\n },\n 'function, FunctionAssignmentNode, string': function function_FunctionAssignmentNode_string(isConst, node, varName) {\n if (!node.params.includes(varName)) {\n return true;\n }\n return isConst(node.expr, varName);\n },\n 'function, FunctionNode | OperatorNode, string': function function_FunctionNode__OperatorNode_string(isConst, node, varName) {\n return node.args.every(arg => isConst(arg, varName));\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {function} isConst Function that tells if a node is constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, function': function ConstantNode_function() {\n return createConstantNode(0);\n },\n 'SymbolNode, function': function SymbolNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, function': function ParenthesisNode_function(node, isConst) {\n return new ParenthesisNode(_derivative(node.content, isConst));\n },\n 'FunctionAssignmentNode, function': function FunctionAssignmentNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, isConst);\n },\n 'FunctionNode, function': function FunctionNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), isConst);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && isConst(node.args[1])) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), isConst);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), isConst);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, isConst);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, function': function OperatorNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, isConst);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst), _derivative(node.args[1], isConst)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return isConst(arg);\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return !isConst(arg);\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, isConst));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, isConst) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (isConst(arg1)) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, isConst), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (isConst(arg0)) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, isConst), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, isConst), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, isConst)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (isConst(_arg)) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), isConst)])]);\n }\n if (isConst(_arg2)) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, isConst);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, isConst), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, isConst), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, isConst), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});","import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un�ry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});","import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMapSlices } from '../../function/matrix/mapSlices.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'mapSlices';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.mapSlices\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mapSlices\n * from one-based to zero based\n */\nexport var createMapSlicesTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var mapSlices = createMapSlices({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('mapSlices', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return mapSlices.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, _objectSpread({\n isTransformFunction: true\n}, createMapSlices.meta));","import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}","import { factory } from '../../../utils/factory.js';\nvar name = 'transformCallback';\nvar dependencies = ['typed'];\nexport var createTransformCallback = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Transforms the given callback function based on its type and number of arrays.\n *\n * @param {Function} callback - The callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n return function (callback, numberOfArrays) {\n if (typed.isTypedFunction(callback)) {\n return _transformTypedCallbackFunction(callback, numberOfArrays);\n } else {\n return _transformCallbackFunction(callback, callback.length, numberOfArrays);\n }\n };\n\n /**\n * Transforms the given typed callback function based on the number of arrays.\n *\n * @param {Function} typedFunction - The typed callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n function _transformTypedCallbackFunction(typedFunction, numberOfArrays) {\n var signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => {\n var [signature, callbackFunction] = _ref2;\n var numberOfCallbackInputs = signature.split(',').length;\n if (typed.isTypedFunction(callbackFunction)) {\n return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)];\n } else {\n return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)];\n }\n }));\n if (typeof typedFunction.name === 'string') {\n return typed(typedFunction.name, signatures);\n } else {\n return typed(signatures);\n }\n }\n});\n\n/**\n * Transforms the callback function based on the number of callback inputs and arrays.\n * There are three cases:\n * 1. The callback function has N arguments.\n * 2. The callback function has N+1 arguments.\n * 3. The callback function has 2N+1 arguments.\n *\n * @param {Function} callbackFunction - The callback function to transform.\n * @param {number} numberOfCallbackInputs - The number of callback inputs.\n * @param {number} numberOfArrays - The number of arrays.\n * @returns {Function} The transformed callback function.\n */\nfunction _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) {\n if (numberOfCallbackInputs === numberOfArrays) {\n return callbackFunction;\n } else if (numberOfCallbackInputs === numberOfArrays + 1) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n return callbackFunction(...vals, idx);\n };\n } else if (numberOfCallbackInputs > numberOfArrays + 1) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n var rest = args.slice(numberOfArrays + 1);\n return callbackFunction(...vals, idx, ...rest);\n };\n } else {\n return callbackFunction;\n }\n}\n\n/**\n * Transforms the dimensions by adding 1 to each dimension.\n *\n * @param {Array} dims - The dimensions to transform.\n * @returns {Array} The transformed dimensions.\n */\nfunction _transformDims(dims) {\n return dims.map(dim => dim + 1);\n}","import { createFilter } from '../../function/matrix/filter.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var filter = createFilter({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n if (args.length === 0) {\n return filter();\n }\n var x = args[0];\n if (args.length === 1) {\n return filter(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return filter(x, transformCallback(callback, N));\n }\n filterTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return filterTransform;\n}, {\n isTransformFunction: true\n});","import { createForEach } from '../../function/matrix/forEach.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var forEach = createForEach({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function forEachTransform(args, math, scope) {\n if (args.length === 0) {\n return forEach();\n }\n var x = args[0];\n if (args.length === 1) {\n return forEach(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return forEach(x, transformCallback(callback, N));\n }\n forEachTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return forEachTransform;\n}, {\n isTransformFunction: true\n});","import { isArray, isBigInt, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg) || isBigInt(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, bigint, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { createMap } from '../../function/matrix/map.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var map = createMap({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function mapTransform(args, math, scope) {\n if (args.length === 0) {\n return map();\n }\n if (args.length === 1) {\n return map(args[0]);\n }\n var N = args.length - 1;\n var X = args.slice(0, N);\n var callback = args[N];\n X = X.map(arg => _compileAndEvaluate(arg, scope));\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return map(...X, transformCallback(callback, N));\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n }\n mapTransform.rawArgs = true;\n return mapTransform;\n}, {\n isTransformFunction: true\n});","import { isNumber, isBigNumber } from '../../../utils/is.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function dimToZeroBase(dim) {\n if (isNumber(dim)) {\n return dim - 1;\n } else if (isBigNumber(dim)) {\n return dim.minus(1);\n } else {\n return dim;\n }\n}\nexport function isNumberOrBigNumber(n) {\n return isNumber(n) || isBigNumber(n);\n}","import { isCollection } from '../../../utils/is.js';\nimport { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumberOrBigNumber(dim)) {\n args[1] = dimToZeroBase(dim);\n }\n }\n return args;\n}","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger', 'isNaN'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger,\n isNaN: mathIsNaN\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger,\n isNaN: mathIsNaN\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller', 'isNaN'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller,\n isNaN: mathIsNaN\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller,\n isNaN: mathIsNaN\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n equal,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isZero,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n equal,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isZero,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger', 'mapSlices'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger,\n mapSlices\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger,\n mapSlices\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});","import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'mapSlices', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n mapSlices,\n isNaN: mathIsNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n mapSlices,\n isNaN: mathIsNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function string_Object__Array(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function string_Object__Array_number__Object(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});","import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});","import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});","import { createNullish } from '../../function/logical/nullish.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'nullish';\nvar dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual'];\nexport var createNullishTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n size,\n flatten,\n deepEqual\n } = _ref;\n var nullish = createNullish({\n typed,\n matrix,\n size,\n flatten,\n deepEqual\n });\n function nullishTransform(args, math, scope) {\n var left = args[0].compile().evaluate(scope);\n\n // If left is not a collection and not nullish, short-circuit and return it\n if (!isCollection(left) && left != null && left !== undefined) {\n return left;\n }\n\n // Otherwise evaluate right and apply full nullish semantics (incl. element-wise)\n var right = args[1].compile().evaluate(scope);\n return nullish(left, right);\n }\n nullishTransform.rawArgs = true;\n return nullishTransform;\n}, {\n isTransformFunction: true\n});","import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});","import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});","import _extends from \"@babel/runtime/helpers/extends\";\n/**\n * THIS FILE IS AUTO-GENERATED\n * DON'T MAKE CHANGES HERE\n */\nimport { config } from './configReadonly.js';\nimport { createNode, createObjectNode, createOperatorNode, createParenthesisNode, createRelationalNode, createArrayNode, createBlockNode, createConditionalNode, createRangeNode, createReviver, createChainClass, createFunctionAssignmentNode, createChain, createConstantNode, createIndexNode, createAccessorNode, createAssignmentNode, createSymbolNode, createFunctionNode, createParse, createResolve, createSimplifyConstant, createCompile, createEvaluate, createHelpClass, createParserClass, createSimplifyCore, createHelp, createSimplify, createSymbolicEqual, createDerivative, createParser, createLeafCount, createRationalize, createMapTransform, createFilterTransform, createForEachTransform, createMapSlicesTransform, createOrTransform, createAndTransform, createCumSumTransform, createMaxTransform, createNullishTransform, createPrintTransform, createBitAndTransform, createConcatTransform, createDiffTransform, createMinTransform, createSubsetTransform, createBitOrTransform, createSumTransform, createIndexTransform, createRowTransform, createColumnTransform, createMeanTransform, createRangeTransform, createVarianceTransform, createQuantileSeqTransform, createStdTransform } from '../factoriesAny.js';\nimport { BigNumber, Complex, e, _false, fineStructure, Fraction, i, _Infinity, LN10, LOG10E, Matrix, _NaN, _null, phi, Range, ResultSet, SQRT1_2,\n// eslint-disable-line camelcase\nsackurTetrode, tau, _true, version, DenseMatrix, efimovFactor, LN2, pi, replacer, SQRT2, typed, weakMixingAngle, abs, acos, acot, acsc, addScalar, arg, asech, asinh, atan, atanh, bigint, bitNot, boolean, clone, combinations, complex, conj, cos, cot, csc, cube, equalScalar, erf, exp, expm1, filter, flatten, forEach, format, getMatrixDataType, hex, im, isBounded, isNaN, isNumeric, isPrime, LOG2E, lgamma, log10, log2, map, mode, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, size, SparseMatrix, splitUnit, square, string, subtractScalar, tan, toBest, typeOf, acosh, acsch, asec, bignumber, combinationsWithRep, cosh, csch, dot, hasNumericValue, isFinite, isNegative, isZero, matrix, matrixFromFunction, multiply, ones, randomInt, resize, sech, sinh, sparse, sqrt, squeeze, tanh, transpose, xgcd, zeros, acoth, asin, bin, coth, ctranspose, diag, equal, fraction, identity, isInteger, kron, mapSlices, matrixFromColumns, num, reshape, round, unaryMinus, bernoulli, cbrt, concat, deepEqual, dotMultiply, floor, gcd, isPositive, larger, lcm, leftShift, mod, nthRoot, nullish, numeric, prod, rightArithShift, smaller, subtract, to, unaryPlus, xor, add, atan2, bitAnd, bitOr, bitXor, ceil, compare, compareText, composition, count, cross, diff, divideScalar, equalText, FibonacciHeap, fix, hypot, ImmutableDenseMatrix, Index, intersect, invmod, largerEq, log, lsolve, matrixFromRows, min, nthRoots, partitionSelect, qr, rightLogShift, slu, Spa, subset, sum, trace, usolve, zpk2tf, catalan, compareNatural, cumsum, det, dotDivide, index, inv, log1p, lsolveAll, max, or, pinv, pow, setCartesian, setDistinct, setIsSubset, setPowerset, smallerEq, sort, sqrtm, unequal, usolveAll, and, den, distance, dotPow, expm, fft, gamma, ifft, lup, range, row, setDifference, setMultiplicity, setSymDifference, Unit, vacuumImpedance, wienDisplacement, atomicMass, bohrMagneton, boltzmann, column, conductanceQuantum, coulomb, createUnit, deuteronMass, eigs, electronMass, factorial, fermiCoupling, gasConstant, gravity, klitzing, loschmidt, magneticConstant, molarMass, molarPlanckConstant, neutronMass, nuclearMagneton, permutations, planckConstant, planckMass, planckTime, protonMass, quantumOfCirculation, reducedPlanckConstant, secondRadiation, setSize, speedOfLight, stefanBoltzmann, thomsonCrossSection, avogadro, bohrRadius, coulombConstant, divide, elementaryCharge, faraday, freqz, gravitationConstant, inverseConductanceQuantum, lusolve, magneticFluxQuantum, molarMassC12, multinomial, planckCharge, planckTemperature, quantileSeq, rydberg, setIntersect, solveODE, stirlingS2, unit, bellNumbers, electricConstant, firstRadiation, hartreeEnergy, kldivergence, mean, molarVolume, planckLength, setUnion, variance, classicalElectronRadius, corr, median, polynomialRoot, std, zeta, mad, norm, rotationMatrix, rotate, schur, sylvester, lyap } from './pureFunctionsAny.generated.js';\nvar math = {}; // NOT pure!\nvar mathWithTransform = {}; // NOT pure!\nvar classes = {}; // NOT pure!\n\nexport var Node = createNode({\n mathWithTransform\n});\nexport var ObjectNode = createObjectNode({\n Node\n});\nexport var OperatorNode = createOperatorNode({\n Node\n});\nexport var ParenthesisNode = createParenthesisNode({\n Node\n});\nexport var RelationalNode = createRelationalNode({\n Node\n});\nexport var ArrayNode = createArrayNode({\n Node\n});\nexport var BlockNode = createBlockNode({\n Node,\n ResultSet\n});\nexport var ConditionalNode = createConditionalNode({\n Node\n});\nexport var RangeNode = createRangeNode({\n Node\n});\nexport var reviver = createReviver({\n classes\n});\nexport var Chain = createChainClass({\n math,\n typed\n});\nexport var FunctionAssignmentNode = createFunctionAssignmentNode({\n Node,\n typed\n});\nexport var chain = createChain({\n Chain,\n typed\n});\nexport var ConstantNode = createConstantNode({\n Node,\n isBounded\n});\nexport var IndexNode = createIndexNode({\n Node,\n size\n});\nexport var AccessorNode = createAccessorNode({\n Node,\n subset\n});\nexport var AssignmentNode = createAssignmentNode({\n matrix,\n Node,\n subset\n});\nexport var SymbolNode = createSymbolNode({\n Unit,\n Node,\n math\n});\nexport var FunctionNode = createFunctionNode({\n Node,\n SymbolNode,\n math\n});\nexport var parse = createParse({\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode,\n config,\n numeric,\n typed\n});\nexport var resolve = createResolve({\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n parse,\n typed\n});\nexport var simplifyConstant = createSimplifyConstant({\n bignumber,\n fraction,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n config,\n isBounded,\n mathWithTransform,\n matrix,\n typed\n});\nexport var compile = createCompile({\n parse,\n typed\n});\nexport var evaluate = createEvaluate({\n parse,\n typed\n});\nexport var Help = createHelpClass({\n evaluate\n});\nexport var Parser = createParserClass({\n evaluate,\n parse\n});\nexport var simplifyCore = createSimplifyCore({\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n add,\n divide,\n equal,\n isZero,\n multiply,\n parse,\n pow,\n subtract,\n typed\n});\nexport var help = createHelp({\n Help,\n mathWithTransform,\n typed\n});\nexport var simplify = createSimplify({\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n equal,\n parse,\n replacer,\n resolve,\n simplifyConstant,\n simplifyCore,\n typed\n});\nexport var symbolicEqual = createSymbolicEqual({\n OperatorNode,\n parse,\n simplify,\n typed\n});\nexport var derivative = createDerivative({\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n config,\n equal,\n isZero,\n numeric,\n parse,\n simplify,\n typed\n});\nexport var parser = createParser({\n Parser,\n typed\n});\nexport var leafCount = createLeafCount({\n parse,\n typed\n});\nexport var rationalize = createRationalize({\n bignumber,\n fraction,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n add,\n config,\n divide,\n equal,\n isZero,\n mathWithTransform,\n matrix,\n multiply,\n parse,\n pow,\n simplify,\n simplifyConstant,\n simplifyCore,\n subtract,\n typed\n});\n_extends(math, {\n e,\n false: _false,\n fineStructure,\n i,\n Infinity: _Infinity,\n LN10,\n LOG10E,\n NaN: _NaN,\n null: _null,\n phi,\n SQRT1_2,\n sackurTetrode,\n tau,\n true: _true,\n 'E': e,\n version,\n efimovFactor,\n LN2,\n pi,\n replacer,\n reviver,\n SQRT2,\n typed,\n 'PI': pi,\n weakMixingAngle,\n abs,\n acos,\n acot,\n acsc,\n addScalar,\n arg,\n asech,\n asinh,\n atan,\n atanh,\n bigint,\n bitNot,\n boolean,\n clone,\n combinations,\n complex,\n conj,\n cos,\n cot,\n csc,\n cube,\n equalScalar,\n erf,\n exp,\n expm1,\n filter,\n flatten,\n forEach,\n format,\n getMatrixDataType,\n hex,\n im,\n isBounded,\n isNaN,\n isNumeric,\n isPrime,\n LOG2E,\n lgamma,\n log10,\n log2,\n map,\n mode,\n multiplyScalar,\n not,\n number,\n oct,\n pickRandom,\n print,\n random,\n re,\n sec,\n sign,\n sin,\n size,\n splitUnit,\n square,\n string,\n subtractScalar,\n tan,\n toBest,\n typeOf,\n acosh,\n acsch,\n asec,\n bignumber,\n chain,\n combinationsWithRep,\n cosh,\n csch,\n dot,\n hasNumericValue,\n isFinite,\n isNegative,\n isZero,\n matrix,\n matrixFromFunction,\n multiply,\n ones,\n randomInt,\n resize,\n sech,\n sinh,\n sparse,\n sqrt,\n squeeze,\n tanh,\n transpose,\n xgcd,\n zeros,\n acoth,\n asin,\n bin,\n coth,\n ctranspose,\n diag,\n equal,\n fraction,\n identity,\n isInteger,\n kron,\n mapSlices,\n matrixFromColumns,\n num,\n reshape,\n round,\n unaryMinus,\n bernoulli,\n cbrt,\n concat,\n deepEqual,\n dotMultiply,\n floor,\n gcd,\n isPositive,\n larger,\n lcm,\n leftShift,\n mod,\n nthRoot,\n nullish,\n numeric,\n prod,\n rightArithShift,\n smaller,\n subtract,\n to,\n unaryPlus,\n xor,\n add,\n atan2,\n bitAnd,\n bitOr,\n bitXor,\n ceil,\n compare,\n compareText,\n composition,\n count,\n cross,\n diff,\n divideScalar,\n equalText,\n fix,\n hypot,\n intersect,\n invmod,\n largerEq,\n log,\n lsolve,\n matrixFromRows,\n min,\n nthRoots,\n partitionSelect,\n qr,\n rightLogShift,\n slu,\n subset,\n sum,\n trace,\n usolve,\n zpk2tf,\n catalan,\n compareNatural,\n cumsum,\n det,\n dotDivide,\n index,\n inv,\n log1p,\n lsolveAll,\n max,\n or,\n pinv,\n pow,\n setCartesian,\n setDistinct,\n setIsSubset,\n setPowerset,\n smallerEq,\n sort,\n sqrtm,\n unequal,\n usolveAll,\n and,\n den,\n distance,\n dotPow,\n expm,\n fft,\n gamma,\n ifft,\n lup,\n range,\n row,\n setDifference,\n setMultiplicity,\n setSymDifference,\n vacuumImpedance,\n wienDisplacement,\n atomicMass,\n bohrMagneton,\n boltzmann,\n column,\n conductanceQuantum,\n coulomb,\n createUnit,\n deuteronMass,\n eigs,\n electronMass,\n factorial,\n fermiCoupling,\n gasConstant,\n gravity,\n klitzing,\n loschmidt,\n magneticConstant,\n molarMass,\n molarPlanckConstant,\n neutronMass,\n nuclearMagneton,\n permutations,\n planckConstant,\n planckMass,\n planckTime,\n protonMass,\n quantumOfCirculation,\n reducedPlanckConstant,\n secondRadiation,\n setSize,\n speedOfLight,\n stefanBoltzmann,\n thomsonCrossSection,\n avogadro,\n bohrRadius,\n coulombConstant,\n divide,\n elementaryCharge,\n faraday,\n freqz,\n gravitationConstant,\n inverseConductanceQuantum,\n lusolve,\n magneticFluxQuantum,\n molarMassC12,\n multinomial,\n planckCharge,\n planckTemperature,\n quantileSeq,\n rydberg,\n setIntersect,\n solveODE,\n stirlingS2,\n unit,\n bellNumbers,\n electricConstant,\n firstRadiation,\n hartreeEnergy,\n kldivergence,\n mean,\n molarVolume,\n planckLength,\n setUnion,\n variance,\n classicalElectronRadius,\n corr,\n median,\n parse,\n polynomialRoot,\n resolve,\n simplifyConstant,\n std,\n zeta,\n compile,\n evaluate,\n mad,\n simplifyCore,\n help,\n norm,\n rotationMatrix,\n simplify,\n symbolicEqual,\n derivative,\n parser,\n rotate,\n leafCount,\n rationalize,\n schur,\n sylvester,\n lyap,\n config\n});\n_extends(mathWithTransform, math, {\n map: createMapTransform({\n typed\n }),\n filter: createFilterTransform({\n typed\n }),\n forEach: createForEachTransform({\n typed\n }),\n mapSlices: createMapSlicesTransform({\n isInteger,\n typed\n }),\n or: createOrTransform({\n DenseMatrix,\n concat,\n equalScalar,\n matrix,\n typed\n }),\n and: createAndTransform({\n add,\n concat,\n equalScalar,\n matrix,\n not,\n typed,\n zeros\n }),\n cumsum: createCumSumTransform({\n add,\n typed,\n unaryPlus\n }),\n max: createMaxTransform({\n config,\n isNaN,\n larger,\n numeric,\n typed\n }),\n nullish: createNullishTransform({\n deepEqual,\n flatten,\n matrix,\n size,\n typed\n }),\n print: createPrintTransform({\n add,\n matrix,\n typed,\n zeros\n }),\n bitAnd: createBitAndTransform({\n add,\n concat,\n equalScalar,\n matrix,\n not,\n typed,\n zeros\n }),\n concat: createConcatTransform({\n isInteger,\n matrix,\n typed\n }),\n diff: createDiffTransform({\n bignumber,\n matrix,\n number,\n subtract,\n typed\n }),\n min: createMinTransform({\n config,\n isNaN,\n numeric,\n smaller,\n typed\n }),\n subset: createSubsetTransform({\n add,\n matrix,\n typed,\n zeros\n }),\n bitOr: createBitOrTransform({\n DenseMatrix,\n concat,\n equalScalar,\n matrix,\n typed\n }),\n sum: createSumTransform({\n add,\n config,\n numeric,\n typed\n }),\n index: createIndexTransform({\n Index,\n getMatrixDataType\n }),\n row: createRowTransform({\n Index,\n matrix,\n range,\n typed\n }),\n column: createColumnTransform({\n Index,\n matrix,\n range,\n typed\n }),\n mean: createMeanTransform({\n add,\n divide,\n typed\n }),\n range: createRangeTransform({\n bignumber,\n matrix,\n add,\n config,\n equal,\n isPositive,\n isZero,\n larger,\n largerEq,\n smaller,\n smallerEq,\n typed\n }),\n variance: createVarianceTransform({\n add,\n divide,\n isNaN,\n mapSlices,\n multiply,\n subtract,\n typed\n }),\n quantileSeq: createQuantileSeqTransform({\n add,\n bignumber,\n compare,\n divide,\n isInteger,\n larger,\n mapSlices,\n multiply,\n partitionSelect,\n smaller,\n smallerEq,\n subtract,\n typed\n }),\n std: createStdTransform({\n map,\n sqrt,\n typed,\n variance\n })\n});\n_extends(classes, {\n BigNumber,\n Complex,\n Fraction,\n Matrix,\n Node,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n Range,\n RelationalNode,\n ResultSet,\n ArrayNode,\n BlockNode,\n ConditionalNode,\n DenseMatrix,\n RangeNode,\n Chain,\n FunctionAssignmentNode,\n SparseMatrix,\n ConstantNode,\n IndexNode,\n FibonacciHeap,\n ImmutableDenseMatrix,\n Index,\n Spa,\n AccessorNode,\n AssignmentNode,\n Unit,\n SymbolNode,\n FunctionNode,\n Help,\n Parser\n});\nChain.createProxy(math);\nexport { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js';"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329],"mappings":";;AACA,IAAW,KAAW,IAAI,IAAI,CAAC,KAAK,CAAC,GCM1B,KAA4B,kBAAQA,QAAMC,CADjC,mBACiCA,IAAc,MAAQ;CACzE,IAAI,EACF,yBACE;CAMJ,SAAS,EAAe,GAAO;EAC7B,KAAK,IAAI,KAAU,CAAC,GAAG,EAAQ,GAC7B,IAAI,EAAM,IAAI,CAAM,GAClB,MAAU,MAAM,yCAAwC,IAAS,0BAAyB;CAGhG;CACA,MAAM,EAAK;EACT,IAAI,OAAO;GACT,OAAO;EACT;EACA,IAAI,SAAS;GACX,OAAO;EACT;EAOA,SAAS,GAAO;GACd,OAAO,KAAK,QAAQ,EAAE,SAAS,CAAK;EACtC;EAUA,UAAU;GACR,IAAI,IAAO,KAAK,SAAS,GAAmB,CAAC,CAAC,GAC1C,IAAO,CAAC,GACR,IAAU;GACd,SAAS,EAAS,GAAO;IACvB,IAAI,IAAI,EAAU,CAAK;IAEvB,OADA,EAAe,CAAC,GACT,EAAK,GAAG,GAAM,CAAO;GAC9B;GACA,OAAO,EACL,YACF;EACF;EAeA,SAAS,GAAM,GAAU;GACvB,MAAU,MAAM,iDAAiD,KAAK,IAAI;EAC5E;EAMA,QAAQ,GAAU;GAEhB,MAAU,MAAM,wCAAwC;E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,GAAG;GACH,GAAG;EACL;EAIA;GACE,GAAG;GAEH,UAAU,EACR,UAAU,EACR,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU,EACR,UAAU,EACR,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,aAAa,GACf;IACA,UAAU,EACR,OAAO,GACT;GACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,aAAa,GACf;IACA,UAAU,EACR,OAAO,GACT;GACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,aAAa,GACf;IACA,UAAU,EACR,OAAO,GACT;GACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;GACH,QAAQ;EACV;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAEA;GACE,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAKA;EAIA;GACE,GAAG;GACH,UAAU,EACR,KAAK,EACH,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU;IACR,QAAQ,EACN,OAAO,GACT;IACA,UAAU,EACR,aAAa,GACf;GACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;EAIH;GACE,GAAG;GACH,UAAU,EACR,UAAU,EACR,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,OAAO,GACT;IACA,UAAU,EACR,aAAa,GACf;GACF;EACF;EAEA;GACE,GAAG;GACH,UAAU,EACR,KAAK,EACH,aAAa,GACf,EACF;GACA,eAAe,EACb,KAAK,EACH,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;GACA,eAAe,EACb,UAAU,EACR,aAAa,GACf,EACF;EACF;EAGA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GAEH,UAAU,EACR,UAAU,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;AACF,CAAC,GACU,KAAkB,GAAsB,EACjD,QACF,CAAC,GACU,KAAY,GAAgB,EACrC,QACF,CAAC,GACU,KAAU,GAAc,EACjC,YACF,CAAC,GACU,KAAQ,GAAiB;CAClC;CACA;AACF,CAAC,GACU,KAAyB,GAA6B;CAC/D;CACA;AACF,CAAC,GACU,KAAQ,GAAY;CAC7B;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;AACF,CAAC,GACU,KAAY,GAAgB;CACrC;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;AACF,CAAC,GACU,KAAiB,GAAqB;CAC/C;CACA;CACA;AACF,CAAC,GACU,KAAa,GAAiB;CACvC;CACA;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;CACA;AACF,CAAC,GACU,KAAQ,GAAY;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAU,GAAc;CACjC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAmB,GAAuB;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAU,GAAc;CACjC;CACA;AACF,CAAC,GACU,KAAW,GAAe;CACnC;CACA;AACF,CAAC,GACU,KAAO,GAAgB,EAChC,aACF,CAAC,GACU,KAAS,GAAkB;CACpC;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAO,GAAW;CAC3B;CACA;CACA;AACF,CAAC,GACU,KAAW,GAAe;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAyDD,GAAS,IAAM;CACb;CACA,OAAO;CACP;CACA;CACA,UAAU;CACV;CACA;CACA,KAAK;CACL,MAAM;CACN;CACA;CACA;CACA;CACA,MAAM;CACN,GAAK;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,IAAM;CACN;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,OAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,SAAA;CACA,QAAA;CACA;CACA;CACA;CACA;CACA,OAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,KAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,QAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,WAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,eA1WyB,GAAoB;EAC7C;EACA;EACA;EACA;CACF,CAqWE;CACA,YArWsB,GAAiB;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAwVE;CACA,QAxVkB,GAAa;EAC/B;EACA;CACF,CAqVE;CACA;CACA,WAtVqB,GAAgB;EACrC;EACA;CACF,CAmVE;CACA,aAnVuB,GAAkB;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAwTE;CACA;CACA;CACA;CACA;AACF,CAAC,GACD,GAAS,IAAmB,IAAM;CAChC,KAAK,GAAmB,EACtB,SACF,CAAC;CACD,QAAQ,GAAsB,EAC5B,SACF,CAAC;CACD,SAAS,GAAuB,EAC9B,SACF,CAAC;CACD,WAAW,GAAyB;EAClC,WAAA;EACA;CACF,CAAC;CACD,IAAI,GAAkB;EACpB;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA,OAAA;EACA;EACA;EACA;CACF,CAAC;CACD,SAAS,GAAuB;EAC9B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B,WAAA;EACA;EACA;CACF,CAAC;CACD,MAAM,GAAoB;EACxB;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA,OAAA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,GAAoB;EACxB;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,UAAU,GAAwB;EAChC;EACA;EACA,OAAA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,aAAa,GAA2B;EACtC;EACA;EACA;EACA;EACA,WAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB,KAAA;EACA;EACA;EACA;CACF,CAAC;AACH,CAAC,GACD,GAAS,IAAS;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACD,GAAM,YAAY,EAAI"}
1
+ {"version":3,"file":"impureFunctionsAny.generated-BwG6hrJc.js","names":["name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","ownKeys","_objectSpread","name","dependencies","name","dependencies","isVariableNode","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","createMap","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies","name","dependencies"],"sources":["../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/keywords.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/Node.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/errorTransform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/utils/access.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/AccessorNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ArrayNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/utils/assign.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/operators.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/AssignmentNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/BlockNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ConditionalNode.js","../../../../../node_modules/.bun/escape-latex@1.2.0/node_modules/escape-latex/dist/index.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/utils/latex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ConstantNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/FunctionAssignmentNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/IndexNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ObjectNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/utils/scope.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/OperatorNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/ParenthesisNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/RangeNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/RelationalNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/SymbolNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/node/FunctionNode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/parse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/compile.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/evaluate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/Parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/Help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/type/chain/Chain.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/e.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/false.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/i.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/Infinity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN10.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LN2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG10E.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/LOG2E.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/NaN.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/null.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/phi.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/pi.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT1_2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/SQRT2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/tau.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/true.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/constants/version.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bignumber.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/bigint.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/boolean.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/complex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/createUnit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/fraction.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/index.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/matrix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/number.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/sparse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/splitUnit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/string.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/construction/unit.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/config.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/import.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/core/typed.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/derivative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/leafCount.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lsolveAll.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lup.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lusolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/polynomialRoot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/qr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/rationalize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/resolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplify.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyConstant.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/simplifyCore.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/slu.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/symbolicEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/usolveAll.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/abs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/add.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cbrt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/ceil.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/cube.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/divide.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotDivide.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotMultiply.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/dotPow.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/exp.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/expm1.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/fix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/floor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/gcd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/hypot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/lcm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log10.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log1p.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/log2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/mod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/multiply.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/norm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/nthRoots.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/pow.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/round.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sign.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/sqrtm.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/sylvester.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/schur.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/algebra/lyap.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/square.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/subtract.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryMinus.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/unaryPlus.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/arithmetic/xgcd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/fraction/num.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/fraction/den.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitAnd.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitNot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitOr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/bitXor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/leftShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightArithShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/bitwise/rightLogShift.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/bellNumbers.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/catalan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/composition.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/combinatorics/stirlingS2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/arg.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/conj.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/im.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/complex/re.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/evaluate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parser.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/parse.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/compile.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/expression/help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/distance.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/geometry/intersect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/and.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/not.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/nullish.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/or.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/logical/xor.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/mapSlices.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/column.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/concat.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/count.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/cross.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ctranspose.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/det.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diag.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/diff.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/dot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/eigs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/filter.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/flatten.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/forEach.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/getMatrixDataType.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/identity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/inv.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/pinv.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/kron.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/map.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromColumns.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromFunction.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/matrixFromRows.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ones.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/partitionSelect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/range.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/reshape.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/resize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotate.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/rotationMatrix.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/row.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/size.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/sort.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/squeeze.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/subset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/trace.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/transpose.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/zeros.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/fft.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/matrix/ifft.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/bernoulli.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinations.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/combinationsWithRep.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/factorial.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/gamma.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/lgamma.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/kldivergence.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/multinomial.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/permutations.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/pickRandom.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/random.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/probability/randomInt.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compare.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareNatural.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/compareText.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/deepEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equal.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/equalText.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/larger.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/largerEq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smaller.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/smallerEq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/relational/unequal.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setCartesian.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDifference.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setDistinct.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIntersect.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setIsSubset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setMultiplicity.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setPowerset.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setSymDifference.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/set/setUnion.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/zpk2tf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/signal/freqz.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/erf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/special/zeta.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mad.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/max.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mean.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/median.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/min.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/mode.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/prod.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/quantileSeq.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/std.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/cumsum.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/sum.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/variance.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/statistics/corr.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acos.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acosh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acoth.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsc.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/acsch.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asec.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asech.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/asinh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atan2.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/atanh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cos.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cosh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/cot.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/coth.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csc.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/csch.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sec.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sech.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/sinh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tan.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/trigonometry/tanh.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/to.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/units/toBest.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/bin.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/clone.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/format.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hasNumericValue.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/hex.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isInteger.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNaN.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isBounded.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isFinite.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNegative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isNumeric.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPositive.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isPrime.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/isZero.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/numeric.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/oct.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/print.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/utils/typeOf.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/function/numeric/solveODE.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/embeddedDocs/embeddedDocs.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/function/help.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/type/chain/function/chain.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/leafCount.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify/wildcards.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify/util.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplify.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplifyConstant.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/simplifyCore.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/resolve.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/symbolicEqual.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/derivative.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/function/algebra/rationalize.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/json/reviver.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/mapSlices.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/column.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/compileInlineExpression.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/transformCallback.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/filter.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/forEach.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/index.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/map.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/dimToZeroBase.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/utils/lastDimToZeroBase.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/max.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/mean.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/min.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/range.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/row.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/subset.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/concat.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/diff.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/std.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/sum.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/quantileSeq.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/cumsum.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/variance.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/print.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/and.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/or.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/nullish.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/bitAnd.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/expression/transform/bitOr.transform.js","../../../../../node_modules/.bun/mathjs@15.2.0/node_modules/mathjs/lib/esm/entry/impureFunctionsAny.generated.js"],"sourcesContent":["// Reserved keywords not allowed to use in the parser\nexport var keywords = new Set(['end']);","import { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { deepStrictEqual } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMap } from '../../utils/map.js';\nvar name = 'Node';\nvar dependencies = ['mathWithTransform'];\nexport var createNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n mathWithTransform\n } = _ref;\n /**\n * Validate the symbol names of a scope.\n * Throws an error when the scope contains an illegal symbol.\n * @param {Object} scope\n */\n function _validateScope(scope) {\n for (var symbol of [...keywords]) {\n if (scope.has(symbol)) {\n throw new Error('Scope contains an illegal symbol, \"' + symbol + '\" is a reserved keyword');\n }\n }\n }\n class Node {\n get type() {\n return 'Node';\n }\n get isNode() {\n return true;\n }\n\n /**\n * Evaluate the node\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} Returns the result\n */\n evaluate(scope) {\n return this.compile().evaluate(scope);\n }\n\n /**\n * Compile the node into an optimized, evauatable JavaScript function\n * @return {{evaluate: function([Object])}} object\n * Returns an object with a function 'evaluate',\n * which can be invoked as expr.evaluate([scope: Object]),\n * where scope is an optional object with\n * variables.\n */\n compile() {\n var expr = this._compile(mathWithTransform, {});\n var args = {};\n var context = null;\n function evaluate(scope) {\n var s = createMap(scope);\n _validateScope(s);\n return expr(s, args, context);\n }\n return {\n evaluate\n };\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n throw new Error('Method _compile must be implemented by type ' + this.type);\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run forEach on a Node interface');\n }\n\n /**\n * Create a new Node whose children are the results of calling the\n * provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot run map on a Node interface');\n }\n\n /**\n * Validate whether an object is a Node, for use with map\n * @param {Node} node\n * @returns {Node} Returns the input if it's a node, else throws an Error\n * @protected\n */\n _ifNode(node) {\n if (!isNode(node)) {\n throw new TypeError('Callback function must return a Node');\n }\n return node;\n }\n\n /**\n * Recursively traverse all nodes in a node tree. Executes given callback for\n * this node and each of its child nodes.\n * @param {function(node: Node, path: string, parent: Node)} callback\n * A callback called for every node in the node tree.\n */\n traverse(callback) {\n // execute callback for itself\n // eslint-disable-next-line\n callback(this, null, null);\n\n // recursively traverse over all children of a node\n function _traverse(node, callback) {\n node.forEach(function (child, path, parent) {\n callback(child, path, parent);\n _traverse(child, callback);\n });\n }\n _traverse(this, callback);\n }\n\n /**\n * Recursively transform a node tree via a transform function.\n *\n * For example, to replace all nodes of type SymbolNode having name 'x' with\n * a ConstantNode with value 2:\n *\n * const res = Node.transform(function (node, path, parent) {\n * if (node && node.isSymbolNode) && (node.name === 'x')) {\n * return new ConstantNode(2)\n * }\n * else {\n * return node\n * }\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A mapping function accepting a node, and returning\n * a replacement for the node or the original node. The \"signature\"\n * of the callback must be:\n * callback(node: Node, index: string, parent: Node) : Node\n * @return {Node} Returns the original node or its replacement\n */\n transform(callback) {\n function _transform(child, path, parent) {\n var replacement = callback(child, path, parent);\n if (replacement !== child) {\n // stop iterating when the node is replaced\n return replacement;\n }\n return child.map(_transform);\n }\n return _transform(this, null, null);\n }\n\n /**\n * Find any node in the node tree matching given filter function. For\n * example, to find all nodes of type SymbolNode having name 'x':\n *\n * const results = Node.filter(function (node) {\n * return (node && node.isSymbolNode) && (node.name === 'x')\n * })\n *\n * @param {function(node: Node, path: string, parent: Node) : Node} callback\n * A test function returning true when a node matches, and false\n * otherwise. Function signature:\n * callback(node: Node, index: string, parent: Node) : boolean\n * @return {Node[]} nodes\n * An array with nodes matching given filter criteria\n */\n filter(callback) {\n var nodes = [];\n this.traverse(function (node, path, parent) {\n if (callback(node, path, parent)) {\n nodes.push(node);\n }\n });\n return nodes;\n }\n\n /**\n * Create a shallow clone of this node\n * @return {Node}\n */\n clone() {\n // must be implemented by each of the Node implementations\n throw new Error('Cannot clone a Node interface');\n }\n\n /**\n * Create a deep clone of this node\n * @return {Node}\n */\n cloneDeep() {\n return this.map(function (node) {\n return node.cloneDeep();\n });\n }\n\n /**\n * Deep compare this node with another node.\n * @param {Node} other\n * @return {boolean} Returns true when both nodes are of the same type and\n * contain the same values (as do their childs)\n */\n equals(other) {\n return other ? this.type === other.type && deepStrictEqual(this, other) : false;\n }\n\n /**\n * Get string representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toString(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toString(options);\n }\n\n /**\n * Internal function to generate the string output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toString() {\n // must be implemented by each of the Node implementations\n throw new Error('_toString not implemented for ' + this.type);\n }\n\n /**\n * Get a JSON representation of the node\n * Both .toJSON() and the static .fromJSON(json) should be implemented by all\n * implementations of Node\n * @returns {Object}\n */\n toJSON() {\n throw new Error('Cannot serialize object: toJSON not implemented by ' + this.type);\n }\n\n /**\n * Get HTML representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\" or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toHTML(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toHTML(options);\n }\n\n /**\n * Internal function to generate the HTML output.\n * This has to be implemented by every Node\n *\n * @throws {Error}\n */\n _toHTML() {\n // must be implemented by each of the Node implementations\n throw new Error('_toHTML not implemented for ' + this.type);\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n *\n * This function can get an object of the following form:\n * {\n * handler: //This can be a callback function of the form\n * // \"function callback(node, options)\"or\n * // a map that maps function names (used in FunctionNodes)\n * // to callbacks\n * parenthesis: \"keep\" //the parenthesis option (This is optional)\n * }\n *\n * @param {Object} [options]\n * @return {string}\n */\n toTex(options) {\n var customString = this._getCustomString(options);\n if (typeof customString !== 'undefined') {\n return customString;\n }\n return this._toTex(options);\n }\n\n /**\n * Internal function to generate the LaTeX output.\n * This has to be implemented by every Node\n *\n * @param {Object} [options]\n * @throws {Error}\n */\n _toTex(options) {\n // must be implemented by each of the Node implementations\n throw new Error('_toTex not implemented for ' + this.type);\n }\n\n /**\n * Helper used by `to...` functions.\n */\n _getCustomString(options) {\n if (options && typeof options === 'object') {\n switch (typeof options.handler) {\n case 'object':\n case 'undefined':\n return;\n case 'function':\n return options.handler(this, options);\n default:\n throw new TypeError('Object or function expected as callback');\n }\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type;\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} node\n **/\n getContent() {\n return this;\n }\n }\n return Node;\n}, {\n isClass: true,\n isNode: true\n});","import { IndexError } from '../../../error/IndexError.js';\n\n/**\n * Transform zero-based indices to one-based indices in errors\n * @param {Error} err\n * @returns {Error | IndexError} Returns the transformed error\n */\nexport function errorTransform(err) {\n if (err && err.isIndexError) {\n return new IndexError(err.index + 1, err.min + 1, err.max !== undefined ? err.max + 1 : undefined);\n }\n return err;\n}","import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { getSafeProperty } from '../../../utils/customs.js';\nexport function accessFactory(_ref) {\n var {\n subset\n } = _ref;\n /**\n * Retrieve part of an object:\n *\n * - Retrieve a property from an object\n * - Retrieve a part of a string\n * - Retrieve a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @return {Object | Array | Matrix | string} Returns the subset\n */\n return function access(object, index) {\n try {\n if (Array.isArray(object)) {\n return subset(object, index);\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index);\n } else if (typeof object === 'string') {\n // TODO: move getStringSubset into a separate util file, use that\n return subset(object, index);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw new TypeError('Cannot apply a numeric index as object property');\n }\n return getSafeProperty(object, index.getObjectProperty());\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isNode, isObjectNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nvar name = 'AccessorNode';\nvar dependencies = ['subset', 'Node'];\nexport var createAccessorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n\n /**\n * Are parenthesis needed?\n * @private\n */\n function needParenthesis(node) {\n // TODO: maybe make a method on the nodes which tells whether they need parenthesis?\n return !(isAccessorNode(node) || isArrayNode(node) || isConstantNode(node) || isFunctionNode(node) || isObjectNode(node) || isParenthesisNode(node) || isSymbolNode(node));\n }\n class AccessorNode extends Node {\n /**\n * @constructor AccessorNode\n * @extends {Node}\n * Access an object property or get a matrix subset\n *\n * @param {Node} object The object from which to retrieve\n * a property or subset.\n * @param {IndexNode} index IndexNode containing ranges\n * @param {boolean} [optionalChaining=false]\n * Optional property, if the accessor was written as optional-chaining\n * using `a?.b`, or `a?.[\"b\"] with bracket notation.\n * Forces evaluate to undefined if the given object is undefined or null.\n */\n constructor(object, index) {\n var optionalChaining = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n super();\n if (!isNode(object)) {\n throw new TypeError('Node expected for parameter \"object\"');\n }\n if (!isIndexNode(index)) {\n throw new TypeError('IndexNode expected for parameter \"index\"');\n }\n this.object = object;\n this.index = index;\n this.optionalChaining = optionalChaining;\n }\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAccessorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index._compile(math, argNames);\n var optionalChaining = this.optionalChaining;\n var prevOptionalChaining = isAccessorNode(this.object) && this.object.optionalChaining;\n if (this.index.isObjectProperty()) {\n var prop = this.index.getObjectProperty();\n return function evalAccessorNode(scope, args, context) {\n var ctx = context || {};\n var object = evalObject(scope, args, ctx);\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true;\n return undefined;\n }\n if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) {\n return undefined;\n }\n\n // get a property from an object evaluated using the scope.\n return getSafeProperty(object, prop);\n };\n } else {\n return function evalAccessorNode(scope, args, context) {\n var ctx = context || {};\n var object = evalObject(scope, args, ctx);\n if (optionalChaining && object == null) {\n ctx.optionalShortCircuit = true;\n return undefined;\n }\n if (prevOptionalChaining && ctx !== null && ctx !== void 0 && ctx.optionalShortCircuit) {\n return undefined;\n }\n\n // we pass just object here instead of context:\n var index = evalIndex(scope, args, object);\n return access(object, index);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n callback(this.index, 'index', this);\n }\n\n /**\n * Create a new AccessorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AccessorNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new AccessorNode(this._ifNode(callback(this.object, 'object', this)), this._ifNode(callback(this.index, 'index', this)), this.optionalChaining);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AccessorNode}\n */\n clone() {\n return new AccessorNode(this.object, this.index, this.optionalChaining);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n if (needParenthesis(this.object)) {\n object = '(' + object + ')';\n }\n var optionalChaining = this.optionalChaining ? this.index.dotNotation ? '?' : '?.' : '';\n return object + optionalChaining + this.index.toString(options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n if (needParenthesis(this.object)) {\n object = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + object + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return object + this.index.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n if (needParenthesis(this.object)) {\n object = '\\\\left(\\' + object + \\'\\\\right)';\n }\n return object + this.index.toTex(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n optionalChaining: this.optionalChaining\n };\n }\n\n /**\n * Instantiate an AccessorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AccessorNode\", object: ..., index: ...}`,\n * where mathjs is optional\n * @returns {AccessorNode}\n */\n static fromJSON(json) {\n return new AccessorNode(json.object, json.index, json.optionalChaining);\n }\n }\n _defineProperty(AccessorNode, \"name\", name);\n return AccessorNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isArrayNode, isNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ArrayNode';\nvar dependencies = ['Node'];\nexport var createArrayNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ArrayNode extends Node {\n /**\n * @constructor ArrayNode\n * @extends {Node}\n * Holds an 1-dimensional array with items\n * @param {Node[]} [items] 1 dimensional array with items\n */\n constructor(items) {\n super();\n this.items = items || [];\n\n // validate input\n if (!Array.isArray(this.items) || !this.items.every(isNode)) {\n throw new TypeError('Array containing Nodes expected');\n }\n }\n get type() {\n return name;\n }\n get isArrayNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalItems = map(this.items, function (item) {\n return item._compile(math, argNames);\n });\n var asMatrix = math.config.matrix !== 'Array';\n if (asMatrix) {\n var matrix = math.matrix;\n return function evalArrayNode(scope, args, context) {\n return matrix(map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n }));\n };\n } else {\n return function evalArrayNode(scope, args, context) {\n return map(evalItems, function (evalItem) {\n return evalItem(scope, args, context);\n });\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.items.length; i++) {\n var node = this.items[i];\n callback(node, 'items[' + i + ']', this);\n }\n }\n\n /**\n * Create a new ArrayNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ArrayNode} Returns a transformed copy of the node\n */\n map(callback) {\n var items = [];\n for (var i = 0; i < this.items.length; i++) {\n items[i] = this._ifNode(callback(this.items[i], 'items[' + i + ']', this));\n }\n return new ArrayNode(items);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ArrayNode}\n */\n clone() {\n return new ArrayNode(this.items.slice(0));\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var items = this.items.map(function (node) {\n return node.toString(options);\n });\n return '[' + items.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n items: this.items\n };\n }\n\n /**\n * Instantiate an ArrayNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ArrayNode\", items: [...]}`,\n * where mathjs is optional\n * @returns {ArrayNode}\n */\n static fromJSON(json) {\n return new ArrayNode(json.items);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var items = this.items.map(function (node) {\n return node.toHTML(options);\n });\n return '<span class=\"math-parenthesis math-square-parenthesis\">[</span>' + items.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-square-parenthesis\">]</span>';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n function itemsToTex(items, nested) {\n var mixedItems = items.some(isArrayNode) && !items.every(isArrayNode);\n var itemsFormRow = nested || mixedItems;\n var itemSep = itemsFormRow ? '&' : '\\\\\\\\';\n var itemsTex = items.map(function (node) {\n if (node.items) {\n return itemsToTex(node.items, !nested);\n } else {\n return node.toTex(options);\n }\n }).join(itemSep);\n return mixedItems || !itemsFormRow || itemsFormRow && !nested ? '\\\\begin{bmatrix}' + itemsTex + '\\\\end{bmatrix}' : itemsTex;\n }\n return itemsToTex(this.items, false);\n }\n }\n _defineProperty(ArrayNode, \"name\", name);\n return ArrayNode;\n}, {\n isClass: true,\n isNode: true\n});","import { errorTransform } from '../../transform/utils/errorTransform.js';\nimport { setSafeProperty } from '../../../utils/customs.js';\nexport function assignFactory(_ref) {\n var {\n subset,\n matrix\n } = _ref;\n /**\n * Replace part of an object:\n *\n * - Assign a property to an object\n * - Replace a part of a string\n * - Replace a matrix subset\n *\n * @param {Object | Array | Matrix | string} object\n * @param {Index} index\n * @param {*} value\n * @return {Object | Array | Matrix | string} Returns the original object\n * except in case of a string\n */\n // TODO: change assign to return the value instead of the object\n return function assign(object, index, value) {\n try {\n if (Array.isArray(object)) {\n var result = matrix(object).subset(index, value).valueOf();\n\n // shallow copy all (updated) items into the original array\n result.forEach((item, index) => {\n object[index] = item;\n });\n return object;\n } else if (object && typeof object.subset === 'function') {\n // Matrix\n return object.subset(index, value);\n } else if (typeof object === 'string') {\n // TODO: move setStringSubset into a separate util file, use that\n return subset(object, index, value);\n } else if (typeof object === 'object') {\n if (!index.isObjectProperty()) {\n throw TypeError('Cannot apply a numeric index as object property');\n }\n setSafeProperty(object, index.getObjectProperty(), value);\n return object;\n } else {\n throw new TypeError('Cannot apply index: unsupported type of object');\n }\n } catch (err) {\n throw errorTransform(err);\n }\n };\n}","// list of identifiers of nodes in order of their precedence\n// also contains information about left/right associativity\n// and which other operator the operator is associative with\n// Example:\n// addition is associative with addition and subtraction, because:\n// (a+b)+c=a+(b+c)\n// (a+b)-c=a+(b-c)\n//\n// postfix operators are left associative, prefix operators\n// are right associative\n//\n// It's also possible to set the following properties:\n// latexParens: if set to false, this node doesn't need to be enclosed\n// in parentheses when using LaTeX\n// latexLeftParens: if set to false, this !OperatorNode's!\n// left argument doesn't need to be enclosed\n// in parentheses\n// latexRightParens: the same for the right argument\nimport { hasOwnProperty } from '../utils/object.js';\nimport { isConstantNode, isParenthesisNode, rule2Node } from '../utils/is.js';\nexport var properties = [{\n // assignment\n AssignmentNode: {},\n FunctionAssignmentNode: {}\n}, {\n // conditional expression\n ConditionalNode: {\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // conditionals don't need parentheses in LaTeX because\n // they are 2 dimensional\n }\n}, {\n // logical or\n 'OperatorNode:or': {\n op: 'or',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical xor\n 'OperatorNode:xor': {\n op: 'xor',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // logical and\n 'OperatorNode:and': {\n op: 'and',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise or\n 'OperatorNode:bitOr': {\n op: '|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise xor\n 'OperatorNode:bitXor': {\n op: '^|',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitwise and\n 'OperatorNode:bitAnd': {\n op: '&',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // relational operators\n 'OperatorNode:equal': {\n op: '==',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:unequal': {\n op: '!=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smaller': {\n op: '<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:larger': {\n op: '>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:smallerEq': {\n op: '<=',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:largerEq': {\n op: '>=',\n associativity: 'left',\n associativeWith: []\n },\n RelationalNode: {\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // bitshift operators\n 'OperatorNode:leftShift': {\n op: '<<',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightArithShift': {\n op: '>>',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:rightLogShift': {\n op: '>>>',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // unit conversion\n 'OperatorNode:to': {\n op: 'to',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // range\n RangeNode: {}\n}, {\n // addition, subtraction\n 'OperatorNode:add': {\n op: '+',\n associativity: 'left',\n associativeWith: ['OperatorNode:add', 'OperatorNode:subtract']\n },\n 'OperatorNode:subtract': {\n op: '-',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // multiply, divide, modulus\n 'OperatorNode:multiply': {\n op: '*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n },\n 'OperatorNode:divide': {\n op: '/',\n associativity: 'left',\n associativeWith: [],\n latexLeftParens: false,\n latexRightParens: false,\n latexParens: false\n // fractions don't require parentheses because\n // they're 2 dimensional, so parens aren't needed\n // in LaTeX\n },\n 'OperatorNode:dotMultiply': {\n op: '.*',\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'OperatorNode:dotMultiply', 'OperatorNode:doDivide']\n },\n 'OperatorNode:dotDivide': {\n op: './',\n associativity: 'left',\n associativeWith: []\n },\n 'OperatorNode:mod': {\n op: 'mod',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // Repeat multiplication for implicit multiplication\n 'OperatorNode:multiply': {\n associativity: 'left',\n associativeWith: ['OperatorNode:multiply', 'OperatorNode:divide', 'Operator:dotMultiply', 'Operator:dotDivide']\n }\n}, {\n // unary prefix operators\n 'OperatorNode:unaryPlus': {\n op: '+',\n associativity: 'right'\n },\n 'OperatorNode:unaryMinus': {\n op: '-',\n associativity: 'right'\n },\n 'OperatorNode:bitNot': {\n op: '~',\n associativity: 'right'\n },\n 'OperatorNode:not': {\n op: 'not',\n associativity: 'right'\n }\n}, {\n // exponentiation\n 'OperatorNode:pow': {\n op: '^',\n associativity: 'right',\n associativeWith: [],\n latexRightParens: false\n // the exponent doesn't need parentheses in\n // LaTeX because it's 2 dimensional\n // (it's on top)\n },\n 'OperatorNode:dotPow': {\n op: '.^',\n associativity: 'right',\n associativeWith: []\n }\n}, {\n // nullish coalescing\n 'OperatorNode:nullish': {\n op: '??',\n associativity: 'left',\n associativeWith: []\n }\n}, {\n // factorial\n 'OperatorNode:factorial': {\n op: '!',\n associativity: 'left'\n }\n}, {\n // matrix transpose\n 'OperatorNode:ctranspose': {\n op: \"'\",\n associativity: 'left'\n }\n}];\n\n/**\n * Returns the first non-parenthesis internal node, but only\n * when the 'parenthesis' option is unset or auto.\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {Node}\n */\nfunction unwrapParen(_node, parenthesis) {\n if (!parenthesis || parenthesis !== 'auto') return _node;\n var node = _node;\n while (isParenthesisNode(node)) node = node.content;\n return node;\n}\n\n/**\n * Get the precedence of a Node.\n * Higher number for higher precedence, starting with 0.\n * Returns null if the precedence is undefined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @param {string} implicit\n * @param {Node} parent (for determining context for implicit multiplication)\n * @return {number | null}\n */\nexport function getPrecedence(_node, parenthesis, implicit, parent) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var precedence = null;\n for (var i = 0; i < properties.length; i++) {\n if (identifier in properties[i]) {\n precedence = i;\n break;\n }\n }\n // Bump up precedence of implicit multiplication, except when preceded\n // by a \"Rule 2\" fraction ( [unaryOp]constant / constant )\n if (identifier === 'OperatorNode:multiply' && node.implicit && implicit !== 'show') {\n var leftArg = unwrapParen(node.args[0], parenthesis);\n if (!(isConstantNode(leftArg) && parent && parent.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(parent.args[0], parenthesis))) && !(leftArg.getIdentifier() === 'OperatorNode:divide' && rule2Node(unwrapParen(leftArg.args[0], parenthesis)) && isConstantNode(unwrapParen(leftArg.args[1])))) {\n precedence += 1;\n }\n }\n return precedence;\n}\n\n/**\n * Get the associativity of an operator (left or right).\n * Returns a string containing 'left' or 'right' or null if\n * the associativity is not defined.\n *\n * @param {Node} _node\n * @param {string} parenthesis\n * @return {string|null}\n * @throws {Error}\n */\nexport function getAssociativity(_node, parenthesis) {\n var node = _node;\n if (parenthesis !== 'keep') {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n node = _node.getContent();\n }\n var identifier = node.getIdentifier();\n var index = getPrecedence(node, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifier];\n if (hasOwnProperty(property, 'associativity')) {\n if (property.associativity === 'left') {\n return 'left';\n }\n if (property.associativity === 'right') {\n return 'right';\n }\n // associativity is invalid\n throw Error('\\'' + identifier + '\\' has the invalid associativity \\'' + property.associativity + '\\'.');\n }\n\n // associativity is undefined\n return null;\n}\n\n/**\n * Check if an operator is associative with another operator.\n * Returns either true or false or null if not defined.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @param {string} parenthesis\n * @return {boolean | null}\n */\nexport function isAssociativeWith(nodeA, nodeB, parenthesis) {\n // ParenthesisNodes are only ignored when not in 'keep' mode\n var a = parenthesis !== 'keep' ? nodeA.getContent() : nodeA;\n var b = parenthesis !== 'keep' ? nodeA.getContent() : nodeB;\n var identifierA = a.getIdentifier();\n var identifierB = b.getIdentifier();\n var index = getPrecedence(a, parenthesis);\n if (index === null) {\n // node isn't in the list\n return null;\n }\n var property = properties[index][identifierA];\n if (hasOwnProperty(property, 'associativeWith') && property.associativeWith instanceof Array) {\n for (var i = 0; i < property.associativeWith.length; i++) {\n if (property.associativeWith[i] === identifierB) {\n return true;\n }\n }\n return false;\n }\n\n // associativeWith is not defined\n return null;\n}\n\n/**\n * Get the operator associated with a function name.\n * Returns a string with the operator symbol, or null if the\n * input is not the name of a function associated with an\n * operator.\n *\n * @param {string} Function name\n * @return {string | null} Associated operator symbol, if any\n */\nexport function getOperator(fn) {\n var identifier = 'OperatorNode:' + fn;\n for (var group of properties) {\n if (identifier in group) {\n return group[identifier].op;\n }\n }\n return null;\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { getSafeProperty, setSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { accessFactory } from './utils/access.js';\nimport { assignFactory } from './utils/assign.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'AssignmentNode';\nvar dependencies = ['subset', '?matrix',\n// FIXME: should not be needed at all, should be handled by subset\n'Node'];\nexport var createAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n subset,\n matrix,\n Node\n } = _ref;\n var access = accessFactory({\n subset\n });\n var assign = assignFactory({\n subset,\n matrix\n });\n\n /*\n * Is parenthesis needed?\n * @param {node} node\n * @param {string} [parenthesis='keep']\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n if (!parenthesis) {\n parenthesis = 'keep';\n }\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.value, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class AssignmentNode extends Node {\n /**\n * @constructor AssignmentNode\n * @extends {Node}\n *\n * Define a symbol, like `a=3.2`, update a property like `a.b=3.2`, or\n * replace a subset of a matrix like `A[2,2]=42`.\n *\n * Syntax:\n *\n * new AssignmentNode(symbol, value)\n * new AssignmentNode(object, index, value)\n *\n * Usage:\n *\n * new AssignmentNode(new SymbolNode('a'), new ConstantNode(2)) // a=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode('b'),\n * new ConstantNode(2)) // a.b=2\n * new AssignmentNode(new SymbolNode('a'),\n * new IndexNode(1, 2),\n * new ConstantNode(3)) // a[1,2]=3\n *\n * @param {SymbolNode | AccessorNode} object\n * Object on which to assign a value\n * @param {IndexNode} [index=null]\n * Index, property name or matrix index. Optional. If not provided\n * and `object` is a SymbolNode, the property is assigned to the\n * global scope.\n * @param {Node} value\n * The value to be assigned\n */\n constructor(object, index, value) {\n super();\n this.object = object;\n this.index = value ? index : null;\n this.value = value || index;\n\n // validate input\n if (!isSymbolNode(object) && !isAccessorNode(object)) {\n throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');\n }\n if (isSymbolNode(object) && object.name === 'end') {\n throw new Error('Cannot assign to symbol \"end\"');\n }\n if (this.index && !isIndexNode(this.index)) {\n // index is optional\n throw new TypeError('IndexNode expected as \"index\"');\n }\n if (!isNode(this.value)) {\n throw new TypeError('Node expected as \"value\"');\n }\n }\n\n // class name for typing purposes:\n\n // readonly property name\n get name() {\n if (this.index) {\n return this.index.isObjectProperty() ? this.index.getObjectProperty() : '';\n } else {\n return this.object.name || '';\n }\n }\n get type() {\n return name;\n }\n get isAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalObject = this.object._compile(math, argNames);\n var evalIndex = this.index ? this.index._compile(math, argNames) : null;\n var evalValue = this.value._compile(math, argNames);\n var name = this.object.name;\n if (!this.index) {\n // apply a variable to the scope, for example `a=2`\n if (!isSymbolNode(this.object)) {\n throw new TypeError('SymbolNode expected as object');\n }\n return function evalAssignmentNode(scope, args, context) {\n var value = evalValue(scope, args, context);\n scope.set(name, value);\n return value;\n };\n } else if (this.index.isObjectProperty()) {\n // apply an object property for example `a.b=2`\n var prop = this.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n setSafeProperty(object, prop, value);\n return value;\n };\n } else if (isSymbolNode(this.object)) {\n // update a matrix subset, for example `a[2]=3`\n return function evalAssignmentNode(scope, args, context) {\n var childObject = evalObject(scope, args, context);\n var value = evalValue(scope, args, context);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n scope.set(name, assign(childObject, index, value));\n return value;\n };\n } else {\n // isAccessorNode(node.object) === true\n // update a matrix subset, for example `a.b[2]=3`\n\n // we will not use the compile function of the AccessorNode, but\n // compile it ourselves here as we need the parent object of the\n // AccessorNode:\n // wee need to apply the updated object to parent object\n var evalParentObject = this.object.object._compile(math, argNames);\n if (this.object.index.isObjectProperty()) {\n var parentProp = this.object.index.getObjectProperty();\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n var childObject = getSafeProperty(parent, parentProp);\n // Important: we pass childObject instead of context:\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n setSafeProperty(parent, parentProp, assign(childObject, index, value));\n return value;\n };\n } else {\n // if some parameters use the 'end' parameter, we need to calculate\n // the size\n var evalParentIndex = this.object.index._compile(math, argNames);\n return function evalAssignmentNode(scope, args, context) {\n var parent = evalParentObject(scope, args, context);\n // Important: we pass parent instead of context:\n var parentIndex = evalParentIndex(scope, args, parent);\n var childObject = access(parent, parentIndex);\n // Important: we pass childObject instead of context\n var index = evalIndex(scope, args, childObject);\n var value = evalValue(scope, args, context);\n assign(parent, parentIndex, assign(childObject, index, value));\n return value;\n };\n }\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.object, 'object', this);\n if (this.index) {\n callback(this.index, 'index', this);\n }\n callback(this.value, 'value', this);\n }\n\n /**\n * Create a new AssignmentNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {AssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var object = this._ifNode(callback(this.object, 'object', this));\n var index = this.index ? this._ifNode(callback(this.index, 'index', this)) : null;\n var value = this._ifNode(callback(this.value, 'value', this));\n return new AssignmentNode(object, index, value);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {AssignmentNode}\n */\n clone() {\n return new AssignmentNode(this.object, this.index, this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string}\n */\n _toString(options) {\n var object = this.object.toString(options);\n var index = this.index ? this.index.toString(options) : '';\n var value = this.value.toString(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '(' + value + ')';\n }\n return object + index + ' = ' + value;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n object: this.object,\n index: this.index,\n value: this.value\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"AssignmentNode\", object: ..., index: ..., value: ...}`,\n * where mathjs is optional\n * @returns {AssignmentNode}\n */\n static fromJSON(json) {\n return new AssignmentNode(json.object, json.index, json.value);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string}\n */\n _toHTML(options) {\n var object = this.object.toHTML(options);\n var index = this.index ? this.index.toHTML(options) : '';\n var value = this.value.toHTML(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = '<span class=\"math-paranthesis math-round-parenthesis\">(</span>' + value + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n return object + index + '<span class=\"math-operator math-assignment-operator ' + 'math-variable-assignment-operator math-binary-operator\">=</span>' + value;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string}\n */\n _toTex(options) {\n var object = this.object.toTex(options);\n var index = this.index ? this.index.toTex(options) : '';\n var value = this.value.toTex(options);\n if (needParenthesis(this, options && options.parenthesis, options && options.implicit)) {\n value = \"\\\\left(\".concat(value, \"\\\\right)\");\n }\n return object + index + '=' + value;\n }\n }\n _defineProperty(AssignmentNode, \"name\", name);\n return AssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { forEach, map } from '../../utils/array.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'BlockNode';\nvar dependencies = ['ResultSet', 'Node'];\nexport var createBlockNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n ResultSet,\n Node\n } = _ref;\n class BlockNode extends Node {\n /**\n * @constructor BlockNode\n * @extends {Node}\n * Holds a set with blocks\n * @param {Array.<{node: Node} | {node: Node, visible: boolean}>} blocks\n * An array with blocks, where a block is constructed as an\n * Object with properties block, which is a Node, and visible,\n * which is a boolean. The property visible is optional and\n * is true by default\n */\n constructor(blocks) {\n super();\n // validate input, copy blocks\n if (!Array.isArray(blocks)) throw new Error('Array expected');\n this.blocks = blocks.map(function (block) {\n var node = block && block.node;\n var visible = block && block.visible !== undefined ? block.visible : true;\n if (!isNode(node)) throw new TypeError('Property \"node\" must be a Node');\n if (typeof visible !== 'boolean') {\n throw new TypeError('Property \"visible\" must be a boolean');\n }\n return {\n node,\n visible\n };\n });\n }\n get type() {\n return name;\n }\n get isBlockNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalBlocks = map(this.blocks, function (block) {\n return {\n evaluate: block.node._compile(math, argNames),\n visible: block.visible\n };\n });\n return function evalBlockNodes(scope, args, context) {\n var results = [];\n forEach(evalBlocks, function evalBlockNode(block) {\n var result = block.evaluate(scope, args, context);\n if (block.visible) {\n results.push(result);\n }\n });\n return new ResultSet(results);\n };\n }\n\n /**\n * Execute a callback for each of the child blocks of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.blocks.length; i++) {\n callback(this.blocks[i].node, 'blocks[' + i + '].node', this);\n }\n }\n\n /**\n * Create a new BlockNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {BlockNode} Returns a transformed copy of the node\n */\n map(callback) {\n var blocks = [];\n for (var i = 0; i < this.blocks.length; i++) {\n var block = this.blocks[i];\n var node = this._ifNode(callback(block.node, 'blocks[' + i + '].node', this));\n blocks[i] = {\n node,\n visible: block.visible\n };\n }\n return new BlockNode(blocks);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {BlockNode}\n */\n clone() {\n var blocks = this.blocks.map(function (block) {\n return {\n node: block.node,\n visible: block.visible\n };\n });\n return new BlockNode(blocks);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.blocks.map(function (param) {\n return param.node.toString(options) + (param.visible ? '' : ';');\n }).join('\\n');\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n blocks: this.blocks\n };\n }\n\n /**\n * Instantiate an BlockNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"BlockNode\", blocks: [{node: ..., visible: false}, ...]}`,\n * where mathjs is optional\n * @returns {BlockNode}\n */\n static fromJSON(json) {\n return new BlockNode(json.blocks);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n return this.blocks.map(function (param) {\n return param.node.toHTML(options) + (param.visible ? '' : '<span class=\"math-separator\">;</span>');\n }).join('<span class=\"math-separator\"><br /></span>');\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';');\n }).join('\\\\;\\\\;\\n');\n }\n }\n _defineProperty(BlockNode, \"name\", name);\n return BlockNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'ConditionalNode';\nvar dependencies = ['Node'];\nexport var createConditionalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition(condition) {\n if (typeof condition === 'number' || typeof condition === 'boolean' || typeof condition === 'string') {\n return !!condition;\n }\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero();\n }\n if (isComplex(condition)) {\n return !!(condition.re || condition.im);\n }\n if (isUnit(condition)) {\n return !!condition.value;\n }\n }\n if (condition === null || condition === undefined) {\n return false;\n }\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"');\n }\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor(condition, trueExpr, falseExpr) {\n super();\n if (!isNode(condition)) {\n throw new TypeError('Parameter condition must be a Node');\n }\n if (!isNode(trueExpr)) {\n throw new TypeError('Parameter trueExpr must be a Node');\n }\n if (!isNode(falseExpr)) {\n throw new TypeError('Parameter falseExpr must be a Node');\n }\n this.condition = condition;\n this.trueExpr = trueExpr;\n this.falseExpr = falseExpr;\n }\n get type() {\n return name;\n }\n get isConditionalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalCondition = this.condition._compile(math, argNames);\n var evalTrueExpr = this.trueExpr._compile(math, argNames);\n var evalFalseExpr = this.falseExpr._compile(math, argNames);\n return function evalConditionalNode(scope, args, context) {\n return testCondition(evalCondition(scope, args, context)) ? evalTrueExpr(scope, args, context) : evalFalseExpr(scope, args, context);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.condition, 'condition', this);\n callback(this.trueExpr, 'trueExpr', this);\n callback(this.falseExpr, 'falseExpr', this);\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new ConditionalNode(this._ifNode(callback(this.condition, 'condition', this)), this._ifNode(callback(this.trueExpr, 'trueExpr', this)), this._ifNode(callback(this.falseExpr, 'falseExpr', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone() {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toString(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '(' + condition + ')';\n }\n var trueExpr = this.trueExpr.toString(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '(' + trueExpr + ')';\n }\n var falseExpr = this.falseExpr.toString(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '(' + falseExpr + ')';\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n };\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON(json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n var condition = this.condition.toHTML(options);\n var conditionPrecedence = getPrecedence(this.condition, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.condition.type === 'OperatorNode' || conditionPrecedence !== null && conditionPrecedence <= precedence) {\n condition = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + condition + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n var trueExpr = this.trueExpr.toHTML(options);\n var truePrecedence = getPrecedence(this.trueExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.trueExpr.type === 'OperatorNode' || truePrecedence !== null && truePrecedence <= precedence) {\n trueExpr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + trueExpr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n var falseExpr = this.falseExpr.toHTML(options);\n var falsePrecedence = getPrecedence(this.falseExpr, parenthesis, options && options.implicit);\n if (parenthesis === 'all' || this.falseExpr.type === 'OperatorNode' || falsePrecedence !== null && falsePrecedence <= precedence) {\n falseExpr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + falseExpr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return condition + '<span class=\"math-operator math-conditional-operator\">?</span>' + trueExpr + '<span class=\"math-operator math-conditional-operator\">:</span>' + falseExpr;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n return '\\\\begin{cases} {' + this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' + this.condition.toTex(options) + '}\\\\\\\\{' + this.falseExpr.toTex(options) + '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}';\n }\n }\n _defineProperty(ConditionalNode, \"name\", name);\n return ConditionalNode;\n}, {\n isClass: true,\n isNode: true\n});","\"use strict\";\n\n// Map the characters to escape to their escaped values. The list is derived\n// from http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar defaultEscapes = {\n \"{\": \"\\\\{\",\n \"}\": \"\\\\}\",\n \"\\\\\": \"\\\\textbackslash{}\",\n \"#\": \"\\\\#\",\n $: \"\\\\$\",\n \"%\": \"\\\\%\",\n \"&\": \"\\\\&\",\n \"^\": \"\\\\textasciicircum{}\",\n _: \"\\\\_\",\n \"~\": \"\\\\textasciitilde{}\"\n};\nvar formatEscapes = {\n \"\\u2013\": \"\\\\--\",\n \"\\u2014\": \"\\\\---\",\n \" \": \"~\",\n \"\\t\": \"\\\\qquad{}\",\n \"\\r\\n\": \"\\\\newline{}\",\n \"\\n\": \"\\\\newline{}\"\n};\n\nvar defaultEscapeMapFn = function defaultEscapeMapFn(defaultEscapes, formatEscapes) {\n return _extends({}, defaultEscapes, formatEscapes);\n};\n\n/**\n * Escape a string to be used in LaTeX documents.\n * @param {string} str the string to be escaped.\n * @param {boolean} params.preserveFormatting whether formatting escapes should\n * be performed (default: false).\n * @param {function} params.escapeMapFn the function to modify the escape maps.\n * @return {string} the escaped string, ready to be used in LaTeX.\n */\nmodule.exports = function (str) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$preserveFormatti = _ref.preserveFormatting,\n preserveFormatting = _ref$preserveFormatti === undefined ? false : _ref$preserveFormatti,\n _ref$escapeMapFn = _ref.escapeMapFn,\n escapeMapFn = _ref$escapeMapFn === undefined ? defaultEscapeMapFn : _ref$escapeMapFn;\n\n var runningStr = String(str);\n var result = \"\";\n\n var escapes = escapeMapFn(_extends({}, defaultEscapes), preserveFormatting ? _extends({}, formatEscapes) : {});\n var escapeKeys = Object.keys(escapes); // as it is reused later on\n\n // Algorithm: Go through the string character by character, if it matches\n // with one of the special characters then we'll replace it with the escaped\n // version.\n\n var _loop = function _loop() {\n var specialCharFound = false;\n escapeKeys.forEach(function (key, index) {\n if (specialCharFound) {\n return;\n }\n if (runningStr.length >= key.length && runningStr.slice(0, key.length) === key) {\n result += escapes[escapeKeys[index]];\n runningStr = runningStr.slice(key.length, runningStr.length);\n specialCharFound = true;\n }\n });\n if (!specialCharFound) {\n result += runningStr.slice(0, 1);\n runningStr = runningStr.slice(1, runningStr.length);\n }\n };\n\n while (runningStr) {\n _loop();\n }\n return result;\n};","/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex';\nimport { hasOwnProperty } from './object.js';\nexport var latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i',\n // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n};\nexport var latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge',\n // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~',\n // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac',\n // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot',\n // TODO find ideal solution\n dotDivide: '.:',\n // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n};\nexport var latexFunctions = {\n // arithmetic\n abs: {\n 1: '\\\\left|${args[0]}\\\\right|'\n },\n add: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.add, \"${args[1]}\\\\right)\")\n },\n cbrt: {\n 1: '\\\\sqrt[3]{${args[0]}}'\n },\n ceil: {\n 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil'\n },\n cube: {\n 1: '\\\\left(${args[0]}\\\\right)^3'\n },\n divide: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n dotDivide: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotDivide, \"${args[1]}\\\\right)\")\n },\n dotMultiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotMultiply, \"${args[1]}\\\\right)\")\n },\n dotPow: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.dotPow, \"${args[1]}\\\\right)\")\n },\n exp: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n expm1: \"\\\\left(e\".concat(latexOperators.pow, \"{${args[0]}}-1\\\\right)\"),\n fix: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n floor: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor'\n },\n fraction: {\n 2: '\\\\frac{${args[0]}}{${args[1]}}'\n },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: {\n 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)'\n },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.mod, \"${args[1]}\\\\right)\")\n },\n multiply: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.multiply, \"${args[1]}\\\\right)\")\n },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: {\n 2: '\\\\sqrt[${args[1]}]{${args[0]}}'\n },\n nthRoots: {\n 2: '\\\\{y : y^${args[1]} = {${args[0]}}\\\\}'\n },\n pow: {\n 2: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.pow, \"{${args[1]}}\")\n },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: {\n 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)'\n },\n sqrt: {\n 1: '\\\\sqrt{${args[0]}}'\n },\n square: {\n 1: '\\\\left(${args[0]}\\\\right)^2'\n },\n subtract: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.subtract, \"${args[1]}\\\\right)\")\n },\n unaryMinus: {\n 1: \"\".concat(latexOperators.unaryMinus, \"\\\\left(${args[0]}\\\\right)\")\n },\n unaryPlus: {\n 1: \"\".concat(latexOperators.unaryPlus, \"\\\\left(${args[0]}\\\\right)\")\n },\n // bitwise\n bitAnd: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitAnd, \"${args[1]}\\\\right)\")\n },\n bitNot: {\n 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)'\n },\n bitOr: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitOr, \"${args[1]}\\\\right)\")\n },\n bitXor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.bitXor, \"${args[1]}\\\\right)\")\n },\n leftShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.leftShift, \"${args[1]}\\\\right)\")\n },\n rightArithShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightArithShift, \"${args[1]}\\\\right)\")\n },\n rightLogShift: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.rightLogShift, \"${args[1]}\\\\right)\")\n },\n // combinatorics\n bellNumbers: {\n 1: '\\\\mathrm{B}_{${args[0]}}'\n },\n catalan: {\n 1: '\\\\mathrm{C}_{${args[0]}}'\n },\n stirlingS2: {\n 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)'\n },\n // complex\n arg: {\n 1: '\\\\arg\\\\left(${args[0]}\\\\right)'\n },\n conj: {\n 1: '\\\\left(${args[0]}\\\\right)^*'\n },\n im: {\n 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n re: {\n 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace'\n },\n // logical\n and: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.and, \"${args[1]}\\\\right)\")\n },\n not: {\n 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)'\n },\n or: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.or, \"${args[1]}\\\\right)\")\n },\n xor: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.xor, \"${args[1]}\\\\right)\")\n },\n // matrix\n cross: {\n 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)'\n },\n ctranspose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.ctranspose)\n },\n det: {\n 1: '\\\\det\\\\left(${args[0]}\\\\right)'\n },\n dot: {\n 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)'\n },\n expm: {\n 1: '\\\\exp\\\\left(${args[0]}\\\\right)'\n },\n inv: {\n 1: '\\\\left(${args[0]}\\\\right)^{-1}'\n },\n pinv: {\n 1: '\\\\left(${args[0]}\\\\right)^{+}'\n },\n sqrtm: {\n 1: \"{${args[0]}}\".concat(latexOperators.pow, \"{\\\\frac{1}{2}}\")\n },\n trace: {\n 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)'\n },\n transpose: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.transpose)\n },\n // probability\n combinations: {\n 2: '\\\\binom{${args[0]}}{${args[1]}}'\n },\n combinationsWithRep: {\n 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)'\n },\n factorial: {\n 1: \"\\\\left(${args[0]}\\\\right)\".concat(latexOperators.factorial)\n },\n gamma: {\n 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n lgamma: {\n 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)'\n },\n // relational\n equal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.equal, \"${args[1]}\\\\right)\")\n },\n larger: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.larger, \"${args[1]}\\\\right)\")\n },\n largerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.largerEq, \"${args[1]}\\\\right)\")\n },\n smaller: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smaller, \"${args[1]}\\\\right)\")\n },\n smallerEq: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.smallerEq, \"${args[1]}\\\\right)\")\n },\n unequal: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.unequal, \"${args[1]}\\\\right)\")\n },\n // special\n erf: {\n 1: 'erf\\\\left(${args[0]}\\\\right)'\n },\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n // trigonometry\n acos: {\n 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acosh: {\n 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acot: {\n 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acoth: {\n 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsc: {\n 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)'\n },\n acsch: {\n 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asec: {\n 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asech: {\n 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asin: {\n 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)'\n },\n asinh: {\n 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan: {\n 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)'\n },\n atan2: {\n 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)'\n },\n atanh: {\n 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)'\n },\n cos: {\n 1: '\\\\cos\\\\left(${args[0]}\\\\right)'\n },\n cosh: {\n 1: '\\\\cosh\\\\left(${args[0]}\\\\right)'\n },\n cot: {\n 1: '\\\\cot\\\\left(${args[0]}\\\\right)'\n },\n coth: {\n 1: '\\\\coth\\\\left(${args[0]}\\\\right)'\n },\n csc: {\n 1: '\\\\csc\\\\left(${args[0]}\\\\right)'\n },\n csch: {\n 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)'\n },\n sec: {\n 1: '\\\\sec\\\\left(${args[0]}\\\\right)'\n },\n sech: {\n 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)'\n },\n sin: {\n 1: '\\\\sin\\\\left(${args[0]}\\\\right)'\n },\n sinh: {\n 1: '\\\\sinh\\\\left(${args[0]}\\\\right)'\n },\n tan: {\n 1: '\\\\tan\\\\left(${args[0]}\\\\right)'\n },\n tanh: {\n 1: '\\\\tanh\\\\left(${args[0]}\\\\right)'\n },\n // unit\n to: {\n 2: \"\\\\left(${args[0]}\".concat(latexOperators.to, \"${args[1]}\\\\right)\")\n },\n // utils\n numeric: function numeric(node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex();\n },\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: \"\\\\left(\\\\left(${args[0]}\\\\right)+\".concat(latexSymbols.i, \"\\\\cdot\\\\left(${args[1]}\\\\right)\\\\right)\")\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n};\nexport var defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)';\nvar latexUnits = {\n deg: '^\\\\circ'\n};\nexport function escapeLatex(string) {\n return escapeLatexLib(string, {\n preserveFormatting: true\n });\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol(name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit;\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name];\n }\n return '\\\\mathrm{' + escapeLatex(name) + '}';\n }\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name];\n }\n return escapeLatex(name);\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { format } from '../../utils/string.js';\nimport { typeOf } from '../../utils/is.js';\nimport { escapeLatex } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ConstantNode';\nvar dependencies = ['Node', 'isBounded'];\nexport var createConstantNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n isBounded\n } = _ref;\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor(value) {\n super();\n this.value = value;\n }\n get type() {\n return name;\n }\n get isConstantNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var value = this.value;\n return function evalConstantNode() {\n return value;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone() {\n return new ConstantNode(this.value);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n return format(this.value, options);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var value = this._toString(options);\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '<span class=\"math-number\">' + value + '</span>';\n case 'string':\n return '<span class=\"math-string\">' + value + '</span>';\n case 'boolean':\n return '<span class=\"math-boolean\">' + value + '</span>';\n case 'null':\n return '<span class=\"math-null-symbol\">' + value + '</span>';\n case 'undefined':\n return '<span class=\"math-undefined\">' + value + '</span>';\n default:\n return '<span class=\"math-symbol\">' + value + '</span>';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n value: this.value\n };\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON(json) {\n return new ConstantNode(json.value);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var value = this._toString(options);\n var type = typeOf(this.value);\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}';\n case 'number':\n case 'BigNumber':\n {\n if (!isBounded(this.value)) {\n return this.value.valueOf() < 0 ? '-\\\\infty' : '\\\\infty';\n }\n var index = value.toLowerCase().indexOf('e');\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' + value.substring(index + 1) + '}';\n }\n return value;\n }\n case 'bigint':\n {\n return value.toString();\n }\n case 'Fraction':\n return this.value.toLatex();\n default:\n return value;\n }\n }\n }\n _defineProperty(ConstantNode, \"name\", name);\n return ConstantNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { keywords } from '../keywords.js';\nimport { escape } from '../../utils/string.js';\nimport { forEach, join } from '../../utils/array.js';\nimport { toSymbol } from '../../utils/latex.js';\nimport { getPrecedence } from '../operators.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'FunctionAssignmentNode';\nvar dependencies = ['typed', 'Node'];\nexport var createFunctionAssignmentNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Node\n } = _ref;\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var exprPrecedence = getPrecedence(node.expr, parenthesis, implicit);\n return parenthesis === 'all' || exprPrecedence !== null && exprPrecedence <= precedence;\n }\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor(name, params, expr) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Array containing strings or objects expected for parameter \"params\"');\n }\n if (!isNode(expr)) {\n throw new TypeError('Node expected for parameter \"expr\"');\n }\n if (keywords.has(name)) {\n throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword');\n }\n var paramNames = new Set();\n for (var param of params) {\n var _name = typeof param === 'string' ? param : param.name;\n if (paramNames.has(_name)) {\n throw new Error(\"Duplicate parameter name \\\"\".concat(_name, \"\\\"\"));\n } else {\n paramNames.add(_name);\n }\n }\n this.name = name;\n this.params = params.map(function (param) {\n return param && param.name || param;\n });\n this.types = params.map(function (param) {\n return param && param.type || 'any';\n });\n this.expr = expr;\n }\n get type() {\n return name;\n }\n get isFunctionAssignmentNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var childArgNames = Object.create(argNames);\n forEach(this.params, function (param) {\n childArgNames[param] = true;\n });\n\n // compile the function expression with the child args\n var expr = this.expr;\n var evalExpr = expr._compile(math, childArgNames);\n var name = this.name;\n var params = this.params;\n var signature = join(this.types, ',');\n var syntax = name + '(' + join(this.params, ', ') + ')';\n return function evalFunctionAssignmentNode(scope, args, context) {\n var signatures = {};\n signatures[signature] = function () {\n var childArgs = Object.create(args);\n for (var i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i];\n }\n return evalExpr(scope, childArgs, context);\n };\n var fn = typed(name, signatures);\n fn.syntax = syntax;\n fn.expr = expr.toString();\n scope.set(name, fn);\n return fn;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.expr, 'expr', this);\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map(callback) {\n var expr = this._ifNode(callback(this.expr, 'expr', this));\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone() {\n return new FunctionAssignmentNode(this.name, this.params.slice(0), this.expr);\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toString(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')';\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n var types = this.types;\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n };\n }),\n expr: this.expr\n };\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON(json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr);\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var params = [];\n for (var i = 0; i < this.params.length; i++) {\n params.push('<span class=\"math-symbol math-parameter\">' + escape(this.params[i]) + '</span>');\n }\n var expr = this.expr.toHTML(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + expr + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return '<span class=\"math-function\">' + escape(this.name) + '</span>' + '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + params.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>' + '<span class=\"math-operator math-assignment-operator ' + 'math-variable-assignment-operator math-binary-operator\">=</span>' + expr;\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var expr = this.expr.toTex(options);\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = \"\\\\left(\".concat(expr, \"\\\\right)\");\n }\n return '\\\\mathrm{' + this.name + '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr;\n }\n }\n _defineProperty(FunctionAssignmentNode, \"name\", name);\n return FunctionAssignmentNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { map } from '../../utils/array.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js';\nimport { escape } from '../../utils/string.js';\nvar name = 'IndexNode';\nvar dependencies = ['Node', 'size'];\nexport var createIndexNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node,\n size\n } = _ref;\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor(dimensions, dotNotation) {\n super();\n this.dimensions = dimensions;\n this.dotNotation = dotNotation || false;\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties');\n }\n }\n get type() {\n return name;\n }\n get isIndexNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n var evalDimensions = map(this.dimensions, function (dimension, i) {\n var needsEnd = dimension.filter(node => node.isSymbolNode && node.name === 'end').length > 0;\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n var childArgNames = Object.create(argNames);\n childArgNames.end = true;\n var _evalDimension = dimension._compile(math, childArgNames);\n return function evalDimension(scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError('Cannot resolve \"end\": ' + 'context must be a Matrix, Array, or string but is ' + typeOf(context));\n }\n var s = size(context);\n var childArgs = Object.create(args);\n childArgs.end = s[i];\n return _evalDimension(scope, childArgs, context);\n };\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames);\n }\n });\n var index = getSafeProperty(math, 'index');\n return function evalIndexNode(scope, args, context) {\n var dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context);\n });\n return index(...dimensions);\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this);\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map(callback) {\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(callback(this.dimensions[i], 'dimensions[' + i + ']', this));\n }\n return new IndexNode(dimensions, this.dotNotation);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone() {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation);\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty() {\n return this.dimensions.length === 1 && isConstantNode(this.dimensions[0]) && typeof this.dimensions[0].value === 'string';\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty() {\n return this.isObjectProperty() ? this.dimensions[0].value : null;\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation ? '.' + this.getObjectProperty() : '[' + this.dimensions.join(', ') + ']';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n };\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON(json) {\n return new IndexNode(json.dimensions, json.dotNotation);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n // format the parameters like \"[1, 0:5]\"\n var dimensions = [];\n for (var i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML();\n }\n if (this.dotNotation) {\n return '<span class=\"math-operator math-accessor-operator\">.</span>' + '<span class=\"math-symbol math-property\">' + escape(this.getObjectProperty()) + '</span>';\n } else {\n return '<span class=\"math-parenthesis math-square-parenthesis\">[</span>' + dimensions.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-square-parenthesis\">]</span>';\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var dimensions = this.dimensions.map(function (range) {\n return range.toTex(options);\n });\n return this.dotNotation ? '.' + this.getObjectProperty() + '' : '_{' + dimensions.join(',') + '}';\n }\n }\n _defineProperty(IndexNode, \"name\", name);\n return IndexNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { isNode } from '../../utils/is.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { escape, stringify } from '../../utils/string.js';\nvar name = 'ObjectNode';\nvar dependencies = ['Node'];\nexport var createObjectNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.<string, Node>} [properties] object with key/value pairs\n */\n constructor(properties) {\n super();\n this.properties = properties || {};\n\n // validate input\n if (properties) {\n if (!(typeof properties === 'object') || !Object.keys(properties).every(function (key) {\n return isNode(properties[key]);\n })) {\n throw new TypeError('Object containing Nodes expected');\n }\n }\n }\n get type() {\n return name;\n }\n get isObjectNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var evalEntries = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n // we stringify/parse the key here to resolve unicode characters,\n // so you cannot create a key like {\"co\\\\u006Estructor\": null}\n var stringifiedKey = stringify(key);\n var parsedKey = JSON.parse(stringifiedKey);\n var prop = getSafeProperty(this.properties, key);\n evalEntries[parsedKey] = prop._compile(math, argNames);\n }\n }\n return function evalObjectNode(scope, args, context) {\n var obj = {};\n for (var _key in evalEntries) {\n if (hasOwnProperty(evalEntries, _key)) {\n obj[_key] = evalEntries[_key](scope, args, context);\n }\n }\n return obj;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n callback(this.properties[key], 'properties[' + stringify(key) + ']', this);\n }\n }\n }\n\n /**\n * Create a new ObjectNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ObjectNode} Returns a transformed copy of the node\n */\n map(callback) {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this._ifNode(callback(this.properties[key], 'properties[' + stringify(key) + ']', this));\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ObjectNode}\n */\n clone() {\n var properties = {};\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n properties[key] = this.properties[key];\n }\n }\n return new ObjectNode(properties);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push(stringify(key) + ': ' + this.properties[key].toString(options));\n }\n }\n return '{' + entries.join(', ') + '}';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n properties: this.properties\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ObjectNode\", \"properties\": {...}}`,\n * where mathjs is optional\n * @returns {ObjectNode}\n */\n static fromJSON(json) {\n return new ObjectNode(json.properties);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('<span class=\"math-symbol math-property\">' + escape(key) + '</span>' + '<span class=\"math-operator math-assignment-operator ' + 'math-property-assignment-operator math-binary-operator\">' + ':</span>' + this.properties[key].toHTML(options));\n }\n }\n return '<span class=\"math-parenthesis math-curly-parenthesis\">{</span>' + entries.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-parenthesis math-curly-parenthesis\">}</span>';\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var entries = [];\n for (var key in this.properties) {\n if (hasOwnProperty(this.properties, key)) {\n entries.push('\\\\mathbf{' + key + ':} & ' + this.properties[key].toTex(options) + '\\\\\\\\');\n }\n }\n var tex = '\\\\left\\\\{\\\\begin{array}{ll}' + entries.join('\\n') + '\\\\end{array}\\\\right\\\\}';\n return tex;\n }\n }\n _defineProperty(ObjectNode, \"name\", name);\n return ObjectNode;\n}, {\n isClass: true,\n isNode: true\n});","import { ObjectWrappingMap, PartitionedMap } from './map.js';\n\n/**\n * Create a new scope which can access the parent scope,\n * but does not affect it when written. This is suitable for variable definitions\n * within a block node, or function definition.\n *\n * If parent scope has a createSubScope method, it delegates to that. Otherwise,\n * creates an empty map, and copies the parent scope to it, adding in\n * the remaining `args`.\n *\n * @param {Map} parentScope\n * @param {Object} args\n * @returns {PartitionedMap}\n */\nexport function createSubScope(parentScope, args) {\n return new PartitionedMap(parentScope, new ObjectWrappingMap(args), new Set(Object.keys(args)));\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isConstantNode, isOperatorNode, isParenthesisNode } from '../../utils/is.js';\nimport { map } from '../../utils/array.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty, isSafeMethod } from '../../utils/customs.js';\nimport { getAssociativity, getPrecedence, isAssociativeWith, properties } from '../operators.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'OperatorNode';\nvar dependencies = ['Node'];\nexport var createOperatorNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Returns true if the expression starts with a constant, under\n * the current parenthesization:\n * @param {Node} expression\n * @param {string} parenthesis\n * @return {boolean}\n */\n function startsWithConstant(expr, parenthesis) {\n var curNode = expr;\n if (parenthesis === 'auto') {\n while (isParenthesisNode(curNode)) curNode = curNode.content;\n }\n if (isConstantNode(curNode)) return true;\n if (isOperatorNode(curNode)) {\n return startsWithConstant(curNode.args[0], parenthesis);\n }\n return false;\n }\n\n /**\n * Calculate which parentheses are necessary. Gets an OperatorNode\n * (which is the root of the tree) and an Array of Nodes\n * (this.args) and returns an array where 'true' means that an argument\n * has to be enclosed in parentheses whereas 'false' means the opposite.\n *\n * @param {OperatorNode} root\n * @param {string} parenthesis\n * @param {Node[]} args\n * @param {boolean} latex\n * @return {boolean[]}\n * @private\n */\n function calculateNecessaryParentheses(root, parenthesis, implicit, args, latex) {\n // precedence of the root OperatorNode\n var precedence = getPrecedence(root, parenthesis, implicit);\n var associativity = getAssociativity(root, parenthesis);\n if (parenthesis === 'all' || args.length > 2 && root.getIdentifier() !== 'OperatorNode:add' && root.getIdentifier() !== 'OperatorNode:multiply') {\n return args.map(function (arg) {\n switch (arg.getContent().type) {\n // Nodes that don't need extra parentheses\n case 'ArrayNode':\n case 'ConstantNode':\n case 'SymbolNode':\n case 'ParenthesisNode':\n return false;\n default:\n return true;\n }\n });\n }\n var result;\n switch (args.length) {\n case 0:\n result = [];\n break;\n case 1:\n // unary operators\n {\n // precedence of the operand\n var operandPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex && operandPrecedence !== null) {\n var operandIdentifier;\n var rootIdentifier;\n if (parenthesis === 'keep') {\n operandIdentifier = args[0].getIdentifier();\n rootIdentifier = root.getIdentifier();\n } else {\n // Ignore Parenthesis Nodes when not in 'keep' mode\n operandIdentifier = args[0].getContent().getIdentifier();\n rootIdentifier = root.getContent().getIdentifier();\n }\n if (properties[precedence][rootIdentifier].latexLeftParens === false) {\n result = [false];\n break;\n }\n if (properties[operandPrecedence][operandIdentifier].latexParens === false) {\n result = [false];\n break;\n }\n }\n if (operandPrecedence === null) {\n // if the operand has no defined precedence, no parens are needed\n result = [false];\n break;\n }\n if (operandPrecedence <= precedence) {\n // if the operands precedence is lower, parens are needed\n result = [true];\n break;\n }\n\n // otherwise, no parens needed\n result = [false];\n }\n break;\n case 2:\n // binary operators\n {\n var lhsParens; // left hand side needs parenthesis?\n // precedence of the left hand side\n var lhsPrecedence = getPrecedence(args[0], parenthesis, implicit, root);\n // is the root node associative with the left hand side\n var assocWithLhs = isAssociativeWith(root, args[0], parenthesis);\n if (lhsPrecedence === null) {\n // if the left hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n lhsParens = false;\n } else if (lhsPrecedence === precedence && associativity === 'right' && !assocWithLhs) {\n // In case of equal precedence, if the root node is left associative\n // parens are **never** necessary for the left hand side.\n // If it is right associative however, parens are necessary\n // if the root node isn't associative with the left hand side\n lhsParens = true;\n } else if (lhsPrecedence < precedence) {\n lhsParens = true;\n } else {\n lhsParens = false;\n }\n var rhsParens; // right hand side needs parenthesis?\n // precedence of the right hand side\n var rhsPrecedence = getPrecedence(args[1], parenthesis, implicit, root);\n // is the root node associative with the right hand side?\n var assocWithRhs = isAssociativeWith(root, args[1], parenthesis);\n if (rhsPrecedence === null) {\n // if the right hand side has no defined precedence, no parens are needed\n // FunctionNode for example\n rhsParens = false;\n } else if (rhsPrecedence === precedence && associativity === 'left' && !assocWithRhs) {\n // In case of equal precedence, if the root node is right associative\n // parens are **never** necessary for the right hand side.\n // If it is left associative however, parens are necessary\n // if the root node isn't associative with the right hand side\n rhsParens = true;\n } else if (rhsPrecedence < precedence) {\n rhsParens = true;\n } else {\n rhsParens = false;\n }\n\n // handle special cases for LaTeX, where some of the parentheses aren't needed\n if (latex) {\n var _rootIdentifier;\n var lhsIdentifier;\n var rhsIdentifier;\n if (parenthesis === 'keep') {\n _rootIdentifier = root.getIdentifier();\n lhsIdentifier = root.args[0].getIdentifier();\n rhsIdentifier = root.args[1].getIdentifier();\n } else {\n // Ignore ParenthesisNodes when not in 'keep' mode\n _rootIdentifier = root.getContent().getIdentifier();\n lhsIdentifier = root.args[0].getContent().getIdentifier();\n rhsIdentifier = root.args[1].getContent().getIdentifier();\n }\n if (lhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexLeftParens === false) {\n lhsParens = false;\n }\n if (properties[lhsPrecedence][lhsIdentifier].latexParens === false) {\n lhsParens = false;\n }\n }\n if (rhsPrecedence !== null) {\n if (properties[precedence][_rootIdentifier].latexRightParens === false) {\n rhsParens = false;\n }\n if (properties[rhsPrecedence][rhsIdentifier].latexParens === false) {\n rhsParens = false;\n }\n }\n }\n result = [lhsParens, rhsParens];\n }\n break;\n default:\n if (root.getIdentifier() === 'OperatorNode:add' || root.getIdentifier() === 'OperatorNode:multiply') {\n result = args.map(function (arg) {\n var argPrecedence = getPrecedence(arg, parenthesis, implicit, root);\n var assocWithArg = isAssociativeWith(root, arg, parenthesis);\n var argAssociativity = getAssociativity(arg, parenthesis);\n if (argPrecedence === null) {\n // if the argument has no defined precedence, no parens are needed\n return false;\n } else if (precedence === argPrecedence && associativity === argAssociativity && !assocWithArg) {\n return true;\n } else if (argPrecedence < precedence) {\n return true;\n }\n return false;\n });\n }\n break;\n }\n\n // Handles an edge case of parentheses with implicit multiplication\n // of ConstantNode.\n // In that case, parenthesize ConstantNodes that follow an unparenthesized\n // expression, even though they normally wouldn't be printed.\n if (args.length >= 2 && root.getIdentifier() === 'OperatorNode:multiply' && root.implicit && parenthesis !== 'all' && implicit === 'hide') {\n for (var i = 1; i < result.length; ++i) {\n if (startsWithConstant(args[i], parenthesis) && !result[i - 1] && (parenthesis !== 'keep' || !isParenthesisNode(args[i - 1]))) {\n result[i] = true;\n }\n }\n }\n return result;\n }\n class OperatorNode extends Node {\n /**\n * @constructor OperatorNode\n * @extends {Node}\n * An operator with two arguments, like 2+3\n *\n * @param {string} op Operator name, for example '+'\n * @param {string} fn Function name, for example 'add'\n * @param {Node[]} args Operator arguments\n * @param {boolean} [implicit] Is this an implicit multiplication?\n * @param {boolean} [isPercentage] Is this an percentage Operation?\n */\n constructor(op, fn, args, implicit, isPercentage) {\n super();\n // validate input\n if (typeof op !== 'string') {\n throw new TypeError('string expected for parameter \"op\"');\n }\n if (typeof fn !== 'string') {\n throw new TypeError('string expected for parameter \"fn\"');\n }\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n this.implicit = implicit === true;\n this.isPercentage = isPercentage === true;\n this.op = op;\n this.fn = fn;\n this.args = args || [];\n }\n get type() {\n return name;\n }\n get isOperatorNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // validate fn\n if (typeof this.fn !== 'string' || !isSafeMethod(math, this.fn)) {\n if (!math[this.fn]) {\n throw new Error('Function ' + this.fn + ' missing in provided namespace \"math\"');\n } else {\n throw new Error('No access to function \"' + this.fn + '\"');\n }\n }\n var fn = getSafeProperty(math, this.fn);\n var evalArgs = map(this.args, function (arg) {\n return arg._compile(math, argNames);\n });\n if (typeof fn === 'function' && fn.rawArgs === true) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalOperatorNode(scope, args, context) {\n return fn(rawArgs, math, createSubScope(scope, args));\n };\n } else if (evalArgs.length === 1) {\n var evalArg0 = evalArgs[0];\n return function evalOperatorNode(scope, args, context) {\n return fn(evalArg0(scope, args, context));\n };\n } else if (evalArgs.length === 2) {\n var _evalArg = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return function evalOperatorNode(scope, args, context) {\n return fn(_evalArg(scope, args, context), evalArg1(scope, args, context));\n };\n } else {\n return function evalOperatorNode(scope, args, context) {\n return fn.apply(null, map(evalArgs, function (evalArg) {\n return evalArg(scope, args, context);\n }));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new OperatorNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {OperatorNode} Returns a transformed copy of the node\n */\n map(callback) {\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new OperatorNode(this.op, this.fn, args, this.implicit, this.isPercentage);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {OperatorNode}\n */\n clone() {\n return new OperatorNode(this.op, this.fn, this.args.slice(0), this.implicit, this.isPercentage);\n }\n\n /**\n * Check whether this is an unary OperatorNode:\n * has exactly one argument, like `-a`.\n * @return {boolean}\n * Returns true when an unary operator node, false otherwise.\n */\n isUnary() {\n return this.args.length === 1;\n }\n\n /**\n * Check whether this is a binary OperatorNode:\n * has exactly two arguments, like `a + b`.\n * @return {boolean}\n * Returns true when a binary operator node, false otherwise.\n */\n isBinary() {\n return this.args.length === 2;\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toString(options);\n if (parens[0]) {\n operand = '(' + operand + ')';\n }\n\n // for example for \"not\", we want a space between operand and argument\n var opIsNamed = /[a-zA-Z]+/.test(this.op);\n if (assoc === 'right') {\n // prefix operator\n return this.op + (opIsNamed ? ' ' : '') + operand;\n } else if (assoc === 'left') {\n // postfix\n return operand + (opIsNamed ? ' ' : '') + this.op;\n }\n\n // fall back to postfix\n return operand + this.op;\n } else if (args.length === 2) {\n var lhs = args[0].toString(options); // left hand side\n var rhs = args[1].toString(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '(' + lhs + ')';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '(' + rhs + ')';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + ' ' + rhs;\n }\n return lhs + ' ' + this.op + ' ' + rhs;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toString(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '(' + arg + ')';\n }\n return arg;\n });\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join(' ');\n }\n return stringifiedArgs.join(' ' + this.op + ' ');\n } else {\n // fallback to formatting as a function call\n return this.fn + '(' + this.args.join(', ') + ')';\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n op: this.op,\n fn: this.fn,\n args: this.args,\n implicit: this.implicit,\n isPercentage: this.isPercentage\n };\n }\n\n /**\n * Instantiate an OperatorNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"OperatorNode\",\n * \"op\": \"+\", \"fn\": \"add\", \"args\": [...],\n * \"implicit\": false,\n * \"isPercentage\":false}\n * ```\n * where mathjs is optional\n * @returns {OperatorNode}\n */\n static fromJSON(json) {\n return new OperatorNode(json.op, json.fn, json.args, json.implicit, json.isPercentage);\n }\n\n /**\n * Get HTML representation.\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, false);\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toHTML(options);\n if (parens[0]) {\n operand = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + operand + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (assoc === 'right') {\n // prefix operator\n return '<span class=\"math-operator math-unary-operator ' + 'math-lefthand-unary-operator\">' + escape(this.op) + '</span>' + operand;\n } else {\n // postfix when assoc === 'left' or undefined\n return operand + '<span class=\"math-operator math-unary-operator ' + 'math-righthand-unary-operator\">' + escape(this.op) + '</span>';\n }\n } else if (args.length === 2) {\n // binary operatoes\n var lhs = args[0].toHTML(options); // left hand side\n var rhs = args[1].toHTML(options); // right hand side\n if (parens[0]) {\n // left hand side in parenthesis?\n lhs = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + lhs + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (parens[1]) {\n // right hand side in parenthesis?\n rhs = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + rhs + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return lhs + '<span class=\"math-operator math-binary-operator ' + 'math-implicit-binary-operator\"></span>' + rhs;\n }\n return lhs + '<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(this.op) + '</span>' + rhs;\n } else {\n var stringifiedArgs = args.map(function (arg, index) {\n arg = arg.toHTML(options);\n if (parens[index]) {\n // put in parenthesis?\n arg = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + arg + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return arg;\n });\n if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n if (this.implicit && this.getIdentifier() === 'OperatorNode:multiply' && implicit === 'hide') {\n return stringifiedArgs.join('<span class=\"math-operator math-binary-operator ' + 'math-implicit-binary-operator\"></span>');\n }\n return stringifiedArgs.join('<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(this.op) + '</span>');\n } else {\n // fallback to formatting as a function call\n return '<span class=\"math-function\">' + escape(this.fn) + '</span><span class=\"math-paranthesis math-round-parenthesis\">' + '(</span>' + stringifiedArgs.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var implicit = options && options.implicit ? options.implicit : 'hide';\n var args = this.args;\n var parens = calculateNecessaryParentheses(this, parenthesis, implicit, args, true);\n var op = latexOperators[this.fn];\n op = typeof op === 'undefined' ? this.op : op; // fall back to using this.op\n\n if (args.length === 1) {\n // unary operators\n var assoc = getAssociativity(this, parenthesis);\n var operand = args[0].toTex(options);\n if (parens[0]) {\n operand = \"\\\\left(\".concat(operand, \"\\\\right)\");\n }\n if (assoc === 'right') {\n // prefix operator\n return op + operand;\n } else if (assoc === 'left') {\n // postfix operator\n return operand + op;\n }\n\n // fall back to postfix\n return operand + op;\n } else if (args.length === 2) {\n // binary operators\n var lhs = args[0]; // left hand side\n var lhsTex = lhs.toTex(options);\n if (parens[0]) {\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n var rhs = args[1]; // right hand side\n var rhsTex = rhs.toTex(options);\n if (parens[1]) {\n rhsTex = \"\\\\left(\".concat(rhsTex, \"\\\\right)\");\n }\n\n // handle some exceptions (due to the way LaTeX works)\n var lhsIdentifier;\n if (parenthesis === 'keep') {\n lhsIdentifier = lhs.getIdentifier();\n } else {\n // Ignore ParenthesisNodes if in 'keep' mode\n lhsIdentifier = lhs.getContent().getIdentifier();\n }\n switch (this.getIdentifier()) {\n case 'OperatorNode:divide':\n // op contains '\\\\frac' at this point\n return op + '{' + lhsTex + '}' + '{' + rhsTex + '}';\n case 'OperatorNode:pow':\n lhsTex = '{' + lhsTex + '}';\n rhsTex = '{' + rhsTex + '}';\n switch (lhsIdentifier) {\n case 'ConditionalNode': //\n case 'OperatorNode:divide':\n lhsTex = \"\\\\left(\".concat(lhsTex, \"\\\\right)\");\n }\n break;\n case 'OperatorNode:multiply':\n if (this.implicit && implicit === 'hide') {\n return lhsTex + '~' + rhsTex;\n }\n }\n return lhsTex + op + rhsTex;\n } else if (args.length > 2 && (this.getIdentifier() === 'OperatorNode:add' || this.getIdentifier() === 'OperatorNode:multiply')) {\n var texifiedArgs = args.map(function (arg, index) {\n arg = arg.toTex(options);\n if (parens[index]) {\n arg = \"\\\\left(\".concat(arg, \"\\\\right)\");\n }\n return arg;\n });\n if (this.getIdentifier() === 'OperatorNode:multiply' && this.implicit && implicit === 'hide') {\n return texifiedArgs.join('~');\n }\n return texifiedArgs.join(op);\n } else {\n // fall back to formatting as a function call\n // as this is a fallback, it doesn't use\n // fancy function names\n return '\\\\mathrm{' + this.fn + '}\\\\left(' + args.map(function (arg) {\n return arg.toTex(options);\n }).join(',') + '\\\\right)';\n }\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.fn;\n }\n }\n _defineProperty(OperatorNode, \"name\", name);\n return OperatorNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'ParenthesisNode';\nvar dependencies = ['Node'];\nexport var createParenthesisNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n class ParenthesisNode extends Node {\n /**\n * @constructor ParenthesisNode\n * @extends {Node}\n * A parenthesis node describes manual parenthesis from the user input\n * @param {Node} content\n * @extends {Node}\n */\n constructor(content) {\n super();\n // validate input\n if (!isNode(content)) {\n throw new TypeError('Node expected for parameter \"content\"');\n }\n this.content = content;\n }\n get type() {\n return name;\n }\n get isParenthesisNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n return this.content._compile(math, argNames);\n }\n\n /**\n * Get the content of the current Node.\n * @return {Node} content\n * @override\n **/\n getContent() {\n return this.content.getContent();\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.content, 'content', this);\n }\n\n /**\n * Create a new ParenthesisNode whose child is the result of calling\n * the provided callback function on the child of this node.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ParenthesisNode} Returns a clone of the node\n */\n map(callback) {\n var content = callback(this.content, 'content', this);\n return new ParenthesisNode(content);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ParenthesisNode}\n */\n clone() {\n return new ParenthesisNode(this.content);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '(' + this.content.toString(options) + ')';\n }\n return this.content.toString(options);\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n content: this.content\n };\n }\n\n /**\n * Instantiate an ParenthesisNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"ParenthesisNode\", \"content\": ...}`,\n * where mathjs is optional\n * @returns {ParenthesisNode}\n */\n static fromJSON(json) {\n return new ParenthesisNode(json.content);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + this.content.toHTML(options) + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n return this.content.toHTML(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n if (!options || options && !options.parenthesis || options && options.parenthesis === 'keep') {\n return \"\\\\left(\".concat(this.content.toTex(options), \"\\\\right)\");\n }\n return this.content.toTex(options);\n }\n }\n _defineProperty(ParenthesisNode, \"name\", name);\n return ParenthesisNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { getPrecedence } from '../operators.js';\nvar name = 'RangeNode';\nvar dependencies = ['Node'];\nexport var createRangeNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n /**\n * Calculate the necessary parentheses\n * @param {Node} node\n * @param {string} parenthesis\n * @param {string} implicit\n * @return {Object} parentheses\n * @private\n */\n function calculateNecessaryParentheses(node, parenthesis, implicit) {\n var precedence = getPrecedence(node, parenthesis, implicit);\n var parens = {};\n var startPrecedence = getPrecedence(node.start, parenthesis, implicit);\n parens.start = startPrecedence !== null && startPrecedence <= precedence || parenthesis === 'all';\n if (node.step) {\n var stepPrecedence = getPrecedence(node.step, parenthesis, implicit);\n parens.step = stepPrecedence !== null && stepPrecedence <= precedence || parenthesis === 'all';\n }\n var endPrecedence = getPrecedence(node.end, parenthesis, implicit);\n parens.end = endPrecedence !== null && endPrecedence <= precedence || parenthesis === 'all';\n return parens;\n }\n class RangeNode extends Node {\n /**\n * @constructor RangeNode\n * @extends {Node}\n * create a range\n * @param {Node} start included lower-bound\n * @param {Node} end included upper-bound\n * @param {Node} [step] optional step\n */\n constructor(start, end, step) {\n super();\n // validate inputs\n if (!isNode(start)) throw new TypeError('Node expected');\n if (!isNode(end)) throw new TypeError('Node expected');\n if (step && !isNode(step)) throw new TypeError('Node expected');\n if (arguments.length > 3) throw new Error('Too many arguments');\n this.start = start; // included lower-bound\n this.end = end; // included upper-bound\n this.step = step || null; // optional step\n }\n get type() {\n return name;\n }\n get isRangeNode() {\n return true;\n }\n\n /**\n * Check whether the RangeNode needs the `end` symbol to be defined.\n * This end is the size of the Matrix in current dimension.\n * @return {boolean}\n */\n needsEnd() {\n // find all `end` symbols in this RangeNode\n var endSymbols = this.filter(function (node) {\n return isSymbolNode(node) && node.name === 'end';\n });\n return endSymbols.length > 0;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var range = math.range;\n var evalStart = this.start._compile(math, argNames);\n var evalEnd = this.end._compile(math, argNames);\n if (this.step) {\n var evalStep = this.step._compile(math, argNames);\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context), evalStep(scope, args, context));\n };\n } else {\n return function evalRangeNode(scope, args, context) {\n return range(evalStart(scope, args, context), evalEnd(scope, args, context));\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.start, 'start', this);\n callback(this.end, 'end', this);\n if (this.step) {\n callback(this.step, 'step', this);\n }\n }\n\n /**\n * Create a new RangeNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RangeNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RangeNode(this._ifNode(callback(this.start, 'start', this)), this._ifNode(callback(this.end, 'end', this)), this.step && this._ifNode(callback(this.step, 'step', this)));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RangeNode}\n */\n clone() {\n return new RangeNode(this.start, this.end, this.step && this.step);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toString(options);\n if (parens.start) {\n start = '(' + start + ')';\n }\n str = start;\n if (this.step) {\n var step = this.step.toString(options);\n if (parens.step) {\n step = '(' + step + ')';\n }\n str += ':' + step;\n }\n var end = this.end.toString(options);\n if (parens.end) {\n end = '(' + end + ')';\n }\n str += ':' + end;\n return str;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n start: this.start,\n end: this.end,\n step: this.step\n };\n }\n\n /**\n * Instantiate an RangeNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RangeNode\", \"start\": ..., \"end\": ..., \"step\": ...}`,\n * where mathjs is optional\n * @returns {RangeNode}\n */\n static fromJSON(json) {\n return new RangeNode(json.start, json.end, json.step);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n\n // format string as start:step:stop\n var str;\n var start = this.start.toHTML(options);\n if (parens.start) {\n start = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + start + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str = start;\n if (this.step) {\n var step = this.step.toHTML(options);\n if (parens.step) {\n step = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + step + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str += '<span class=\"math-operator math-range-operator\">:</span>' + step;\n }\n var end = this.end.toHTML(options);\n if (parens.end) {\n end = '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + end + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>';\n }\n str += '<span class=\"math-operator math-range-operator\">:</span>' + end;\n return str;\n }\n\n /**\n * Get LaTeX representation\n * @params {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var parens = calculateNecessaryParentheses(this, parenthesis, options && options.implicit);\n var str = this.start.toTex(options);\n if (parens.start) {\n str = \"\\\\left(\".concat(str, \"\\\\right)\");\n }\n if (this.step) {\n var step = this.step.toTex(options);\n if (parens.step) {\n step = \"\\\\left(\".concat(step, \"\\\\right)\");\n }\n str += ':' + step;\n }\n var end = this.end.toTex(options);\n if (parens.end) {\n end = \"\\\\left(\".concat(end, \"\\\\right)\");\n }\n str += ':' + end;\n return str;\n }\n }\n _defineProperty(RangeNode, \"name\", name);\n return RangeNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { getPrecedence } from '../operators.js';\nimport { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { latexOperators } from '../../utils/latex.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'RelationalNode';\nvar dependencies = ['Node'];\nexport var createRelationalNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Node\n } = _ref;\n var operatorMap = {\n equal: '==',\n unequal: '!=',\n smaller: '<',\n larger: '>',\n smallerEq: '<=',\n largerEq: '>='\n };\n class RelationalNode extends Node {\n /**\n * A node representing a chained conditional expression, such as 'x > y > z'\n *\n * @param {String[]} conditionals\n * An array of conditional operators used to compare the parameters\n * @param {Node[]} params\n * The parameters that will be compared\n *\n * @constructor RelationalNode\n * @extends {Node}\n */\n constructor(conditionals, params) {\n super();\n if (!Array.isArray(conditionals)) {\n throw new TypeError('Parameter conditionals must be an array');\n }\n if (!Array.isArray(params)) {\n throw new TypeError('Parameter params must be an array');\n }\n if (conditionals.length !== params.length - 1) {\n throw new TypeError('Parameter params must contain exactly one more element ' + 'than parameter conditionals');\n }\n this.conditionals = conditionals;\n this.params = params;\n }\n get type() {\n return name;\n }\n get isRelationalNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var self = this;\n var compiled = this.params.map(p => p._compile(math, argNames));\n return function evalRelationalNode(scope, args, context) {\n var evalLhs;\n var evalRhs = compiled[0](scope, args, context);\n for (var i = 0; i < self.conditionals.length; i++) {\n evalLhs = evalRhs;\n evalRhs = compiled[i + 1](scope, args, context);\n var condFn = getSafeProperty(math, self.conditionals[i]);\n if (!condFn(evalLhs, evalRhs)) {\n return false;\n }\n }\n return true;\n };\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n this.params.forEach((n, i) => callback(n, 'params[' + i + ']', this), this);\n }\n\n /**\n * Create a new RelationalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {RelationalNode} Returns a transformed copy of the node\n */\n map(callback) {\n return new RelationalNode(this.conditionals.slice(), this.params.map((n, i) => this._ifNode(callback(n, 'params[' + i + ']', this)), this));\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {RelationalNode}\n */\n clone() {\n return new RelationalNode(this.conditionals, this.params);\n }\n\n /**\n * Get string representation.\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '(' + p.toString(options) + ')' : p.toString(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += ' ' + operatorMap[this.conditionals[i]];\n ret += ' ' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n conditionals: this.conditionals,\n params: this.params\n };\n }\n\n /**\n * Instantiate a RelationalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"RelationalNode\", \"conditionals\": ..., \"params\": ...}`,\n * where mathjs is optional\n * @returns {RelationalNode}\n */\n static fromJSON(json) {\n return new RelationalNode(json.conditionals, json.params);\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '<span class=\"math-parenthesis math-round-parenthesis\">(</span>' + p.toHTML(options) + '<span class=\"math-parenthesis math-round-parenthesis\">)</span>' : p.toHTML(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += '<span class=\"math-operator math-binary-operator ' + 'math-explicit-binary-operator\">' + escape(operatorMap[this.conditionals[i]]) + '</span>' + paramStrings[i + 1];\n }\n return ret;\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var parenthesis = options && options.parenthesis ? options.parenthesis : 'keep';\n var precedence = getPrecedence(this, parenthesis, options && options.implicit);\n var paramStrings = this.params.map(function (p, index) {\n var paramPrecedence = getPrecedence(p, parenthesis, options && options.implicit);\n return parenthesis === 'all' || paramPrecedence !== null && paramPrecedence <= precedence ? '\\\\left(' + p.toTex(options) + '\\right)' : p.toTex(options);\n });\n var ret = paramStrings[0];\n for (var i = 0; i < this.conditionals.length; i++) {\n ret += latexOperators[this.conditionals[i]] + paramStrings[i + 1];\n }\n return ret;\n }\n }\n _defineProperty(RelationalNode, \"name\", name);\n return RelationalNode;\n}, {\n isClass: true,\n isNode: true\n});","import { escape } from '../../utils/string.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { factory } from '../../utils/factory.js';\nimport { toSymbol } from '../../utils/latex.js';\nvar name = 'SymbolNode';\nvar dependencies = ['math', '?Unit', 'Node'];\nexport var createSymbolNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n math,\n Unit,\n Node\n } = _ref;\n /**\n * Check whether some name is a valueless unit like \"inch\".\n * @param {string} name\n * @return {boolean}\n */\n function isValuelessUnit(name) {\n return Unit ? Unit.isValuelessUnit(name) : false;\n }\n class SymbolNode extends Node {\n /**\n * @constructor SymbolNode\n * @extends {Node}\n * A symbol node can hold and resolve a symbol\n * @param {string} name\n * @extends {Node}\n */\n constructor(name) {\n super();\n // validate input\n if (typeof name !== 'string') {\n throw new TypeError('String expected for parameter \"name\"');\n }\n this.name = name;\n }\n get type() {\n return 'SymbolNode';\n }\n get isSymbolNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n var name = this.name;\n if (argNames[name] === true) {\n // this is a FunctionAssignment argument\n // (like an x when inside the expression of a function\n // assignment `f(x) = ...`)\n return function (scope, args, context) {\n return getSafeProperty(args, name);\n };\n } else if (name in math) {\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : getSafeProperty(math, name);\n };\n } else {\n var isUnit = isValuelessUnit(name);\n return function (scope, args, context) {\n return scope.has(name) ? scope.get(name) : isUnit ? new Unit(null, name) : SymbolNode.onUndefinedSymbol(name);\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new SymbolNode with children produced by the given callback.\n * Trivial since a SymbolNode has no children\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {SymbolNode} Returns a clone of the node\n */\n map(callback) {\n return this.clone();\n }\n\n /**\n * Throws an error 'Undefined symbol {name}'\n * @param {string} name\n */\n static onUndefinedSymbol(name) {\n throw new Error('Undefined symbol ' + name);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {SymbolNode}\n */\n clone() {\n return new SymbolNode(this.name);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toString(options) {\n return this.name;\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toHTML(options) {\n var name = escape(this.name);\n if (name === 'true' || name === 'false') {\n return '<span class=\"math-symbol math-boolean\">' + name + '</span>';\n } else if (name === 'i') {\n return '<span class=\"math-symbol math-imaginary-symbol\">' + name + '</span>';\n } else if (name === 'Infinity') {\n return '<span class=\"math-symbol math-infinity-symbol\">' + name + '</span>';\n } else if (name === 'NaN') {\n return '<span class=\"math-symbol math-nan-symbol\">' + name + '</span>';\n } else if (name === 'null') {\n return '<span class=\"math-symbol math-null-symbol\">' + name + '</span>';\n } else if (name === 'undefined') {\n return '<span class=\"math-symbol math-undefined-symbol\">' + name + '</span>';\n }\n return '<span class=\"math-symbol\">' + name + '</span>';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: 'SymbolNode',\n name: this.name\n };\n }\n\n /**\n * Instantiate a SymbolNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", name: \"x\"}`,\n * where mathjs is optional\n * @returns {SymbolNode}\n */\n static fromJSON(json) {\n return new SymbolNode(json.name);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n * @override\n */\n _toTex(options) {\n var isUnit = false;\n if (typeof math[this.name] === 'undefined' && isValuelessUnit(this.name)) {\n isUnit = true;\n }\n var symbol = toSymbol(this.name, isUnit);\n if (symbol[0] === '\\\\') {\n // no space needed if the symbol starts with '\\'\n return symbol;\n }\n // the space prevents symbols from breaking stuff like '\\cdot'\n // if it's written right before the symbol\n return ' ' + symbol;\n }\n }\n return SymbolNode;\n}, {\n isClass: true,\n isNode: true\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { isAccessorNode, isFunctionAssignmentNode, isIndexNode, isNode, isSymbolNode } from '../../utils/is.js';\nimport { escape, format } from '../../utils/string.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { getSafeProperty, getSafeMethod } from '../../utils/customs.js';\nimport { createSubScope } from '../../utils/scope.js';\nimport { factory } from '../../utils/factory.js';\nimport { defaultTemplate, latexFunctions } from '../../utils/latex.js';\nvar name = 'FunctionNode';\nvar dependencies = ['math', 'Node', 'SymbolNode'];\nexport var createFunctionNode = /* #__PURE__ */factory(name, dependencies, _ref => {\n var _FunctionNode;\n var {\n math,\n Node,\n SymbolNode\n } = _ref;\n /* format to fixed length */\n var strin = entity => format(entity, {\n truncate: 78\n });\n\n /*\n * Expand a LaTeX template\n *\n * @param {string} template\n * @param {Node} node\n * @param {Object} options\n * @private\n **/\n function expandTemplate(template, node, options) {\n var latex = '';\n\n // Match everything of the form ${identifier} or ${identifier[2]} or $$\n // while submatching identifier and 2 (in the second case)\n var regex = /\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;\n var inputPos = 0; // position in the input string\n var match;\n while ((match = regex.exec(template)) !== null) {\n // go through all matches\n // add everything in front of the match to the LaTeX string\n latex += template.substring(inputPos, match.index);\n inputPos = match.index;\n if (match[0] === '$$') {\n // escaped dollar sign\n latex += '$';\n inputPos++;\n } else {\n // template parameter\n inputPos += match[0].length;\n var property = node[match[1]];\n if (!property) {\n throw new ReferenceError('Template: Property ' + match[1] + ' does not exist.');\n }\n if (match[2] === undefined) {\n // no square brackets\n switch (typeof property) {\n case 'string':\n latex += property;\n break;\n case 'object':\n if (isNode(property)) {\n latex += property.toTex(options);\n } else if (Array.isArray(property)) {\n // make array of Nodes into comma separated list\n latex += property.map(function (arg, index) {\n if (isNode(arg)) {\n return arg.toTex(options);\n }\n throw new TypeError('Template: ' + match[1] + '[' + index + '] is not a Node.');\n }).join(',');\n } else {\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n break;\n default:\n throw new TypeError('Template: ' + match[1] + ' has to be a Node, String or array of Nodes');\n }\n } else {\n // with square brackets\n if (isNode(property[match[2]] && property[match[2]])) {\n latex += property[match[2]].toTex(options);\n } else {\n throw new TypeError('Template: ' + match[1] + '[' + match[2] + '] is not a Node.');\n }\n }\n }\n }\n latex += template.slice(inputPos); // append rest of the template\n\n return latex;\n }\n class FunctionNode extends Node {\n /**\n * @constructor FunctionNode\n * @extends {./Node}\n * invoke a list with arguments on a node\n * @param {./Node | string} fn\n * Item resolving to a function on which to invoke\n * the arguments, typically a SymbolNode or AccessorNode\n * @param {./Node[]} args\n */\n constructor(fn, args, optional) {\n super();\n if (typeof fn === 'string') {\n fn = new SymbolNode(fn);\n }\n\n // validate input\n if (!isNode(fn)) throw new TypeError('Node expected as parameter \"fn\"');\n if (!Array.isArray(args) || !args.every(isNode)) {\n throw new TypeError('Array containing Nodes expected for parameter \"args\"');\n }\n var optionalType = typeof optional;\n if (!(optionalType === 'undefined' || optionalType === 'boolean')) {\n throw new TypeError('optional flag, if specified, must be boolean');\n }\n this.fn = fn;\n this.args = args || [];\n this.optional = !!optional;\n }\n\n // readonly property name\n get name() {\n return this.fn.name || '';\n }\n get type() {\n return name;\n }\n get isFunctionNode() {\n return true;\n }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile(math, argNames) {\n // compile arguments\n var evalArgs = this.args.map(arg => arg._compile(math, argNames));\n var fromOptionalChaining = this.optional || isAccessorNode(this.fn) && this.fn.optionalChaining;\n if (isSymbolNode(this.fn)) {\n var _name = this.fn.name;\n if (!argNames[_name]) {\n // we can statically determine whether the function\n // has the rawArgs property\n var fn = _name in math ? getSafeProperty(math, _name) : undefined;\n var isRaw = typeof fn === 'function' && fn.rawArgs === true;\n var resolveFn = scope => {\n var value;\n if (scope.has(_name)) {\n value = scope.get(_name);\n } else if (_name in math) {\n value = getSafeProperty(math, _name);\n } else if (fromOptionalChaining) value = undefined;else return FunctionNode.onUndefinedFunction(_name);\n if (typeof value === 'function' || fromOptionalChaining && value === undefined) {\n return value;\n }\n throw new TypeError(\"'\".concat(_name, \"' is not a function; its value is:\\n \").concat(strin(value)));\n };\n if (isRaw) {\n // pass unevaluated parameters (nodes) to the function\n // \"raw\" evaluation\n var rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n\n // the original function can be overwritten in the scope with a non-rawArgs function\n if (fn.rawArgs === true) {\n return fn(rawArgs, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n }\n };\n } else {\n // \"regular\" evaluation\n switch (evalArgs.length) {\n case 0:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n return fn();\n };\n case 1:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var evalArg0 = evalArgs[0];\n return fn(evalArg0(scope, args, context));\n };\n case 2:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var evalArg0 = evalArgs[0];\n var evalArg1 = evalArgs[1];\n return fn(evalArg0(scope, args, context), evalArg1(scope, args, context));\n };\n default:\n return function evalFunctionNode(scope, args, context) {\n var fn = resolveFn(scope);\n if (fromOptionalChaining && fn === undefined) return undefined;\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn(...values);\n };\n }\n }\n } else {\n // the function symbol is an argName\n var _rawArgs = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = getSafeProperty(args, _name);\n if (fromOptionalChaining && fn === undefined) return undefined;\n if (typeof fn !== 'function') {\n throw new TypeError(\"Argument '\".concat(_name, \"' was not a function; received: \").concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs, math, createSubScope(scope, args));\n } else {\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n } else if (isAccessorNode(this.fn) && isIndexNode(this.fn.index) && this.fn.index.isObjectProperty()) {\n // execute the function with the right context:\n // the object of the AccessorNode\n\n var evalObject = this.fn.object._compile(math, argNames);\n var prop = this.fn.index.getObjectProperty();\n var _rawArgs2 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var object = evalObject(scope, args, context);\n\n // Optional chaining: if the base object is nullish, short-circuit to undefined\n if (fromOptionalChaining && (object == null || object[prop] === undefined)) {\n return undefined;\n }\n var fn = getSafeMethod(object, prop);\n if (fn !== null && fn !== void 0 && fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs2, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(object, values);\n }\n };\n } else {\n // node.fn.isAccessorNode && !node.fn.index.isObjectProperty()\n // we have to dynamically determine whether the function has the\n // rawArgs property\n var fnExpr = this.fn.toString();\n var evalFn = this.fn._compile(math, argNames);\n var _rawArgs3 = this.args;\n return function evalFunctionNode(scope, args, context) {\n var fn = evalFn(scope, args, context);\n if (fromOptionalChaining && fn === undefined) return undefined;\n if (typeof fn !== 'function') {\n throw new TypeError(\"Expression '\".concat(fnExpr, \"' did not evaluate to a function; value is:\") + \"\\n \".concat(strin(fn)));\n }\n if (fn.rawArgs) {\n // \"Raw\" evaluation\n return fn(_rawArgs3, math, createSubScope(scope, args));\n } else {\n // \"regular\" evaluation\n var values = evalArgs.map(evalArg => evalArg(scope, args, context));\n return fn.apply(fn, values);\n }\n };\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach(callback) {\n callback(this.fn, 'fn', this);\n for (var i = 0; i < this.args.length; i++) {\n callback(this.args[i], 'args[' + i + ']', this);\n }\n }\n\n /**\n * Create a new FunctionNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionNode} Returns a transformed copy of the node\n */\n map(callback) {\n var fn = this._ifNode(callback(this.fn, 'fn', this));\n var args = [];\n for (var i = 0; i < this.args.length; i++) {\n args[i] = this._ifNode(callback(this.args[i], 'args[' + i + ']', this));\n }\n return new FunctionNode(fn, args);\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionNode}\n */\n clone() {\n return new FunctionNode(this.fn, this.args.slice(0));\n }\n\n /**\n * Throws an error 'Undefined function {name}'\n * @param {string} name\n */\n\n /**\n * Get string representation. (wrapper function)\n * This overrides parts of Node's toString function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toString\n * function.\n *\n * @param {Object} options\n * @return {string} str\n * @override\n */\n toString(options) {\n var customString;\n var name = this.fn.toString(options);\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, name)) {\n // callback is a map of callback functions\n customString = options.handler[name](this, options);\n }\n if (typeof customString !== 'undefined') {\n return customString;\n }\n\n // fall back to Node's toString\n return super.toString(options);\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString(options) {\n var args = this.args.map(function (arg) {\n return arg.toString(options);\n });\n var fn = isFunctionAssignmentNode(this.fn) ? '(' + this.fn.toString(options) + ')' : this.fn.toString(options);\n\n // format the arguments like \"add(2, 4.2)\"\n return fn + '(' + args.join(', ') + ')';\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON() {\n return {\n mathjs: name,\n fn: this.fn,\n args: this.args\n };\n }\n\n /**\n * Instantiate an AssignmentNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"FunctionNode\", fn: ..., args: ...}`,\n * where mathjs is optional\n * @returns {FunctionNode}\n */\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML(options) {\n var args = this.args.map(function (arg) {\n return arg.toHTML(options);\n });\n\n // format the arguments like \"add(2, 4.2)\"\n return '<span class=\"math-function\">' + escape(this.fn) + '</span><span class=\"math-paranthesis math-round-parenthesis\">(</span>' + args.join('<span class=\"math-separator\">,</span>') + '<span class=\"math-paranthesis math-round-parenthesis\">)</span>';\n }\n\n /**\n * Get LaTeX representation. (wrapper function)\n * This overrides parts of Node's toTex function.\n * If callback is an object containing callbacks, it\n * calls the correct callback for the current node,\n * otherwise it falls back to calling Node's toTex\n * function.\n *\n * @param {Object} options\n * @return {string}\n */\n toTex(options) {\n var customTex;\n if (options && typeof options.handler === 'object' && hasOwnProperty(options.handler, this.name)) {\n // callback is a map of callback functions\n customTex = options.handler[this.name](this, options);\n }\n if (typeof customTex !== 'undefined') {\n return customTex;\n }\n\n // fall back to Node's toTex\n return super.toTex(options);\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex(options) {\n var args = this.args.map(function (arg) {\n // get LaTeX of the arguments\n return arg.toTex(options);\n });\n var latexConverter;\n if (latexFunctions[this.name]) {\n latexConverter = latexFunctions[this.name];\n }\n\n // toTex property on the function itself\n if (math[this.name] && (typeof math[this.name].toTex === 'function' || typeof math[this.name].toTex === 'object' || typeof math[this.name].toTex === 'string')) {\n // .toTex is a callback function\n latexConverter = math[this.name].toTex;\n }\n var customToTex;\n switch (typeof latexConverter) {\n case 'function':\n // a callback function\n customToTex = latexConverter(this, options);\n break;\n case 'string':\n // a template string\n customToTex = expandTemplate(latexConverter, this, options);\n break;\n case 'object':\n // an object with different \"converters\" for different\n // numbers of arguments\n switch (typeof latexConverter[args.length]) {\n case 'function':\n customToTex = latexConverter[args.length](this, options);\n break;\n case 'string':\n customToTex = expandTemplate(latexConverter[args.length], this, options);\n break;\n }\n }\n if (typeof customToTex !== 'undefined') {\n return customToTex;\n }\n return expandTemplate(defaultTemplate, this, options);\n }\n\n /**\n * Get identifier.\n * @return {string}\n */\n getIdentifier() {\n return this.type + ':' + this.name;\n }\n }\n _FunctionNode = FunctionNode;\n _defineProperty(FunctionNode, \"name\", name);\n _defineProperty(FunctionNode, \"onUndefinedFunction\", function (name) {\n throw new Error('Undefined function ' + name);\n });\n _defineProperty(FunctionNode, \"fromJSON\", function (json) {\n return new _FunctionNode(json.fn, json.args);\n });\n return FunctionNode;\n}, {\n isClass: true,\n isNode: true\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport { factory } from '../utils/factory.js';\nimport { isAccessorNode, isConstantNode, isFunctionNode, isOperatorNode, isSymbolNode, rule2Node } from '../utils/is.js';\nimport { deepMap } from '../utils/collection.js';\nimport { safeNumberType } from '../utils/number.js';\nimport { hasOwnProperty } from '../utils/object.js';\nvar name = 'parse';\nvar dependencies = ['typed', 'numeric', 'config', 'AccessorNode', 'ArrayNode', 'AssignmentNode', 'BlockNode', 'ConditionalNode', 'ConstantNode', 'FunctionAssignmentNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'RangeNode', 'RelationalNode', 'SymbolNode'];\nexport var createParse = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n numeric,\n config,\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode\n } = _ref;\n /**\n * Parse an expression. Returns a node tree, which can be evaluated by\n * invoking node.evaluate() or transformed into a functional object via node.compile().\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.parse(expr)\n * math.parse(expr, options)\n * math.parse([expr1, expr2, expr3, ...])\n * math.parse([expr1, expr2, expr3, ...], options)\n *\n * Example:\n *\n * const node1 = math.parse('sqrt(3^2 + 4^2)')\n * node1.compile().evaluate() // 5\n *\n * let scope = {a:3, b:4}\n * const node2 = math.parse('a * b')\n * node2.evaluate(scope) // 12\n * const code2 = node2.compile()\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].compile().evaluate() // 12\n *\n * See also:\n *\n * evaluate, compile\n *\n * History:\n *\n * v0.9 Created\n * v0.13 Switched to one-based indices\n * v0.14 Added `[1,2;3,4]` notation for matrices\n * v0.18 Dropped the `function` keyword\n * v0.20 Added ternary conditional\n * v0.27 Allow multi-line expressions; allow functions that receive\n * unevaluated parameters (`rawArgs`)\n * v3 Add object notation; allow assignments internal to other\n * expressions\n * v7.3 Supported binary, octal, and hexadecimal notation\n * v9.5 Support for calculations with percentages\n * v12.4 Allow trailing commas in matrices\n * v14.8 Add nullish coalescing operator\n * v15.1 Add optional chaining operator\n *\n * @param {string | string[] | Matrix} expr Expression to be parsed\n * @param {{nodes: Object<string, Node>}} [options] Available options:\n * - `nodes` a set of custom nodes\n * @return {Node | Node[]} node\n * @throws {Error}\n */\n var parse = typed(name, {\n string: function string(expression) {\n return parseStart(expression, {});\n },\n 'Array | Matrix': function Array__Matrix(expressions) {\n return parseMultiple(expressions, {});\n },\n 'string, Object': function string_Object(expression, options) {\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n return parseStart(expression, extraNodes);\n },\n 'Array | Matrix, Object': parseMultiple\n });\n function parseMultiple(expressions) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var extraNodes = options.nodes !== undefined ? options.nodes : {};\n\n // parse an array or matrix with expressions\n return deepMap(expressions, function (elem) {\n if (typeof elem !== 'string') throw new TypeError('String expected');\n return parseStart(elem, extraNodes);\n });\n }\n\n // token types enumeration\n var TOKENTYPE = {\n NULL: 0,\n DELIMITER: 1,\n NUMBER: 2,\n SYMBOL: 3,\n UNKNOWN: 4\n };\n\n // map with all delimiters\n var DELIMITERS = {\n ',': true,\n '(': true,\n ')': true,\n '[': true,\n ']': true,\n '{': true,\n '}': true,\n '\"': true,\n '\\'': true,\n ';': true,\n '+': true,\n '-': true,\n '*': true,\n '.*': true,\n '/': true,\n './': true,\n '%': true,\n '^': true,\n '.^': true,\n '~': true,\n '!': true,\n '&': true,\n '|': true,\n '^|': true,\n '=': true,\n ':': true,\n '?': true,\n '?.': true,\n '??': true,\n '==': true,\n '!=': true,\n '<': true,\n '>': true,\n '<=': true,\n '>=': true,\n '<<': true,\n '>>': true,\n '>>>': true\n };\n\n // map with all named delimiters\n var NAMED_DELIMITERS = {\n mod: true,\n to: true,\n in: true,\n and: true,\n xor: true,\n or: true,\n not: true\n };\n var CONSTANTS = {\n true: true,\n false: false,\n null: null,\n undefined\n };\n var NUMERIC_CONSTANTS = ['NaN', 'Infinity'];\n var ESCAPE_CHARACTERS = {\n '\"': '\"',\n \"'\": \"'\",\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n // note that \\u is handled separately in parseStringToken()\n };\n function initialState() {\n return {\n extraNodes: {},\n // current extra nodes, must be careful not to mutate\n expression: '',\n // current expression\n comment: '',\n // last parsed comment\n index: 0,\n // current index in expr\n token: '',\n // current token\n tokenType: TOKENTYPE.NULL,\n // type of the token\n nestingLevel: 0,\n // level of nesting inside parameters, used to ignore newline characters\n conditionalLevel: null // when a conditional is being parsed, the level of the conditional is stored here\n };\n }\n\n /**\n * View upto `length` characters of the expression starting at the current character.\n *\n * @param {Object} state\n * @param {number} [length=1] Number of characters to view\n * @returns {string}\n * @private\n */\n function currentString(state, length) {\n return state.expression.substr(state.index, length);\n }\n\n /**\n * View the current character. Returns '' if end of expression is reached.\n *\n * @param {Object} state\n * @returns {string}\n * @private\n */\n function currentCharacter(state) {\n return currentString(state, 1);\n }\n\n /**\n * Get the next character from the expression.\n * The character is stored into the char c. If the end of the expression is\n * reached, the function puts an empty string in c.\n * @private\n */\n function next(state) {\n state.index++;\n }\n\n /**\n * Preview the previous character from the expression.\n * @return {string} cNext\n * @private\n */\n function prevCharacter(state) {\n return state.expression.charAt(state.index - 1);\n }\n\n /**\n * Preview the next character from the expression.\n * @return {string} cNext\n * @private\n */\n function nextCharacter(state) {\n return state.expression.charAt(state.index + 1);\n }\n\n /**\n * Get next token in the current string expr.\n * The token and token type are available as token and tokenType\n * @private\n */\n function getToken(state) {\n state.tokenType = TOKENTYPE.NULL;\n state.token = '';\n state.comment = '';\n\n // skip over ignored characters:\n while (true) {\n // comments:\n if (currentCharacter(state) === '#') {\n while (currentCharacter(state) !== '\\n' && currentCharacter(state) !== '') {\n state.comment += currentCharacter(state);\n next(state);\n }\n }\n // whitespace: space, tab, and newline when inside parameters\n if (parse.isWhitespace(currentCharacter(state), state.nestingLevel)) {\n next(state);\n } else {\n break;\n }\n }\n\n // check for end of expression\n if (currentCharacter(state) === '') {\n // token is still empty\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n\n // check for new line character\n if (currentCharacter(state) === '\\n' && !state.nestingLevel) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = currentCharacter(state);\n next(state);\n return;\n }\n var c1 = currentCharacter(state);\n var c2 = currentString(state, 2);\n var c3 = currentString(state, 3);\n if (c3.length === 3 && DELIMITERS[c3]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c3;\n next(state);\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 2 characters\n // Special case: the check for '?.' is to prevent a case like 'a?.3:.7' from being interpreted as optional chaining\n // TODO: refactor the tokenization into some better way to deal with cases like 'a?.3:.7', see https://github.com/josdejong/mathjs/pull/3584\n if (c2.length === 2 && DELIMITERS[c2] && (c2 !== '?.' || !parse.isDigit(state.expression.charAt(state.index + 2)))) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c2;\n next(state);\n next(state);\n return;\n }\n\n // check for delimiters consisting of 1 character\n if (DELIMITERS[c1]) {\n state.tokenType = TOKENTYPE.DELIMITER;\n state.token = c1;\n next(state);\n return;\n }\n\n // check for a number\n if (parse.isDigitDot(c1)) {\n state.tokenType = TOKENTYPE.NUMBER;\n\n // check for binary, octal, or hex\n var _c = currentString(state, 2);\n if (_c === '0b' || _c === '0o' || _c === '0x') {\n state.token += currentCharacter(state);\n next(state);\n state.token += currentCharacter(state);\n next(state);\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (currentCharacter(state) === '.') {\n // this number has a radix point\n state.token += '.';\n next(state);\n // get the digits after the radix\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n } else if (currentCharacter(state) === 'i') {\n // this number has a word size suffix\n state.token += 'i';\n next(state);\n // get the word size\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n return;\n }\n\n // get number, can have a single dot\n if (currentCharacter(state) === '.') {\n state.token += currentCharacter(state);\n next(state);\n if (!parse.isDigit(currentCharacter(state))) {\n // this is no number, it is just a dot (can be dot notation)\n state.tokenType = TOKENTYPE.DELIMITER;\n return;\n }\n } else {\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n // check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\n if (currentCharacter(state) === 'E' || currentCharacter(state) === 'e') {\n if (parse.isDigit(nextCharacter(state)) || nextCharacter(state) === '-' || nextCharacter(state) === '+') {\n state.token += currentCharacter(state);\n next(state);\n if (currentCharacter(state) === '+' || currentCharacter(state) === '-') {\n state.token += currentCharacter(state);\n next(state);\n }\n // Scientific notation MUST be followed by an exponent\n if (!parse.isDigit(currentCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n while (parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (parse.isDecimalMark(currentCharacter(state), nextCharacter(state))) {\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n } else if (parse.isDecimalMark(nextCharacter(state), state.expression.charAt(state.index + 2))) {\n next(state);\n throw createSyntaxError(state, 'Digit expected, got \"' + currentCharacter(state) + '\"');\n }\n }\n return;\n }\n\n // check for variables, functions, named operators\n if (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state))) {\n while (parse.isAlpha(currentCharacter(state), prevCharacter(state), nextCharacter(state)) || parse.isDigit(currentCharacter(state))) {\n state.token += currentCharacter(state);\n next(state);\n }\n if (hasOwnProperty(NAMED_DELIMITERS, state.token)) {\n state.tokenType = TOKENTYPE.DELIMITER;\n } else {\n state.tokenType = TOKENTYPE.SYMBOL;\n }\n return;\n }\n\n // something unknown is found, wrong characters -> a syntax error\n state.tokenType = TOKENTYPE.UNKNOWN;\n while (currentCharacter(state) !== '') {\n state.token += currentCharacter(state);\n next(state);\n }\n throw createSyntaxError(state, 'Syntax error in part \"' + state.token + '\"');\n }\n\n /**\n * Get next token and skip newline tokens\n */\n function getTokenSkipNewline(state) {\n do {\n getToken(state);\n } while (state.token === '\\n'); // eslint-disable-line no-unmodified-loop-condition\n }\n\n /**\n * Open parameters.\n * New line characters will be ignored until closeParams(state) is called\n */\n function openParams(state) {\n state.nestingLevel++;\n }\n\n /**\n * Close parameters.\n * New line characters will no longer be ignored\n */\n function closeParams(state) {\n state.nestingLevel--;\n }\n\n /**\n * Checks whether the current character `c` is a valid alpha character:\n *\n * - A latin letter (upper or lower case) Ascii: a-z, A-Z\n * - An underscore Ascii: _\n * - A dollar sign Ascii: $\n * - A latin letter with accents Unicode: \\u00C0 - \\u02AF\n * - A greek letter Unicode: \\u0370 - \\u03FF\n * - A mathematical alphanumeric symbol Unicode: \\u{1D400} - \\u{1D7FF} excluding invalid code points\n *\n * The previous and next characters are needed to determine whether\n * this character is part of a unicode surrogate pair.\n *\n * @param {string} c Current character in the expression\n * @param {string} cPrev Previous character\n * @param {string} cNext Next character\n * @return {boolean}\n */\n parse.isAlpha = function isAlpha(c, cPrev, cNext) {\n return parse.isValidLatinOrGreek(c) || parse.isValidMathSymbol(c, cNext) || parse.isValidMathSymbol(cPrev, c);\n };\n\n /**\n * Test whether a character is a valid latin, greek, or letter-like character\n * @param {string} c\n * @return {boolean}\n */\n parse.isValidLatinOrGreek = function isValidLatinOrGreek(c) {\n return /^[a-zA-Z_$\\u00C0-\\u02AF\\u0370-\\u03FF\\u2100-\\u214F]$/.test(c);\n };\n\n /**\n * Test whether two given 16 bit characters form a surrogate pair of a\n * unicode math symbol.\n *\n * https://unicode-table.com/en/\n * https://www.wikiwand.com/en/Mathematical_operators_and_symbols_in_Unicode\n *\n * Note: In ES6 will be unicode aware:\n * https://stackoverflow.com/questions/280712/javascript-unicode-regexes\n * https://mathiasbynens.be/notes/es6-unicode-regex\n *\n * @param {string} high\n * @param {string} low\n * @return {boolean}\n */\n parse.isValidMathSymbol = function isValidMathSymbol(high, low) {\n return /^[\\uD835]$/.test(high) && /^[\\uDC00-\\uDFFF]$/.test(low) && /^[^\\uDC55\\uDC9D\\uDCA0\\uDCA1\\uDCA3\\uDCA4\\uDCA7\\uDCA8\\uDCAD\\uDCBA\\uDCBC\\uDCC4\\uDD06\\uDD0B\\uDD0C\\uDD15\\uDD1D\\uDD3A\\uDD3F\\uDD45\\uDD47-\\uDD49\\uDD51\\uDEA6\\uDEA7\\uDFCC\\uDFCD]$/.test(low);\n };\n\n /**\n * Check whether given character c is a white space character: space, tab, or enter\n * @param {string} c\n * @param {number} nestingLevel\n * @return {boolean}\n */\n parse.isWhitespace = function isWhitespace(c, nestingLevel) {\n // TODO: also take '\\r' carriage return as newline? Or does that give problems on mac?\n return c === ' ' || c === '\\t' || c === '\\u00A0' || c === '\\n' && nestingLevel > 0;\n };\n\n /**\n * Test whether the character c is a decimal mark (dot).\n * This is the case when it's not the start of a delimiter '.*', './', or '.^'\n * @param {string} c\n * @param {string} cNext\n * @return {boolean}\n */\n parse.isDecimalMark = function isDecimalMark(c, cNext) {\n return c === '.' && cNext !== '/' && cNext !== '*' && cNext !== '^';\n };\n\n /**\n * checks if the given char c is a digit or dot\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigitDot = function isDigitDot(c) {\n return c >= '0' && c <= '9' || c === '.';\n };\n\n /**\n * checks if the given char c is a digit\n * @param {string} c a string with one character\n * @return {boolean}\n */\n parse.isDigit = function isDigit(c) {\n return c >= '0' && c <= '9';\n };\n\n /**\n * Start of the parse levels below, in order of precedence\n * @return {Node} node\n * @private\n */\n function parseStart(expression, extraNodes) {\n var state = initialState();\n _extends(state, {\n expression,\n extraNodes\n });\n getToken(state);\n var node = parseBlock(state);\n\n // check for garbage at the end of the expression\n // an expression ends with a empty character '' and tokenType DELIMITER\n if (state.token !== '') {\n if (state.tokenType === TOKENTYPE.DELIMITER) {\n // user entered a not existing operator like \"//\"\n\n // TODO: give hints for aliases, for example with \"<>\" give as hint \" did you mean !== ?\"\n throw createError(state, 'Unexpected operator ' + state.token);\n } else {\n throw createSyntaxError(state, 'Unexpected part \"' + state.token + '\"');\n }\n }\n return node;\n }\n\n /**\n * Parse a block with expressions. Expressions can be separated by a newline\n * character '\\n', or by a semicolon ';'. In case of a semicolon, no output\n * of the preceding line is returned.\n * @return {Node} node\n * @private\n */\n function parseBlock(state) {\n var node;\n var blocks = [];\n var visible;\n if (state.token !== '' && state.token !== '\\n' && state.token !== ';') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n\n // TODO: simplify this loop\n while (state.token === '\\n' || state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n if (blocks.length === 0 && node) {\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n getToken(state);\n if (state.token !== '\\n' && state.token !== ';' && state.token !== '') {\n node = parseAssignment(state);\n if (state.comment) {\n node.comment = state.comment;\n }\n visible = state.token !== ';';\n blocks.push({\n node,\n visible\n });\n }\n }\n if (blocks.length > 0) {\n return new BlockNode(blocks);\n } else {\n if (!node) {\n node = new ConstantNode(undefined);\n if (state.comment) {\n node.comment = state.comment;\n }\n }\n return node;\n }\n }\n\n /**\n * Assignment of a function or variable,\n * - can be a variable like 'a=2.3'\n * - or a updating an existing variable like 'matrix(2,3:5)=[6,7,8]'\n * - defining a function like 'f(x) = x^2'\n * @return {Node} node\n * @private\n */\n function parseAssignment(state) {\n var name, args, value, valid;\n var node = parseConditional(state);\n if (state.token === '=') {\n if (isSymbolNode(node)) {\n // parse a variable assignment like 'a = 2/3'\n name = node.name;\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(new SymbolNode(name), value);\n } else if (isAccessorNode(node)) {\n // parse a matrix subset assignment like 'A[1,2] = 4'\n if (node.optionalChaining) {\n throw createSyntaxError(state, 'Cannot assign to optional chain');\n }\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new AssignmentNode(node.object, node.index, value);\n } else if (isFunctionNode(node) && isSymbolNode(node.fn)) {\n // parse function assignment like 'f(x) = x^2'\n valid = true;\n args = [];\n name = node.name;\n node.args.forEach(function (arg, index) {\n if (isSymbolNode(arg)) {\n args[index] = arg.name;\n } else {\n valid = false;\n }\n });\n if (valid) {\n getTokenSkipNewline(state);\n value = parseAssignment(state);\n return new FunctionAssignmentNode(name, args, value);\n }\n }\n throw createSyntaxError(state, 'Invalid left hand side of assignment operator =');\n }\n return node;\n }\n\n /**\n * conditional operation\n *\n * condition ? truePart : falsePart\n *\n * Note: conditional operator is right-associative\n *\n * @return {Node} node\n * @private\n */\n function parseConditional(state) {\n var node = parseLogicalOr(state);\n while (state.token === '?') {\n // eslint-disable-line no-unmodified-loop-condition\n // set a conditional level, the range operator will be ignored as long\n // as conditionalLevel === state.nestingLevel.\n var prev = state.conditionalLevel;\n state.conditionalLevel = state.nestingLevel;\n getTokenSkipNewline(state);\n var condition = node;\n var trueExpr = parseAssignment(state);\n if (state.token !== ':') throw createSyntaxError(state, 'False part of conditional expression expected');\n state.conditionalLevel = null;\n getTokenSkipNewline(state);\n var falseExpr = parseAssignment(state); // Note: check for conditional operator again, right associativity\n\n node = new ConditionalNode(condition, trueExpr, falseExpr);\n\n // restore the previous conditional level\n state.conditionalLevel = prev;\n }\n return node;\n }\n\n /**\n * logical or, 'x or y'\n * @return {Node} node\n * @private\n */\n function parseLogicalOr(state) {\n var node = parseLogicalXor(state);\n while (state.token === 'or') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('or', 'or', [node, parseLogicalXor(state)]);\n }\n return node;\n }\n\n /**\n * logical exclusive or, 'x xor y'\n * @return {Node} node\n * @private\n */\n function parseLogicalXor(state) {\n var node = parseLogicalAnd(state);\n while (state.token === 'xor') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('xor', 'xor', [node, parseLogicalAnd(state)]);\n }\n return node;\n }\n\n /**\n * logical and, 'x and y'\n * @return {Node} node\n * @private\n */\n function parseLogicalAnd(state) {\n var node = parseBitwiseOr(state);\n while (state.token === 'and') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('and', 'and', [node, parseBitwiseOr(state)]);\n }\n return node;\n }\n\n /**\n * bitwise or, 'x | y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseOr(state) {\n var node = parseBitwiseXor(state);\n while (state.token === '|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('|', 'bitOr', [node, parseBitwiseXor(state)]);\n }\n return node;\n }\n\n /**\n * bitwise exclusive or (xor), 'x ^| y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseXor(state) {\n var node = parseBitwiseAnd(state);\n while (state.token === '^|') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('^|', 'bitXor', [node, parseBitwiseAnd(state)]);\n }\n return node;\n }\n\n /**\n * bitwise and, 'x & y'\n * @return {Node} node\n * @private\n */\n function parseBitwiseAnd(state) {\n var node = parseRelational(state);\n while (state.token === '&') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('&', 'bitAnd', [node, parseRelational(state)]);\n }\n return node;\n }\n\n /**\n * Parse a chained conditional, like 'a > b >= c'\n * @return {Node} node\n */\n function parseRelational(state) {\n var params = [parseShift(state)];\n var conditionals = [];\n var operators = {\n '==': 'equal',\n '!=': 'unequal',\n '<': 'smaller',\n '>': 'larger',\n '<=': 'smallerEq',\n '>=': 'largerEq'\n };\n while (hasOwnProperty(operators, state.token)) {\n // eslint-disable-line no-unmodified-loop-condition\n var cond = {\n name: state.token,\n fn: operators[state.token]\n };\n conditionals.push(cond);\n getTokenSkipNewline(state);\n params.push(parseShift(state));\n }\n if (params.length === 1) {\n return params[0];\n } else if (params.length === 2) {\n return new OperatorNode(conditionals[0].name, conditionals[0].fn, params);\n } else {\n return new RelationalNode(conditionals.map(c => c.fn), params);\n }\n }\n\n /**\n * Bitwise left shift, bitwise right arithmetic shift, bitwise right logical shift\n * @return {Node} node\n * @private\n */\n function parseShift(state) {\n var node, name, fn, params;\n node = parseConversion(state);\n var operators = {\n '<<': 'leftShift',\n '>>': 'rightArithShift',\n '>>>': 'rightLogShift'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n params = [node, parseConversion(state)];\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * conversion operators 'to' and 'in'\n * @return {Node} node\n * @private\n */\n function parseConversion(state) {\n var node, name, fn, params;\n node = parseRange(state);\n var operators = {\n to: 'to',\n in: 'to' // alias of 'to'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n if (name === 'in' && '])},;'.includes(state.token)) {\n // end of expression -> this is the unit 'in' ('inch')\n node = new OperatorNode('*', 'multiply', [node, new SymbolNode('in')], true);\n } else {\n // operator 'a to b' or 'a in b'\n params = [node, parseRange(state)];\n node = new OperatorNode(name, fn, params);\n }\n }\n return node;\n }\n\n /**\n * parse range, \"start:end\", \"start:step:end\", \":\", \"start:\", \":end\", etc\n * @return {Node} node\n * @private\n */\n function parseRange(state) {\n var node;\n var params = [];\n if (state.token === ':') {\n if (state.conditionalLevel === state.nestingLevel) {\n // we are in the midst of parsing a conditional operator, so not\n // a range, but rather an empty true-expr, which is considered a\n // syntax error\n throw createSyntaxError(state, 'The true-expression of a conditional operator may not be empty');\n } else {\n // implicit start of range = 1 (one-based)\n node = new ConstantNode(1);\n }\n } else {\n // explicit start\n node = parseAddSubtract(state);\n }\n if (state.token === ':' && state.conditionalLevel !== state.nestingLevel) {\n // we ignore the range operator when a conditional operator is being processed on the same level\n params.push(node);\n\n // parse step and end\n while (state.token === ':' && params.length < 3) {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n if (state.token === ')' || state.token === ']' || state.token === ',' || state.token === '') {\n // implicit end\n params.push(new SymbolNode('end'));\n } else {\n // explicit end\n params.push(parseAddSubtract(state));\n }\n }\n if (params.length === 3) {\n // params = [start, step, end]\n node = new RangeNode(params[0], params[2], params[1]); // start, end, step\n } else {\n // length === 2\n // params = [start, end]\n node = new RangeNode(params[0], params[1]); // start, end\n }\n }\n return node;\n }\n\n /**\n * add or subtract\n * @return {Node} node\n * @private\n */\n function parseAddSubtract(state) {\n var node, name, fn, params;\n node = parseMultiplyDivideModulus(state);\n var operators = {\n '+': 'add',\n '-': 'subtract'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n var rightNode = parseMultiplyDivideModulus(state);\n if (rightNode.isPercentage) {\n params = [node, new OperatorNode('*', 'multiply', [node, rightNode])];\n } else {\n params = [node, rightNode];\n }\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * multiply, divide, modulus\n * @return {Node} node\n * @private\n */\n function parseMultiplyDivideModulus(state) {\n var node, last, name, fn;\n node = parseImplicitMultiplication(state);\n last = node;\n var operators = {\n '*': 'multiply',\n '.*': 'dotMultiply',\n '/': 'divide',\n './': 'dotDivide',\n '%': 'mod',\n mod: 'mod'\n };\n while (true) {\n if (hasOwnProperty(operators, state.token)) {\n // explicit operators\n name = state.token;\n fn = operators[name];\n getTokenSkipNewline(state);\n last = parseImplicitMultiplication(state);\n node = new OperatorNode(name, fn, [node, last]);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * implicit multiplication\n * @return {Node} node\n * @private\n */\n function parseImplicitMultiplication(state) {\n var node, last;\n node = parseRule2(state);\n last = node;\n while (true) {\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === 'in' && isConstantNode(node) || state.token === 'in' && isOperatorNode(node) && node.fn === 'unaryMinus' && isConstantNode(node.args[0]) || state.tokenType === TOKENTYPE.NUMBER && !isConstantNode(last) && (!isOperatorNode(last) || last.op === '!') || state.token === '(') {\n // parse implicit multiplication\n //\n // symbol: implicit multiplication like '2a', '(2+3)a', 'a b'\n // number: implicit multiplication like '(2+3)2'\n // parenthesis: implicit multiplication like '2(3+4)', '(3+4)(1+2)'\n last = parseRule2(state);\n node = new OperatorNode('*', 'multiply', [node, last], true /* implicit */);\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Infamous \"rule 2\" as described in https://github.com/josdejong/mathjs/issues/792#issuecomment-361065370\n * And as amended in https://github.com/josdejong/mathjs/issues/2370#issuecomment-1054052164\n * Explicit division gets higher precedence than implicit multiplication\n * when the division matches this pattern:\n * [unaryPrefixOp]?[number] / [number] [symbol]\n * @return {Node} node\n * @private\n */\n function parseRule2(state) {\n var node = parseUnaryPercentage(state);\n var last = node;\n var tokenStates = [];\n while (true) {\n // Match the \"number /\" part of the pattern \"number / number symbol\"\n if (state.token === '/' && rule2Node(last)) {\n // Look ahead to see if the next token is a number\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"number / number\" part of the pattern\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // Look ahead again\n tokenStates.push(_extends({}, state));\n getTokenSkipNewline(state);\n\n // Match the \"symbol\" part of the pattern, or a left parenthesis\n if (state.tokenType === TOKENTYPE.SYMBOL || state.token === '(' || state.token === 'in') {\n // We've matched the pattern \"number / number symbol\".\n // Rewind once and build the \"number / number\" node; the symbol will be consumed later\n _extends(state, tokenStates.pop());\n tokenStates.pop();\n last = parseUnaryPercentage(state);\n node = new OperatorNode('/', 'divide', [node, last]);\n } else {\n // Not a match, so rewind\n tokenStates.pop();\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n // Not a match, so rewind\n _extends(state, tokenStates.pop());\n break;\n }\n } else {\n break;\n }\n }\n return node;\n }\n\n /**\n * Unary percentage operator (treated as `value / 100`)\n * @return {Node} node\n * @private\n */\n function parseUnaryPercentage(state) {\n var node = parseUnary(state);\n if (state.token === '%') {\n var previousState = _extends({}, state);\n getTokenSkipNewline(state);\n // We need to decide if this is a unary percentage % or binary modulo %\n // So we attempt to parse a unary expression at this point.\n // If it fails, then the only possibility is that this is a unary percentage.\n // If it succeeds, then we presume that this must be binary modulo, since the\n // only things that parseUnary can handle are _higher_ precedence than unary %.\n try {\n parseUnary(state);\n // Not sure if we could somehow use the result of that parseUnary? Without\n // further analysis/testing, safer just to discard and let the parse proceed\n _extends(state, previousState);\n } catch (_unused) {\n // Not seeing a term at this point, so was a unary %\n node = new OperatorNode('/', 'divide', [node, new ConstantNode(100)], false, true);\n }\n }\n return node;\n }\n\n /**\n * Unary plus and minus, and logical and bitwise not\n * @return {Node} node\n * @private\n */\n function parseUnary(state) {\n var name, params, fn;\n var operators = {\n '-': 'unaryMinus',\n '+': 'unaryPlus',\n '~': 'bitNot',\n not: 'not'\n };\n if (hasOwnProperty(operators, state.token)) {\n fn = operators[state.token];\n name = state.token;\n getTokenSkipNewline(state);\n params = [parseUnary(state)];\n return new OperatorNode(name, fn, params);\n }\n return parsePow(state);\n }\n\n /**\n * power\n * Note: power operator is right associative\n * @return {Node} node\n * @private\n */\n function parsePow(state) {\n var node, name, fn, params;\n node = parseNullishCoalescing(state);\n if (state.token === '^' || state.token === '.^') {\n name = state.token;\n fn = name === '^' ? 'pow' : 'dotPow';\n getTokenSkipNewline(state);\n params = [node, parseUnary(state)]; // Go back to unary, we can have '2^-3'\n node = new OperatorNode(name, fn, params);\n }\n return node;\n }\n\n /**\n * nullish coalescing operator\n * @return {Node} node\n * @private\n */\n function parseNullishCoalescing(state) {\n var node = parseLeftHandOperators(state);\n while (state.token === '??') {\n // eslint-disable-line no-unmodified-loop-condition\n getTokenSkipNewline(state);\n node = new OperatorNode('??', 'nullish', [node, parseLeftHandOperators(state)]);\n }\n return node;\n }\n\n /**\n * Left hand operators: factorial x!, ctranspose x'\n * @return {Node} node\n * @private\n */\n function parseLeftHandOperators(state) {\n var node, name, fn, params;\n node = parseCustomNodes(state);\n var operators = {\n '!': 'factorial',\n '\\'': 'ctranspose'\n };\n while (hasOwnProperty(operators, state.token)) {\n name = state.token;\n fn = operators[name];\n getToken(state);\n params = [node];\n node = new OperatorNode(name, fn, params);\n node = parseAccessors(state, node);\n }\n return node;\n }\n\n /**\n * Parse a custom node handler. A node handler can be used to process\n * nodes in a custom way, for example for handling a plot.\n *\n * A handler must be passed as second argument of the parse function.\n * - must extend math.Node\n * - must contain a function _compile(defs: Object) : string\n * - must contain a function find(filter: Object) : Node[]\n * - must contain a function toString() : string\n * - the constructor is called with a single argument containing all parameters\n *\n * For example:\n *\n * nodes = {\n * 'plot': PlotHandler\n * }\n *\n * The constructor of the handler is called as:\n *\n * node = new PlotHandler(params)\n *\n * The handler will be invoked when evaluating an expression like:\n *\n * node = math.parse('plot(sin(x), x)', nodes)\n *\n * @return {Node} node\n * @private\n */\n function parseCustomNodes(state) {\n var params = [];\n if (state.tokenType === TOKENTYPE.SYMBOL && hasOwnProperty(state.extraNodes, state.token)) {\n var CustomNode = state.extraNodes[state.token];\n getToken(state);\n\n // parse parameters\n if (state.token === '(') {\n params = [];\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n }\n\n // create a new custom node\n // noinspection JSValidateTypes\n return new CustomNode(params);\n }\n return parseSymbol(state);\n }\n\n /**\n * parse symbols: functions, variables, constants, units\n * @return {Node} node\n * @private\n */\n function parseSymbol(state) {\n var node, name;\n if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n name = state.token;\n getToken(state);\n if (hasOwnProperty(CONSTANTS, name)) {\n // true, false, null, ...\n node = new ConstantNode(CONSTANTS[name]);\n } else if (NUMERIC_CONSTANTS.includes(name)) {\n // NaN, Infinity\n node = new ConstantNode(numeric(name, 'number'));\n } else {\n node = new SymbolNode(name);\n }\n\n // parse function parameters and matrix index\n node = parseAccessors(state, node);\n return node;\n }\n return parseString(state);\n }\n\n /**\n * parse accessors:\n * - function invocation in round brackets (...), for example sqrt(2) or sqrt?.(2) with optional chaining\n * - index enclosed in square brackets [...], for example A[2,3] or A?.[2,3] with optional chaining\n * - dot notation for properties, like foo.bar or foo?.bar with optional chaining\n * @param {Object} state\n * @param {Node} node Node on which to apply the parameters. If there\n * are no parameters in the expression, the node\n * itself is returned\n * @param {string[]} [types] Filter the types of notations\n * can be ['(', '[', '.']\n * @return {Node} node\n * @private\n */\n function parseAccessors(state, node, types) {\n var params;\n\n // Iterate and handle chained accessors, including repeated optional chaining\n while (true) {\n // eslint-disable-line no-unmodified-loop-condition\n // Track whether an optional chaining operator precedes the next accessor\n var optional = false;\n\n // Consume an optional chaining operator if present\n if (state.token === '?.') {\n optional = true;\n // consume the '?.' token\n getToken(state);\n }\n var hasNextAccessor = (state.token === '(' || state.token === '[' || state.token === '.') && (!types || types.includes(state.token));\n if (!(optional || hasNextAccessor)) {\n break;\n }\n params = [];\n if (state.token === '(') {\n if (optional || isSymbolNode(node) || isAccessorNode(node)) {\n // function invocation: fn(2, 3) or obj.fn(2, 3) or (anything)?.(2, 3)\n openParams(state);\n getToken(state);\n if (state.token !== ')') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new FunctionNode(node, params, optional);\n } else {\n // implicit multiplication like (2+3)(4+5) or sqrt(2)(1+2)\n // don't parse it here but let it be handled by parseImplicitMultiplication\n // with correct precedence\n return node;\n }\n } else if (state.token === '[') {\n // index notation like variable[2, 3]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n params.push(parseAssignment(state));\n\n // parse a list with parameters\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n params.push(parseAssignment(state));\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'Parenthesis ] expected');\n }\n closeParams(state);\n getToken(state);\n node = new AccessorNode(node, new IndexNode(params), optional);\n } else {\n // dot notation like variable.prop\n // consume the `.` (if it was ?., already consumed):\n if (!optional) getToken(state);\n var isPropertyName = state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS;\n if (!isPropertyName) {\n var message = 'Property name expected after ';\n message += optional ? 'optional chain' : 'dot';\n throw createSyntaxError(state, message);\n }\n params.push(new ConstantNode(state.token));\n getToken(state);\n var dotNotation = true;\n node = new AccessorNode(node, new IndexNode(params, dotNotation), optional);\n }\n }\n return node;\n }\n\n /**\n * Parse a single or double quoted string.\n * @return {Node} node\n * @private\n */\n function parseString(state) {\n var node, str;\n if (state.token === '\"' || state.token === \"'\") {\n str = parseStringToken(state, state.token);\n\n // create constant\n node = new ConstantNode(str);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseMatrix(state);\n }\n\n /**\n * Parse a string surrounded by single or double quotes\n * @param {Object} state\n * @param {\"'\" | \"\\\"\"} quote\n * @return {string}\n */\n function parseStringToken(state, quote) {\n var str = '';\n while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {\n if (currentCharacter(state) === '\\\\') {\n next(state);\n var char = currentCharacter(state);\n var escapeChar = ESCAPE_CHARACTERS[char];\n if (escapeChar !== undefined) {\n // an escaped control character like \\\" or \\n\n str += escapeChar;\n state.index += 1;\n } else if (char === 'u') {\n // escaped unicode character\n var unicode = state.expression.slice(state.index + 1, state.index + 5);\n if (/^[0-9A-Fa-f]{4}$/.test(unicode)) {\n // test whether the string holds four hexadecimal values\n str += String.fromCharCode(parseInt(unicode, 16));\n state.index += 5;\n } else {\n throw createSyntaxError(state, \"Invalid unicode character \\\\u\".concat(unicode));\n }\n } else {\n throw createSyntaxError(state, \"Bad escape character \\\\\".concat(char));\n }\n } else {\n // any regular character\n str += currentCharacter(state);\n next(state);\n }\n }\n getToken(state);\n if (state.token !== quote) {\n throw createSyntaxError(state, \"End of string \".concat(quote, \" expected\"));\n }\n getToken(state);\n return str;\n }\n\n /**\n * parse the matrix\n * @return {Node} node\n * @private\n */\n function parseMatrix(state) {\n var array, params, rows, cols;\n if (state.token === '[') {\n // matrix [...]\n openParams(state);\n getToken(state);\n if (state.token !== ']') {\n // this is a non-empty matrix\n var row = parseRow(state);\n if (state.token === ';') {\n // 2 dimensional array\n rows = 1;\n params = [row];\n\n // the rows of the matrix are separated by dot-comma's\n while (state.token === ';') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n if (state.token !== ']') {\n params[rows] = parseRow(state);\n rows++;\n }\n }\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n\n // check if the number of columns matches in all rows\n cols = params[0].items.length;\n for (var r = 1; r < rows; r++) {\n if (params[r].items.length !== cols) {\n throw createError(state, 'Column dimensions mismatch ' + '(' + params[r].items.length + ' !== ' + cols + ')');\n }\n }\n array = new ArrayNode(params);\n } else {\n // 1 dimensional vector\n if (state.token !== ']') {\n throw createSyntaxError(state, 'End of matrix ] expected');\n }\n closeParams(state);\n getToken(state);\n array = row;\n }\n } else {\n // this is an empty matrix \"[ ]\"\n closeParams(state);\n getToken(state);\n array = new ArrayNode([]);\n }\n return parseAccessors(state, array);\n }\n return parseObject(state);\n }\n\n /**\n * Parse a single comma-separated row from a matrix, like 'a, b, c'\n * @return {ArrayNode} node\n */\n function parseRow(state) {\n var params = [parseAssignment(state)];\n var len = 1;\n while (state.token === ',') {\n // eslint-disable-line no-unmodified-loop-condition\n getToken(state);\n\n // parse expression\n if (state.token !== ']' && state.token !== ';') {\n params[len] = parseAssignment(state);\n len++;\n }\n }\n return new ArrayNode(params);\n }\n\n /**\n * parse an object, enclosed in angle brackets{...}, for example {value: 2}\n * @return {Node} node\n * @private\n */\n function parseObject(state) {\n if (state.token === '{') {\n openParams(state);\n var key;\n var properties = {};\n do {\n getToken(state);\n if (state.token !== '}') {\n // parse key\n if (state.token === '\"' || state.token === \"'\") {\n key = parseStringToken(state, state.token);\n } else if (state.tokenType === TOKENTYPE.SYMBOL || state.tokenType === TOKENTYPE.DELIMITER && state.token in NAMED_DELIMITERS) {\n key = state.token;\n getToken(state);\n } else {\n throw createSyntaxError(state, 'Symbol or string expected as object key');\n }\n\n // parse key/value separator\n if (state.token !== ':') {\n throw createSyntaxError(state, 'Colon : expected after object key');\n }\n getToken(state);\n\n // parse key\n properties[key] = parseAssignment(state);\n }\n } while (state.token === ','); // eslint-disable-line no-unmodified-loop-condition\n\n if (state.token !== '}') {\n throw createSyntaxError(state, 'Comma , or bracket } expected after object value');\n }\n closeParams(state);\n getToken(state);\n var node = new ObjectNode(properties);\n\n // parse index parameters\n node = parseAccessors(state, node);\n return node;\n }\n return parseNumber(state);\n }\n\n /**\n * parse a number\n * @return {Node} node\n * @private\n */\n function parseNumber(state) {\n var numberStr;\n if (state.tokenType === TOKENTYPE.NUMBER) {\n // this is a number\n numberStr = state.token;\n getToken(state);\n var numericType = safeNumberType(numberStr, config);\n var value = numeric(numberStr, numericType);\n return new ConstantNode(value);\n }\n return parseParentheses(state);\n }\n\n /**\n * parentheses\n * @return {Node} node\n * @private\n */\n function parseParentheses(state) {\n var node;\n\n // check if it is a parenthesized expression\n if (state.token === '(') {\n // parentheses (...)\n openParams(state);\n getToken(state);\n node = parseAssignment(state); // start again\n\n if (state.token !== ')') {\n throw createSyntaxError(state, 'Parenthesis ) expected');\n }\n closeParams(state);\n getToken(state);\n node = new ParenthesisNode(node);\n node = parseAccessors(state, node);\n return node;\n }\n return parseEnd(state);\n }\n\n /**\n * Evaluated when the expression is not yet ended but expected to end\n * @return {Node} res\n * @private\n */\n function parseEnd(state) {\n if (state.token === '') {\n // syntax error or unexpected end of expression\n throw createSyntaxError(state, 'Unexpected end of expression');\n } else {\n throw createSyntaxError(state, 'Value expected');\n }\n }\n\n /**\n * Shortcut for getting the current row value (one based)\n * Returns the line of the currently handled expression\n * @private\n */\n /* TODO: implement keeping track on the row number\n function row () {\n return null\n }\n */\n\n /**\n * Shortcut for getting the current col value (one based)\n * Returns the column (position) where the last state.token starts\n * @private\n */\n function col(state) {\n return state.index - state.token.length + 1;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {SyntaxError} instantiated error\n * @private\n */\n function createSyntaxError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n /**\n * Create an error\n * @param {Object} state\n * @param {string} message\n * @return {Error} instantiated error\n * @private\n */\n function createError(state, message) {\n var c = col(state);\n var error = new SyntaxError(message + ' (char ' + c + ')');\n error.char = c;\n return error;\n }\n\n // Now that we can parse, automatically convert strings to Nodes by parsing\n typed.addConversion({\n from: 'string',\n to: 'Node',\n convert: parse\n });\n return parse;\n});","import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'compile';\nvar dependencies = ['typed', 'parse'];\nexport var createCompile = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Parse and compile an expression.\n * Returns a an object with a function `evaluate([scope])` to evaluate the\n * compiled expression.\n *\n * Syntax:\n *\n * math.compile(expr) // returns one node\n * math.compile([expr1, expr2, expr3, ...]) // returns an array with nodes\n *\n * Examples:\n *\n * const code1 = math.compile('sqrt(3^2 + 4^2)')\n * code1.evaluate() // 5\n *\n * let scope = {a: 3, b: 4}\n * const code2 = math.compile('a * b') // 12\n * code2.evaluate(scope) // 12\n * scope.a = 5\n * code2.evaluate(scope) // 20\n *\n * const nodes = math.compile(['a = 3', 'b = 4', 'a * b'])\n * nodes[2].evaluate() // 12\n *\n * See also:\n *\n * parse, evaluate\n *\n * @param {string | string[] | Array | Matrix} expr\n * The expression to be compiled\n * @return {{evaluate: Function} | Array.<{evaluate: Function}>} code\n * An object with the compiled expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n return parse(expr).compile();\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile();\n });\n }\n });\n});","import { deepMap } from '../../utils/collection.js';\nimport { factory } from '../../utils/factory.js';\nimport { createEmptyMap } from '../../utils/map.js';\nvar name = 'evaluate';\nvar dependencies = ['typed', 'parse'];\nexport var createEvaluate = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse\n } = _ref;\n /**\n * Evaluate an expression.\n *\n * The expression parser does not use JavaScript. Its syntax is close\n * to JavaScript but more suited for mathematical expressions.\n * See [https://mathjs.org/docs/expressions/syntax.html](https://mathjs.org/docs/expressions/syntax.html) to learn\n * the syntax and get an overview of the exact differences from JavaScript.\n *\n * Note the evaluating arbitrary expressions may involve security risks,\n * see [https://mathjs.org/docs/expressions/security.html](https://mathjs.org/docs/expressions/security.html) for more information.\n *\n * Syntax:\n *\n * math.evaluate(expr)\n * math.evaluate(expr, scope)\n * math.evaluate([expr1, expr2, expr3, ...])\n * math.evaluate([expr1, expr2, expr3, ...], scope)\n *\n * Example:\n *\n * math.evaluate('(2+3)/4') // 1.25\n * math.evaluate('sqrt(3^2 + 4^2)') // 5\n * math.evaluate('sqrt(-4)') // 2i\n * math.evaluate(['a=3', 'b=4', 'a*b']) // [3, 4, 12]\n *\n * let scope = {a:3, b:4}\n * math.evaluate('a * b', scope) // 12\n *\n * See also:\n *\n * parse, compile\n *\n * @param {string | string[] | Matrix} expr The expression to be evaluated\n * @param {Object} [scope] Scope to read/write variables\n * @return {*} The result of the expression\n * @throws {Error}\n */\n return typed(name, {\n string: function string(expr) {\n var scope = createEmptyMap();\n return parse(expr).compile().evaluate(scope);\n },\n 'string, Map | Object': function string_Map__Object(expr, scope) {\n return parse(expr).compile().evaluate(scope);\n },\n 'Array | Matrix': function Array__Matrix(expr) {\n var scope = createEmptyMap();\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n },\n 'Array | Matrix, Map | Object': function Array__Matrix_Map__Object(expr, scope) {\n return deepMap(expr, function (entry) {\n return parse(entry).compile().evaluate(scope);\n });\n }\n });\n});","import { factory } from '../utils/factory.js';\nimport { isFunction } from '../utils/is.js';\nimport { createEmptyMap, toObject } from '../utils/map.js';\nvar name = 'Parser';\nvar dependencies = ['evaluate', 'parse'];\nexport var createParserClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate,\n parse\n } = _ref;\n /**\n * @constructor Parser\n * Parser contains methods to evaluate or parse expressions, and has a number\n * of convenience methods to get, set, and remove variables from memory. Parser\n * keeps a scope containing variables in memory, which is used for all\n * evaluations.\n *\n * Methods:\n * const result = parser.evaluate(expr) // evaluate an expression\n * const value = parser.get(name) // retrieve a variable from the parser\n * const values = parser.getAll() // retrieve all defined variables\n * parser.set(name, value) // set a variable in the parser\n * parser.remove(name) // clear a variable from the\n * // parsers scope\n * parser.clear() // clear the parsers scope\n *\n * Example usage:\n * const parser = new Parser()\n * // Note: there is a convenience method which can be used instead:\n * // const parser = new math.parser()\n *\n * // evaluate expressions\n * parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * parser.evaluate('sqrt(-4)') // 2i\n * parser.evaluate('2 inch in cm') // 5.08 cm\n * parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n */\n function Parser() {\n if (!(this instanceof Parser)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n Object.defineProperty(this, 'scope', {\n value: createEmptyMap(),\n writable: false\n });\n }\n\n /**\n * Attach type information\n */\n Parser.prototype.type = 'Parser';\n Parser.prototype.isParser = true;\n\n /**\n * Parse and evaluate the given expression\n * @param {string | string[]} expr A string containing an expression,\n * for example \"2+3\", or a list with expressions\n * @return {*} result The result, or undefined when the expression was empty\n * @throws {Error}\n */\n Parser.prototype.evaluate = function (expr) {\n // TODO: validate arguments\n return evaluate(expr, this.scope);\n };\n\n /**\n * Get a variable (a function or variable) by name from the parsers scope.\n * Returns undefined when not found\n * @param {string} name\n * @return {* | undefined} value\n */\n Parser.prototype.get = function (name) {\n // TODO: validate arguments\n if (this.scope.has(name)) {\n return this.scope.get(name);\n }\n };\n\n /**\n * Get a map with all defined variables\n * @return {Object} values\n */\n Parser.prototype.getAll = function () {\n return toObject(this.scope);\n };\n\n /**\n * Get a map with all defined variables\n * @return {Map} values\n */\n Parser.prototype.getAllAsMap = function () {\n return this.scope;\n };\n function isValidVariableName(name) {\n if (name.length === 0) {\n return false;\n }\n for (var i = 0; i < name.length; i++) {\n var cPrev = name.charAt(i - 1);\n var c = name.charAt(i);\n var cNext = name.charAt(i + 1);\n var valid = parse.isAlpha(c, cPrev, cNext) || i > 0 && parse.isDigit(c);\n if (!valid) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Set a symbol (a function or variable) by name from the parsers scope.\n * @param {string} name\n * @param {* | undefined} value\n */\n Parser.prototype.set = function (name, value) {\n if (!isValidVariableName(name)) {\n throw new Error(\"Invalid variable name: '\".concat(name, \"'. Variable names must follow the specified rules.\"));\n }\n this.scope.set(name, value);\n return value;\n };\n\n /**\n * Remove a variable from the parsers scope\n * @param {string} name\n */\n Parser.prototype.remove = function (name) {\n this.scope.delete(name);\n };\n\n /**\n * Clear the scope with variables and functions\n */\n Parser.prototype.clear = function () {\n this.scope.clear();\n };\n Parser.prototype.toJSON = function () {\n var json = {\n mathjs: 'Parser',\n variables: {},\n functions: {}\n };\n for (var [_name2, value] of this.scope) {\n if (isFunction(value)) {\n if (!isExpressionFunction(value)) {\n throw new Error(\"Cannot serialize external function \".concat(_name2));\n }\n json.functions[_name2] = \"\".concat(value.syntax, \" = \").concat(value.expr);\n } else {\n json.variables[_name2] = value;\n }\n }\n return json;\n };\n Parser.fromJSON = function (json) {\n var parser = new Parser();\n Object.entries(json.variables).forEach(_ref2 => {\n var [name, value] = _ref2;\n return parser.set(name, value);\n });\n Object.entries(json.functions).forEach(_ref3 => {\n var [_name, fn] = _ref3;\n return parser.evaluate(fn);\n });\n return parser;\n };\n return Parser;\n}, {\n isClass: true\n});\nfunction isExpressionFunction(value) {\n return typeof value === 'function' && typeof value.syntax === 'string' && typeof value.expr === 'string';\n}","import { factory } from '../../utils/factory.js';\nvar name = 'parser';\nvar dependencies = ['typed', 'Parser'];\nexport var createParser = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Parser\n } = _ref;\n /**\n * Create a `math.Parser` object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.\n *\n * Syntax:\n *\n * math.parser()\n *\n * Examples:\n *\n * const parser = new math.parser()\n *\n * // evaluate expressions\n * const a = parser.evaluate('sqrt(3^2 + 4^2)') // 5\n * const b = parser.evaluate('sqrt(-4)') // 2i\n * const c = parser.evaluate('2 inch in cm') // 5.08 cm\n * const d = parser.evaluate('cos(45 deg)') // 0.7071067811865476\n *\n * // define variables and functions\n * parser.evaluate('x = 7 / 2') // 3.5\n * parser.evaluate('x + 3') // 6.5\n * parser.evaluate('f(x, y) = x^y') // f(x, y)\n * parser.evaluate('f(2, 3)') // 8\n *\n * // get and set variables and functions\n * const x = parser.get('x') // 3.5\n * const f = parser.get('f') // function\n * const g = f(3, 2) // 9\n * parser.set('h', 500)\n * const i = parser.evaluate('h / 2') // 250\n * parser.set('hello', function (name) {\n * return 'hello, ' + name + '!'\n * })\n * parser.evaluate('hello(\"user\")') // \"hello, user!\"\n *\n * // clear defined functions and variables\n * parser.clear()\n *\n * See also:\n *\n * evaluate, compile, parse\n *\n * @return {Parser} Parser\n */\n return typed(name, {\n '': function _() {\n return new Parser();\n }\n });\n});","import { isHelp } from '../utils/is.js';\nimport { clone } from '../utils/object.js';\nimport { format } from '../utils/string.js';\nimport { factory } from '../utils/factory.js';\nvar name = 'Help';\nvar dependencies = ['evaluate'];\nexport var createHelpClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n evaluate\n } = _ref;\n /**\n * Documentation object\n * @param {Object} doc Object containing properties:\n * {string} name\n * {string} category\n * {string} description\n * {string[]} syntax\n * {string[]} examples\n * {string[]} seealso\n * @constructor\n */\n function Help(doc) {\n if (!(this instanceof Help)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (!doc) throw new Error('Argument \"doc\" missing');\n this.doc = doc;\n }\n\n /**\n * Attach type information\n */\n Help.prototype.type = 'Help';\n Help.prototype.isHelp = true;\n\n /**\n * Generate a string representation of the Help object\n * @return {string} Returns a string\n * @private\n */\n Help.prototype.toString = function () {\n var doc = this.doc || {};\n var desc = '\\n';\n if (doc.name) {\n desc += 'Name: ' + doc.name + '\\n\\n';\n }\n if (doc.category) {\n desc += 'Category: ' + doc.category + '\\n\\n';\n }\n if (doc.description) {\n desc += 'Description:\\n ' + doc.description + '\\n\\n';\n }\n if (doc.syntax) {\n desc += 'Syntax:\\n ' + doc.syntax.join('\\n ') + '\\n\\n';\n }\n if (doc.examples) {\n desc += 'Examples:\\n';\n\n // after evaluating the examples, we restore config in case the examples\n // did change the config.\n var configChanged = false;\n var originalConfig = evaluate('config()');\n var scope = {\n config: newConfig => {\n configChanged = true;\n return evaluate('config(newConfig)', {\n newConfig\n });\n }\n };\n for (var i = 0; i < doc.examples.length; i++) {\n var expr = doc.examples[i];\n desc += ' ' + expr + '\\n';\n var res = void 0;\n try {\n // note: res can be undefined when `expr` is an empty string\n res = evaluate(expr, scope);\n } catch (e) {\n res = e;\n }\n if (res !== undefined && !isHelp(res)) {\n desc += ' ' + format(res, {\n precision: 14\n }) + '\\n';\n }\n }\n desc += '\\n';\n if (configChanged) {\n evaluate('config(originalConfig)', {\n originalConfig\n });\n }\n }\n if (doc.mayThrow && doc.mayThrow.length) {\n desc += 'Throws: ' + doc.mayThrow.join(', ') + '\\n\\n';\n }\n if (doc.seealso && doc.seealso.length) {\n desc += 'See also: ' + doc.seealso.join(', ') + '\\n';\n }\n return desc;\n };\n\n /**\n * Export the help object to JSON\n */\n Help.prototype.toJSON = function () {\n var obj = clone(this.doc);\n obj.mathjs = 'Help';\n return obj;\n };\n\n /**\n * Instantiate a Help object from a JSON object\n * @param {Object} json\n * @returns {Help} Returns a new Help object\n */\n Help.fromJSON = function (json) {\n var doc = {};\n Object.keys(json).filter(prop => prop !== 'mathjs').forEach(prop => {\n doc[prop] = json[prop];\n });\n return new Help(doc);\n };\n\n /**\n * Returns a string representation of the Help object\n */\n Help.prototype.valueOf = Help.prototype.toString;\n return Help;\n}, {\n isClass: true\n});","import { isChain } from '../../utils/is.js';\nimport { format } from '../../utils/string.js';\nimport { hasOwnProperty, lazy } from '../../utils/object.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'Chain';\nvar dependencies = ['?on', 'math', 'typed'];\nexport var createChainClass = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n on,\n math,\n typed\n } = _ref;\n /**\n * @constructor Chain\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing chain.done(), which will return\n * the final value.\n *\n * The Chain has a number of special functions:\n * - done() Finalize the chained operation and return the\n * chain's value.\n * - valueOf() The same as done()\n * - toString() Returns a string representation of the chain's value.\n *\n * @param {*} [value]\n */\n function Chain(value) {\n if (!(this instanceof Chain)) {\n throw new SyntaxError('Constructor must be called with the new operator');\n }\n if (isChain(value)) {\n this.value = value.value;\n } else {\n this.value = value;\n }\n }\n\n /**\n * Attach type information\n */\n Chain.prototype.type = 'Chain';\n Chain.prototype.isChain = true;\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method valueOf()\n * @returns {*} value\n */\n Chain.prototype.done = function () {\n return this.value;\n };\n\n /**\n * Close the chain. Returns the final value.\n * Does the same as method done()\n * @returns {*} value\n */\n Chain.prototype.valueOf = function () {\n return this.value;\n };\n\n /**\n * Get a string representation of the value in the chain\n * @returns {string}\n */\n Chain.prototype.toString = function () {\n return format(this.value);\n };\n\n /**\n * Get a JSON representation of the chain\n * @returns {Object}\n */\n Chain.prototype.toJSON = function () {\n return {\n mathjs: 'Chain',\n value: this.value\n };\n };\n\n /**\n * Instantiate a Chain from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"Chain\", value: ...}`,\n * where mathjs is optional\n * @returns {Chain}\n */\n Chain.fromJSON = function (json) {\n return new Chain(json.value);\n };\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {Function} fn The function to be proxied\n * If fn is no function, it is silently ignored.\n * @private\n */\n function createProxy(name, fn) {\n if (typeof fn === 'function') {\n Chain.prototype[name] = chainify(fn);\n }\n }\n\n /**\n * Create a proxy method for the chain\n * @param {string} name\n * @param {function} resolver The function resolving with the\n * function to be proxied\n * @private\n */\n function createLazyProxy(name, resolver) {\n lazy(Chain.prototype, name, function outerResolver() {\n var fn = resolver();\n if (typeof fn === 'function') {\n return chainify(fn);\n }\n return undefined; // if not a function, ignore\n });\n }\n\n /**\n * Make a function chainable\n * @param {function} fn\n * @return {Function} chain function\n * @private\n */\n function chainify(fn) {\n return function () {\n // Here, `this` will be the context of a Chain instance\n if (arguments.length === 0) {\n return new Chain(fn(this.value));\n }\n var args = [this.value];\n for (var i = 0; i < arguments.length; i++) {\n args[i + 1] = arguments[i];\n }\n if (typed.isTypedFunction(fn)) {\n var sigObject = typed.resolve(fn, args);\n // We want to detect if a rest parameter has matched across the\n // value in the chain and the current arguments of this call.\n // That is the case if and only if the matching signature has\n // exactly one parameter (which then must be a rest parameter\n // as it is matching at least two actual arguments).\n if (sigObject.params.length === 1) {\n throw new Error('chain function ' + fn.name + ' cannot match rest parameter between chain value and additional arguments.');\n }\n return new Chain(sigObject.implementation.apply(fn, args));\n }\n return new Chain(fn.apply(fn, args));\n };\n }\n\n /**\n * Create a proxy for a single method, or an object with multiple methods.\n * Example usage:\n *\n * Chain.createProxy('add', function add (x, y) {...})\n * Chain.createProxy({\n * add: function add (x, y) {...},\n * subtract: function subtract (x, y) {...}\n * }\n *\n * @param {string | Object} arg0 A name (string), or an object with\n * functions\n * @param {*} [arg1] A function, when arg0 is a name\n */\n Chain.createProxy = function (arg0, arg1) {\n if (typeof arg0 === 'string') {\n // createProxy(name, value)\n createProxy(arg0, arg1);\n } else {\n var _loop = function _loop(_name) {\n if (hasOwnProperty(arg0, _name) && excludedNames[_name] === undefined) {\n createLazyProxy(_name, () => arg0[_name]);\n }\n };\n // createProxy(values)\n for (var _name in arg0) {\n _loop(_name);\n }\n }\n };\n var excludedNames = {\n expression: true,\n docs: true,\n type: true,\n classes: true,\n json: true,\n error: true,\n isChain: true // conflicts with the property isChain of a Chain instance\n };\n\n // create proxy for everything that is in math.js\n Chain.createProxy(math);\n\n // register on the import event, automatically add a proxy for every imported function.\n if (on) {\n on('import', function (name, resolver, path) {\n if (!path) {\n // an imported function (not a data type or something special)\n createLazyProxy(name, resolver);\n }\n });\n }\n return Chain;\n}, {\n isClass: true\n});","export var eDocs = {\n name: 'e',\n category: 'Constants',\n syntax: ['e'],\n description: 'Euler\\'s number, the base of the natural logarithm. Approximately equal to 2.71828',\n examples: ['e', 'e ^ 2', 'exp(2)', 'log(e)'],\n seealso: ['exp']\n};","export var falseDocs = {\n name: 'false',\n category: 'Constants',\n syntax: ['false'],\n description: 'Boolean value false',\n examples: ['false'],\n seealso: ['true']\n};","export var iDocs = {\n name: 'i',\n category: 'Constants',\n syntax: ['i'],\n description: 'Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.',\n examples: ['i', 'i * i', 'sqrt(-1)'],\n seealso: []\n};","export var InfinityDocs = {\n name: 'Infinity',\n category: 'Constants',\n syntax: ['Infinity'],\n description: 'Infinity, a number which is larger than the maximum number that can be handled by a floating point number.',\n examples: ['Infinity', '1 / 0'],\n seealso: []\n};","export var LN10Docs = {\n name: 'LN10',\n category: 'Constants',\n syntax: ['LN10'],\n description: 'Returns the natural logarithm of 10, approximately equal to 2.302',\n examples: ['LN10', 'log(10)'],\n seealso: []\n};","export var LN2Docs = {\n name: 'LN2',\n category: 'Constants',\n syntax: ['LN2'],\n description: 'Returns the natural logarithm of 2, approximately equal to 0.693',\n examples: ['LN2', 'log(2)'],\n seealso: []\n};","export var LOG10EDocs = {\n name: 'LOG10E',\n category: 'Constants',\n syntax: ['LOG10E'],\n description: 'Returns the base-10 logarithm of E, approximately equal to 0.434',\n examples: ['LOG10E', 'log(e, 10)'],\n seealso: []\n};","export var LOG2EDocs = {\n name: 'LOG2E',\n category: 'Constants',\n syntax: ['LOG2E'],\n description: 'Returns the base-2 logarithm of E, approximately equal to 1.442',\n examples: ['LOG2E', 'log(e, 2)'],\n seealso: []\n};","export var NaNDocs = {\n name: 'NaN',\n category: 'Constants',\n syntax: ['NaN'],\n description: 'Not a number',\n examples: ['NaN', '0 / 0'],\n seealso: []\n};","export var nullDocs = {\n name: 'null',\n category: 'Constants',\n syntax: ['null'],\n description: 'Value null',\n examples: ['null'],\n seealso: ['true', 'false']\n};","export var phiDocs = {\n name: 'phi',\n category: 'Constants',\n syntax: ['phi'],\n description: 'Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...',\n examples: ['phi'],\n seealso: []\n};","export var piDocs = {\n name: 'pi',\n category: 'Constants',\n syntax: ['pi'],\n description: 'The number pi is a mathematical constant that is the ratio of a circle\\'s circumference to its diameter, and is approximately equal to 3.14159',\n examples: ['pi', 'sin(pi/2)'],\n seealso: ['tau']\n};","export var SQRT12Docs = {\n name: 'SQRT1_2',\n category: 'Constants',\n syntax: ['SQRT1_2'],\n description: 'Returns the square root of 1/2, approximately equal to 0.707',\n examples: ['SQRT1_2', 'sqrt(1/2)'],\n seealso: []\n};","export var SQRT2Docs = {\n name: 'SQRT2',\n category: 'Constants',\n syntax: ['SQRT2'],\n description: 'Returns the square root of 2, approximately equal to 1.414',\n examples: ['SQRT2', 'sqrt(2)'],\n seealso: []\n};","export var tauDocs = {\n name: 'tau',\n category: 'Constants',\n syntax: ['tau'],\n description: 'Tau is the ratio constant of a circle\\'s circumference to radius, equal to 2 * pi, approximately 6.2832.',\n examples: ['tau', '2 * pi'],\n seealso: ['pi']\n};","export var trueDocs = {\n name: 'true',\n category: 'Constants',\n syntax: ['true'],\n description: 'Boolean value true',\n examples: ['true'],\n seealso: ['false']\n};","export var versionDocs = {\n name: 'version',\n category: 'Constants',\n syntax: ['version'],\n description: 'A string with the version number of math.js',\n examples: ['version'],\n seealso: []\n};","export var bignumberDocs = {\n name: 'bignumber',\n category: 'Construction',\n syntax: ['bignumber(x)'],\n description: 'Create a big number from a number or string.',\n examples: ['0.1 + 0.2', 'bignumber(0.1) + bignumber(0.2)', 'bignumber(\"7.2\")', 'bignumber(\"7.2e500\")', 'bignumber([0.1, 0.2, 0.3])'],\n seealso: ['boolean', 'bigint', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var bigintDocs = {\n name: 'bigint',\n category: 'Construction',\n syntax: ['bigint(x)'],\n description: 'Create a bigint, an integer with an arbitrary number of digits, from a number or string.',\n examples: ['123123123123123123 # a large number will lose digits', 'bigint(\"123123123123123123\")', 'bignumber([\"1\", \"3\", \"5\"])'],\n seealso: ['boolean', 'bignumber', 'number', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var booleanDocs = {\n name: 'boolean',\n category: 'Construction',\n syntax: ['x', 'boolean(x)'],\n description: 'Convert a string or number into a boolean.',\n examples: ['boolean(0)', 'boolean(1)', 'boolean(3)', 'boolean(\"true\")', 'boolean(\"false\")', 'boolean([1, 0, 1, 1])'],\n seealso: ['bignumber', 'complex', 'index', 'matrix', 'number', 'string', 'unit']\n};","export var complexDocs = {\n name: 'complex',\n category: 'Construction',\n syntax: ['complex()', 'complex(re, im)', 'complex(string)'],\n description: 'Create a complex number.',\n examples: ['complex()', 'complex(2, 3)', 'complex(\"7 - 2i\")'],\n seealso: ['bignumber', 'boolean', 'index', 'matrix', 'number', 'string', 'unit']\n};","export var createUnitDocs = {\n name: 'createUnit',\n category: 'Construction',\n syntax: ['createUnit(definitions)', 'createUnit(name, definition)'],\n description: 'Create a user-defined unit and register it with the Unit type.',\n examples: ['createUnit(\"foo\")', 'createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})', 'createUnit(\"mph\", \"1 mile/hour\")'],\n seealso: ['unit', 'splitUnit']\n};","export var fractionDocs = {\n name: 'fraction',\n category: 'Construction',\n syntax: ['fraction(num)', 'fraction(matrix)', 'fraction(num,den)', 'fraction({n: num, d: den})'],\n description: 'Create a fraction from a number or from integer numerator and denominator.',\n examples: ['fraction(0.125)', 'fraction(1, 3) + fraction(2, 5)', 'fraction({n: 333, d: 53})', 'fraction([sqrt(9), sqrt(10), sqrt(11)])'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'string', 'unit']\n};","export var indexDocs = {\n name: 'index',\n category: 'Construction',\n syntax: ['[start]', '[start:end]', '[start:step:end]', '[start1, start 2, ...]', '[start1:end1, start2:end2, ...]', '[start1:step1:end1, start2:step2:end2, ...]'],\n description: 'Create an index to get or replace a subset of a matrix',\n examples: ['A = [1, 2, 3; 4, 5, 6]', 'A[1, :]', 'A[1, 2] = 50', 'A[1:2, 1:2] = 1', 'B = [1, 2, 3]', 'B[B>1 and B<3]'],\n seealso: ['bignumber', 'boolean', 'complex', 'matrix', 'number', 'range', 'string', 'unit']\n};","export var matrixDocs = {\n name: 'matrix',\n category: 'Construction',\n syntax: ['[]', '[a1, b1, ...; a2, b2, ...]', 'matrix()', 'matrix(\"dense\")', 'matrix([...])'],\n description: 'Create a matrix.',\n examples: ['[]', '[1, 2, 3]', '[1, 2, 3; 4, 5, 6]', 'matrix()', 'matrix([3, 4])', 'matrix([3, 4; 5, 6], \"sparse\")', 'matrix([3, 4; 5, 6], \"sparse\", \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'sparse']\n};","export var numberDocs = {\n name: 'number',\n category: 'Construction',\n syntax: ['x', 'number(x)', 'number(unit, valuelessUnit)'],\n description: 'Create a number or convert a string or boolean into a number.',\n examples: ['2', '2e3', '4.05', 'number(2)', 'number(\"7.2\")', 'number(true)', 'number([true, false, true, true])', 'number(unit(\"52cm\"), \"m\")'],\n seealso: ['bignumber', 'bigint', 'boolean', 'complex', 'fraction', 'index', 'matrix', 'string', 'unit']\n};","export var sparseDocs = {\n name: 'sparse',\n category: 'Construction',\n syntax: ['sparse()', 'sparse([a1, b1, ...; a1, b2, ...])', 'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],\n description: 'Create a sparse matrix.',\n examples: ['sparse()', 'sparse([3, 4; 5, 6])', 'sparse([3, 0; 5, 0], \"number\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'number', 'string', 'unit', 'matrix']\n};","export var splitUnitDocs = {\n name: 'splitUnit',\n category: 'Construction',\n syntax: ['splitUnit(unit: Unit, parts: Unit[])'],\n description: 'Split a unit in an array of units whose sum is equal to the original unit.',\n examples: ['splitUnit(1 m, [\"feet\", \"inch\"])'],\n seealso: ['unit', 'createUnit']\n};","export var stringDocs = {\n name: 'string',\n category: 'Construction',\n syntax: ['\"text\"', 'string(x)'],\n description: 'Create a string or convert a value to a string',\n examples: ['\"Hello World!\"', 'string(4.2)', 'string(3 + 2i)'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'unit']\n};","export var unitDocs = {\n name: 'unit',\n category: 'Construction',\n syntax: ['value unit', 'unit(value, unit)', 'unit(string)'],\n description: 'Create a unit.',\n examples: ['5.5 mm', '3 inch', 'unit(7.1, \"kilogram\")', 'unit(\"23 deg\")'],\n seealso: ['bignumber', 'boolean', 'complex', 'index', 'matrix', 'number', 'string']\n};","export var configDocs = {\n name: 'config',\n category: 'Core',\n syntax: ['config()', 'config(options)'],\n description: 'Get configuration or change configuration.',\n examples: ['config()', '1/3 + 1/4', 'config({number: \"Fraction\"})', '1/3 + 1/4'],\n seealso: []\n};","export var importDocs = {\n name: 'import',\n category: 'Core',\n syntax: ['import(functions)', 'import(functions, options)'],\n description: 'Import functions or constants from an object.',\n examples: ['import({myFn: f(x)=x^2, myConstant: 32 })', 'myFn(2)', 'myConstant'],\n seealso: []\n};","export var typedDocs = {\n name: 'typed',\n category: 'Core',\n syntax: ['typed(signatures)', 'typed(name, signatures)'],\n description: 'Create a typed function.',\n examples: ['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })', 'double(2)', 'double(\"hello\")'],\n seealso: []\n};","export var derivativeDocs = {\n name: 'derivative',\n category: 'Algebra',\n syntax: ['derivative(expr, variable)', 'derivative(expr, variable, {simplify: boolean})'],\n description: 'Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.',\n examples: ['derivative(\"2x^3\", \"x\")', 'derivative(\"2x^3\", \"x\", {simplify: false})', 'derivative(\"2x^2 + 3x + 4\", \"x\")', 'derivative(\"sin(2x)\", \"x\")', 'f = parse(\"x^2 + x\")', 'x = parse(\"x\")', 'df = derivative(f, x)', 'df.evaluate({x: 3})'],\n seealso: ['simplify', 'parse', 'evaluate']\n};","export var leafCountDocs = {\n name: 'leafCount',\n category: 'Algebra',\n syntax: ['leafCount(expr)'],\n description: 'Computes the number of leaves in the parse tree of the given expression',\n examples: ['leafCount(\"e^(i*pi)-1\")', 'leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],\n seealso: ['simplify']\n};","export var lsolveDocs = {\n name: 'lsolve',\n category: 'Algebra',\n syntax: ['x=lsolve(L, b)'],\n description: 'Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolveAll', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};","export var lsolveAllDocs = {\n name: 'lsolveAll',\n category: 'Algebra',\n syntax: ['x=lsolveAll(L, b)'],\n description: 'Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lsolve(a, b)'],\n seealso: ['lsolve', 'lup', 'lusolve', 'usolve', 'matrix', 'sparse']\n};","export var lupDocs = {\n name: 'lup',\n category: 'Algebra',\n syntax: ['lup(m)'],\n description: 'Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U',\n examples: ['lup([[2, 1], [1, 4]])', 'lup(matrix([[2, 1], [1, 4]]))', 'lup(sparse([[2, 1], [1, 4]]))'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'slu', 'qr']\n};","export var lusolveDocs = {\n name: 'lusolve',\n category: 'Algebra',\n syntax: ['x=lusolve(A, b)', 'x=lusolve(lu, b)'],\n description: 'Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.',\n examples: ['a = [-2, 3; 2, 1]', 'b = [11, 9]', 'x = lusolve(a, b)'],\n seealso: ['lup', 'slu', 'lsolve', 'usolve', 'matrix', 'sparse']\n};","export var polynomialRootDocs = {\n name: 'polynomialRoot',\n category: 'Algebra',\n syntax: ['x=polynomialRoot(-6, 3)', 'x=polynomialRoot(4, -4, 1)', 'x=polynomialRoot(-8, 12, -6, 1)'],\n description: 'Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.',\n examples: ['a = polynomialRoot(-6, 11, -6, 1)'],\n seealso: ['cbrt', 'sqrt']\n};","export var qrDocs = {\n name: 'qr',\n category: 'Algebra',\n syntax: ['qr(A)'],\n description: 'Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.',\n examples: ['qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])'],\n seealso: ['lup', 'slu', 'matrix']\n};","export var rationalizeDocs = {\n name: 'rationalize',\n category: 'Algebra',\n syntax: ['rationalize(expr)', 'rationalize(expr, scope)', 'rationalize(expr, scope, detailed)'],\n description: 'Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.',\n examples: ['rationalize(\"2x/y - y/(x+1)\")', 'rationalize(\"2x/y - y/(x+1)\", true)'],\n seealso: ['simplify']\n};","export var resolveDocs = {\n name: 'resolve',\n category: 'Algebra',\n syntax: ['resolve(node, scope)'],\n description: 'Recursively substitute variables in an expression tree.',\n examples: ['resolve(parse(\"1 + x\"), { x: 7 })', 'resolve(parse(\"size(text)\"), { text: \"Hello World\" })', 'resolve(parse(\"x + y\"), { x: parse(\"3z\") })', 'resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],\n seealso: ['simplify', 'evaluate'],\n mayThrow: ['ReferenceError']\n};","export var simplifyDocs = {\n name: 'simplify',\n category: 'Algebra',\n syntax: ['simplify(expr)', 'simplify(expr, rules)'],\n description: 'Simplify an expression tree.',\n examples: ['simplify(\"3 + 2 / 4\")', 'simplify(\"2x + x\")', 'f = parse(\"x * (x + 2 + x)\")', 'simplified = simplify(f)', 'simplified.evaluate({x: 2})'],\n seealso: ['simplifyCore', 'derivative', 'evaluate', 'parse', 'rationalize', 'resolve']\n};","export var simplifyConstantDocs = {\n name: 'simplifyConstant',\n category: 'Algebra',\n syntax: ['simplifyConstant(expr)', 'simplifyConstant(expr, options)'],\n description: 'Replace constant subexpressions of node with their values.',\n examples: ['simplifyConstant(\"(3-3)*x\")', 'simplifyConstant(parse(\"z-cos(tau/8)\"))'],\n seealso: ['simplify', 'simplifyCore', 'evaluate']\n};","export var simplifyCoreDocs = {\n name: 'simplifyCore',\n category: 'Algebra',\n syntax: ['simplifyCore(node)'],\n description: 'Perform simple one-pass simplifications on an expression tree.',\n examples: ['simplifyCore(parse(\"0*x\"))', 'simplifyCore(parse(\"(x+0)*2\"))'],\n seealso: ['simplify', 'simplifyConstant', 'evaluate']\n};","export var sluDocs = {\n name: 'slu',\n category: 'Algebra',\n syntax: ['slu(A, order, threshold)'],\n description: 'Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U',\n examples: ['slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)'],\n seealso: ['lusolve', 'lsolve', 'usolve', 'matrix', 'sparse', 'lup', 'qr']\n};","export var symbolicEqualDocs = {\n name: 'symbolicEqual',\n category: 'Algebra',\n syntax: ['symbolicEqual(expr1, expr2)', 'symbolicEqual(expr1, expr2, options)'],\n description: 'Returns true if the difference of the expressions simplifies to 0',\n examples: ['symbolicEqual(\"x*y\",\"y*x\")', 'symbolicEqual(\"abs(x^2)\", \"x^2\")', 'symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],\n seealso: ['simplify', 'evaluate']\n};","export var usolveDocs = {\n name: 'usolve',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolveAll', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};","export var usolveAllDocs = {\n name: 'usolveAll',\n category: 'Algebra',\n syntax: ['x=usolve(U, b)'],\n description: 'Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.',\n examples: ['x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])'],\n seealso: ['usolve', 'lup', 'lusolve', 'lsolve', 'matrix', 'sparse']\n};","export var absDocs = {\n name: 'abs',\n category: 'Arithmetic',\n syntax: ['abs(x)'],\n description: 'Compute the absolute value.',\n examples: ['abs(3.5)', 'abs(-4.2)'],\n seealso: ['sign']\n};","export var addDocs = {\n name: 'add',\n category: 'Operators',\n syntax: ['x + y', 'add(x, y)'],\n description: 'Add two values.',\n examples: ['a = 2.1 + 3.6', 'a - 3.6', '3 + 2i', '3 cm + 2 inch', '\"2.3\" + \"4\"'],\n seealso: ['subtract']\n};","export var cbrtDocs = {\n name: 'cbrt',\n category: 'Arithmetic',\n syntax: ['cbrt(x)', 'cbrt(x, allRoots)'],\n description: 'Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned',\n examples: ['cbrt(64)', 'cube(4)', 'cbrt(-8)', 'cbrt(2 + 3i)', 'cbrt(8i)', 'cbrt(8i, true)', 'cbrt(27 m^3)'],\n seealso: ['square', 'sqrt', 'cube', 'multiply']\n};","export var ceilDocs = {\n name: 'ceil',\n category: 'Arithmetic',\n syntax: ['ceil(x)', 'ceil(x, n)', 'ceil(unit, valuelessUnit)', 'ceil(unit, n, valuelessUnit)'],\n description: 'Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.',\n examples: ['ceil(3.2)', 'ceil(3.8)', 'ceil(-4.2)', 'ceil(3.241cm, cm)', 'ceil(3.241cm, 2, cm)'],\n seealso: ['floor', 'fix', 'round']\n};","export var cubeDocs = {\n name: 'cube',\n category: 'Arithmetic',\n syntax: ['cube(x)'],\n description: 'Compute the cube of a value. The cube of x is x * x * x.',\n examples: ['cube(2)', '2^3', '2 * 2 * 2'],\n seealso: ['multiply', 'square', 'pow']\n};","export var divideDocs = {\n name: 'divide',\n category: 'Operators',\n syntax: ['x / y', 'divide(x, y)'],\n description: 'Divide two values.',\n examples: ['a = 2 / 3', 'a * 3', '4.5 / 2', '3 + 4 / 2', '(3 + 4) / 2', '18 km / 4.5'],\n seealso: ['multiply']\n};","export var dotDivideDocs = {\n name: 'dotDivide',\n category: 'Operators',\n syntax: ['x ./ y', 'dotDivide(x, y)'],\n description: 'Divide two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a ./ b'],\n seealso: ['multiply', 'dotMultiply', 'divide']\n};","export var dotMultiplyDocs = {\n name: 'dotMultiply',\n category: 'Operators',\n syntax: ['x .* y', 'dotMultiply(x, y)'],\n description: 'Multiply two values element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'b = [2, 1, 1; 3, 2, 5]', 'a .* b'],\n seealso: ['multiply', 'divide', 'dotDivide']\n};","export var dotPowDocs = {\n name: 'dotPow',\n category: 'Operators',\n syntax: ['x .^ y', 'dotPow(x, y)'],\n description: 'Calculates the power of x to y element wise.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a .^ 2'],\n seealso: ['pow']\n};","export var expDocs = {\n name: 'exp',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Calculate the exponent of a value.',\n examples: ['exp(1.3)', 'e ^ 1.3', 'log(exp(1.3))', 'x = 2.4', '(exp(i*x) == cos(x) + i*sin(x)) # Euler\\'s formula'],\n seealso: ['expm', 'expm1', 'pow', 'log']\n};","export var expmDocs = {\n name: 'expm',\n category: 'Arithmetic',\n syntax: ['exp(x)'],\n description: 'Compute the matrix exponential, expm(A) = e^A. ' + 'The matrix must be square. ' + 'Not to be confused with exp(a), which performs element-wise exponentiation.',\n examples: ['expm([[0,2],[0,0]])'],\n seealso: ['exp']\n};","export var expm1Docs = {\n name: 'expm1',\n category: 'Arithmetic',\n syntax: ['expm1(x)'],\n description: 'Calculate the value of subtracting 1 from the exponential value.',\n examples: ['expm1(2)', 'pow(e, 2) - 1', 'log(expm1(2) + 1)'],\n seealso: ['exp', 'pow', 'log']\n};","export var fixDocs = {\n name: 'fix',\n category: 'Arithmetic',\n syntax: ['fix(x)', 'fix(x, n)', 'fix(unit, valuelessUnit)', 'fix(unit, n, valuelessUnit)'],\n description: 'Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.',\n examples: ['fix(3.2)', 'fix(3.8)', 'fix(-4.2)', 'fix(-4.8)', 'fix(3.241cm, cm)', 'fix(3.241cm, 2, cm)'],\n seealso: ['ceil', 'floor', 'round']\n};","export var floorDocs = {\n name: 'floor',\n category: 'Arithmetic',\n syntax: ['floor(x)', 'floor(x, n)', 'floor(unit, valuelessUnit)', 'floor(unit, n, valuelessUnit)'],\n description: 'Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.',\n examples: ['floor(3.2)', 'floor(3.8)', 'floor(-4.2)', 'floor(3.241cm, cm)', 'floor(3.241cm, 2, cm)'],\n seealso: ['ceil', 'fix', 'round']\n};","export var gcdDocs = {\n name: 'gcd',\n category: 'Arithmetic',\n syntax: ['gcd(a, b)', 'gcd(a, b, c, ...)'],\n description: 'Compute the greatest common divisor.',\n examples: ['gcd(8, 12)', 'gcd(-4, 6)', 'gcd(25, 15, -10)'],\n seealso: ['lcm', 'xgcd']\n};","export var hypotDocs = {\n name: 'hypot',\n category: 'Arithmetic',\n syntax: ['hypot(a, b, c, ...)', 'hypot([a, b, c, ...])'],\n description: 'Calculate the hypotenuse of a list with values.',\n examples: ['hypot(3, 4)', 'sqrt(3^2 + 4^2)', 'hypot(-2)', 'hypot([3, 4, 5])'],\n seealso: ['abs', 'norm']\n};","export var invmodDocs = {\n name: 'invmod',\n category: 'Arithmetic',\n syntax: ['invmod(a, b)'],\n description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)',\n examples: ['invmod(8, 12)', 'invmod(7, 13)', 'invmod(15151, 15122)'],\n seealso: ['gcd', 'xgcd']\n};","export var lcmDocs = {\n name: 'lcm',\n category: 'Arithmetic',\n syntax: ['lcm(x, y)'],\n description: 'Compute the least common multiple.',\n examples: ['lcm(4, 6)', 'lcm(6, 21)', 'lcm(6, 21, 5)'],\n seealso: ['gcd']\n};","export var logDocs = {\n name: 'log',\n category: 'Arithmetic',\n syntax: ['log(x)', 'log(x, base)'],\n description: 'Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).',\n examples: ['log(3.5)', 'a = log(2.4)', 'exp(a)', '10 ^ 4', 'log(10000, 10)', 'log(10000) / log(10)', 'b = log(1024, 2)', '2 ^ b'],\n seealso: ['exp', 'log1p', 'log2', 'log10']\n};","export var log10Docs = {\n name: 'log10',\n category: 'Arithmetic',\n syntax: ['log10(x)'],\n description: 'Compute the 10-base logarithm of a value.',\n examples: ['log10(0.00001)', 'log10(10000)', '10 ^ 4', 'log(10000) / log(10)', 'log(10000, 10)'],\n seealso: ['exp', 'log']\n};","export var log1pDocs = {\n name: 'log1p',\n category: 'Arithmetic',\n syntax: ['log1p(x)', 'log1p(x, base)'],\n description: 'Calculate the logarithm of a `value+1`',\n examples: ['log1p(2.5)', 'exp(log1p(1.4))', 'pow(10, 4)', 'log1p(9999, 10)', 'log1p(9999) / log(10)'],\n seealso: ['exp', 'log', 'log2', 'log10']\n};","export var log2Docs = {\n name: 'log2',\n category: 'Arithmetic',\n syntax: ['log2(x)'],\n description: 'Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.',\n examples: ['log2(0.03125)', 'log2(16)', 'log2(16) / log2(2)', 'pow(2, 4)'],\n seealso: ['exp', 'log1p', 'log', 'log10']\n};","export var modDocs = {\n name: 'mod',\n category: 'Operators',\n syntax: ['x % y', 'x mod y', 'mod(x, y)'],\n description: 'Calculates the modulus, the remainder of an integer division.',\n examples: ['7 % 3', '11 % 2', '10 mod 4', 'isOdd(x) = x % 2', 'isOdd(2)', 'isOdd(3)'],\n seealso: ['divide']\n};","export var multiplyDocs = {\n name: 'multiply',\n category: 'Operators',\n syntax: ['x * y', 'multiply(x, y)'],\n description: 'multiply two values.',\n examples: ['a = 2.1 * 3.4', 'a / 3.4', '2 * 3 + 4', '2 * (3 + 4)', '3 * 2.1 km'],\n seealso: ['divide']\n};","export var normDocs = {\n name: 'norm',\n category: 'Arithmetic',\n syntax: ['norm(x)', 'norm(x, p)'],\n description: 'Calculate the norm of a number, vector or matrix.',\n examples: ['abs(-3.5)', 'norm(-3.5)', 'norm(3 - 4i)', 'norm([1, 2, -3], Infinity)', 'norm([1, 2, -3], -Infinity)', 'norm([3, 4], 2)', 'norm([[1, 2], [3, 4]], 1)', 'norm([[1, 2], [3, 4]], \"inf\")', 'norm([[1, 2], [3, 4]], \"fro\")']\n};","export var nthRootDocs = {\n name: 'nthRoot',\n category: 'Arithmetic',\n syntax: ['nthRoot(a)', 'nthRoot(a, root)'],\n description: 'Calculate the nth root of a value. ' + 'The principal nth root of a positive real number A, ' + 'is the positive real solution of the equation \"x^root = A\".',\n examples: ['4 ^ 3', 'nthRoot(64, 3)', 'nthRoot(9, 2)', 'sqrt(9)'],\n seealso: ['nthRoots', 'pow', 'sqrt']\n};","export var nthRootsDocs = {\n name: 'nthRoots',\n category: 'Arithmetic',\n syntax: ['nthRoots(A)', 'nthRoots(A, root)'],\n description: '' + 'Calculate the nth roots of a value. ' + 'An nth root of a positive real number A, ' + 'is a positive real solution of the equation \"x^root = A\". ' + 'This function returns an array of complex values.',\n examples: ['nthRoots(1)', 'nthRoots(1, 3)'],\n seealso: ['sqrt', 'pow', 'nthRoot']\n};","export var powDocs = {\n name: 'pow',\n category: 'Operators',\n syntax: ['x ^ y', 'pow(x, y)'],\n description: 'Calculates the power of x to y, x^y.',\n examples: ['2^3', '2*2*2', '1 + e ^ (pi * i)', 'pow([[1, 2], [4, 3]], 2)', 'pow([[1, 2], [4, 3]], -1)'],\n seealso: ['multiply', 'nthRoot', 'nthRoots', 'sqrt']\n};","export var roundDocs = {\n name: 'round',\n category: 'Arithmetic',\n syntax: ['round(x)', 'round(x, n)', 'round(unit, valuelessUnit)', 'round(unit, n, valuelessUnit)'],\n description: 'round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.',\n examples: ['round(3.2)', 'round(3.8)', 'round(-4.2)', 'round(-4.8)', 'round(pi, 3)', 'round(123.45678, 2)', 'round(3.241cm, 2, cm)', 'round([3.2, 3.8, -4.7])'],\n seealso: ['ceil', 'floor', 'fix']\n};","export var signDocs = {\n name: 'sign',\n category: 'Arithmetic',\n syntax: ['sign(x)'],\n description: 'Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.',\n examples: ['sign(3.5)', 'sign(-4.2)', 'sign(0)'],\n seealso: ['abs']\n};","export var sqrtDocs = {\n name: 'sqrt',\n category: 'Arithmetic',\n syntax: ['sqrt(x)'],\n description: 'Compute the square root value. If x = y * y, then y is the square root of x.',\n examples: ['sqrt(25)', '5 * 5', 'sqrt(-1)'],\n seealso: ['square', 'sqrtm', 'multiply', 'nthRoot', 'nthRoots', 'pow']\n};","export var sqrtmDocs = {\n name: 'sqrtm',\n category: 'Arithmetic',\n syntax: ['sqrtm(x)'],\n description: 'Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.',\n examples: ['sqrtm([[33, 24], [48, 57]])'],\n seealso: ['sqrt', 'abs', 'square', 'multiply']\n};","export var sylvesterDocs = {\n name: 'sylvester',\n category: 'Algebra',\n syntax: ['sylvester(A,B,C)'],\n description: 'Solves the real-valued Sylvester equation AX+XB=C for X',\n examples: ['sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])', 'A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]', 'sylvester(A, B, C)'],\n seealso: ['schur', 'lyap']\n};","export var schurDocs = {\n name: 'schur',\n category: 'Algebra',\n syntax: ['schur(A)'],\n description: 'Performs a real Schur decomposition of the real matrix A = UTU\\'',\n examples: ['schur([[1, 0], [-4, 3]])', 'A = [[1, 0], [-4, 3]]', 'schur(A)'],\n seealso: ['lyap', 'sylvester']\n};","export var lyapDocs = {\n name: 'lyap',\n category: 'Algebra',\n syntax: ['lyap(A,Q)'],\n description: 'Solves the Continuous-time Lyapunov equation AP+PA\\'+Q=0 for P',\n examples: ['lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])', 'A = [[-2, 0], [1, -4]]', 'Q = [[3, 1], [1, 3]]', 'lyap(A,Q)'],\n seealso: ['schur', 'sylvester']\n};","export var squareDocs = {\n name: 'square',\n category: 'Arithmetic',\n syntax: ['square(x)'],\n description: 'Compute the square of a value. The square of x is x * x.',\n examples: ['square(3)', 'sqrt(9)', '3^2', '3 * 3'],\n seealso: ['multiply', 'pow', 'sqrt', 'cube']\n};","export var subtractDocs = {\n name: 'subtract',\n category: 'Operators',\n syntax: ['x - y', 'subtract(x, y)'],\n description: 'subtract two values.',\n examples: ['a = 5.3 - 2', 'a + 2', '2/3 - 1/6', '2 * 3 - 3', '2.1 km - 500m'],\n seealso: ['add']\n};","export var unaryMinusDocs = {\n name: 'unaryMinus',\n category: 'Operators',\n syntax: ['-x', 'unaryMinus(x)'],\n description: 'Inverse the sign of a value. Converts booleans and strings to numbers.',\n examples: ['-4.5', '-(-5.6)', '-\"22\"'],\n seealso: ['add', 'subtract', 'unaryPlus']\n};","export var unaryPlusDocs = {\n name: 'unaryPlus',\n category: 'Operators',\n syntax: ['+x', 'unaryPlus(x)'],\n description: 'Converts booleans and strings to numbers.',\n examples: ['+true', '+\"2\"'],\n seealso: ['add', 'subtract', 'unaryMinus']\n};","export var xgcdDocs = {\n name: 'xgcd',\n category: 'Arithmetic',\n syntax: ['xgcd(a, b)'],\n description: 'Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.',\n examples: ['xgcd(8, 12)', 'gcd(8, 12)', 'xgcd(36163, 21199)'],\n seealso: ['gcd', 'lcm']\n};","export var numDocs = {\n name: 'num',\n category: 'Fraction',\n syntax: ['num(x)'],\n description: 'Get the numerator of a fraction.',\n examples: ['num(fraction(2, 3))', 'num(fraction(5, 8))'],\n seealso: ['den', 'fraction']\n};","export var denDocs = {\n name: 'den',\n category: 'Fraction',\n syntax: ['den(x)'],\n description: 'Get the denominator of a fraction.',\n examples: ['den(fraction(2, 3))', 'den(fraction(5, 8))'],\n seealso: ['num', 'fraction']\n};","export var bitAndDocs = {\n name: 'bitAnd',\n category: 'Bitwise',\n syntax: ['x & y', 'bitAnd(x, y)'],\n description: 'Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0',\n examples: ['5 & 3', 'bitAnd(53, 131)', '[1, 12, 31] & 42'],\n seealso: ['bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitNotDocs = {\n name: 'bitNot',\n category: 'Bitwise',\n syntax: ['~x', 'bitNot(x)'],\n description: 'Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.',\n examples: ['~1', '~2', 'bitNot([2, -3, 4])'],\n seealso: ['bitAnd', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitOrDocs = {\n name: 'bitOr',\n category: 'Bitwise',\n syntax: ['x | y', 'bitOr(x, y)'],\n description: 'Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.',\n examples: ['5 | 3', 'bitOr([1, 2, 3], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitXor', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var bitXorDocs = {\n name: 'bitXor',\n category: 'Bitwise',\n syntax: ['bitXor(x, y)'],\n description: 'Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.',\n examples: ['bitOr(1, 2)', 'bitXor([2, 3, 4], 4)'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'leftShift', 'rightArithShift', 'rightLogShift']\n};","export var leftShiftDocs = {\n name: 'leftShift',\n category: 'Bitwise',\n syntax: ['x << y', 'leftShift(x, y)'],\n description: 'Bitwise left logical shift of a value x by y number of bits.',\n examples: ['4 << 1', '8 >> 1'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'rightArithShift', 'rightLogShift']\n};","export var rightArithShiftDocs = {\n name: 'rightArithShift',\n category: 'Bitwise',\n syntax: ['x >> y', 'rightArithShift(x, y)'],\n description: 'Bitwise right arithmetic shift of a value x by y number of bits.',\n examples: ['8 >> 1', '4 << 1', '-12 >> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightLogShift']\n};","export var rightLogShiftDocs = {\n name: 'rightLogShift',\n category: 'Bitwise',\n syntax: ['x >>> y', 'rightLogShift(x, y)'],\n description: 'Bitwise right logical shift of a value x by y number of bits.',\n examples: ['8 >>> 1', '4 << 1', '-12 >>> 2'],\n seealso: ['bitAnd', 'bitNot', 'bitOr', 'bitXor', 'leftShift', 'rightArithShift']\n};","export var bellNumbersDocs = {\n name: 'bellNumbers',\n category: 'Combinatorics',\n syntax: ['bellNumbers(n)'],\n description: 'The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['bellNumbers(3)', 'bellNumbers(8)'],\n seealso: ['stirlingS2']\n};","export var catalanDocs = {\n name: 'catalan',\n category: 'Combinatorics',\n syntax: ['catalan(n)'],\n description: 'The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.',\n examples: ['catalan(3)', 'catalan(8)'],\n seealso: ['bellNumbers']\n};","export var compositionDocs = {\n name: 'composition',\n category: 'Combinatorics',\n syntax: ['composition(n, k)'],\n description: 'The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.',\n examples: ['composition(5, 3)'],\n seealso: ['combinations']\n};","export var stirlingS2Docs = {\n name: 'stirlingS2',\n category: 'Combinatorics',\n syntax: ['stirlingS2(n, k)'],\n description: 'The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.',\n examples: ['stirlingS2(5, 3)'],\n seealso: ['bellNumbers', 'bernoulli']\n};","export var argDocs = {\n name: 'arg',\n category: 'Complex',\n syntax: ['arg(x)'],\n description: 'Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).',\n examples: ['arg(2 + 2i)', 'atan2(3, 2)', 'arg(2 + 3i)'],\n seealso: ['re', 'im', 'conj', 'abs']\n};","export var conjDocs = {\n name: 'conj',\n category: 'Complex',\n syntax: ['conj(x)'],\n description: 'Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.',\n examples: ['conj(2 + 3i)', 'conj(2 - 3i)', 'conj(-5.2i)'],\n seealso: ['re', 'im', 'abs', 'arg']\n};","export var imDocs = {\n name: 'im',\n category: 'Complex',\n syntax: ['im(x)'],\n description: 'Get the imaginary part of a complex number.',\n examples: ['im(2 + 3i)', 're(2 + 3i)', 'im(-5.2i)', 'im(2.4)'],\n seealso: ['re', 'conj', 'abs', 'arg']\n};","export var reDocs = {\n name: 're',\n category: 'Complex',\n syntax: ['re(x)'],\n description: 'Get the real part of a complex number.',\n examples: ['re(2 + 3i)', 'im(2 + 3i)', 're(-5.2i)', 're(2.4)'],\n seealso: ['im', 'conj', 'abs', 'arg']\n};","export var evaluateDocs = {\n name: 'evaluate',\n category: 'Expression',\n syntax: ['evaluate(expression)', 'evaluate(expression, scope)', 'evaluate([expr1, expr2, expr3, ...])', 'evaluate([expr1, expr2, expr3, ...], scope)'],\n description: 'Evaluate an expression or an array with expressions.',\n examples: ['evaluate(\"2 + 3\")', 'evaluate(\"sqrt(16)\")', 'evaluate(\"2 inch to cm\")', 'evaluate(\"sin(x * pi)\", { \"x\": 1/2 })', 'evaluate([\"width=2\", \"height=4\",\"width*height\"])'],\n seealso: ['parser', 'parse', 'compile']\n};","export var parserDocs = {\n name: 'parser',\n category: 'Expression',\n syntax: ['parser()'],\n description: 'Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.',\n examples: ['myParser = parser()', 'myParser.evaluate(\"sqrt(3^2 + 4^2)\")', 'myParser.set(\"x\", 3)', 'myParser.evaluate(\"y = x + 3\")', 'myParser.evaluate([\"y = x + 3\", \"y = y + 1\"])', 'myParser.get(\"y\")'],\n seealso: ['evaluate', 'parse', 'compile']\n};","export var parseDocs = {\n name: 'parse',\n category: 'Expression',\n syntax: ['parse(expr)', 'parse(expr, options)', 'parse([expr1, expr2, expr3, ...])', 'parse([expr1, expr2, expr3, ...], options)'],\n description: 'Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().',\n examples: ['node1 = parse(\"sqrt(3^2 + 4^2)\")', 'node1.evaluate()', 'code1 = node1.compile()', 'code1.evaluate()', 'scope = {a: 3, b: 4}', 'node2 = parse(\"a * b\")', 'node2.evaluate(scope)', 'code2 = node2.compile()', 'code2.evaluate(scope)'],\n seealso: ['parser', 'evaluate', 'compile']\n};","export var compileDocs = {\n name: 'compile',\n category: 'Expression',\n syntax: ['compile(expr) ', 'compile([expr1, expr2, expr3, ...])'],\n description: 'Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.',\n examples: ['code1 = compile(\"sqrt(3^2 + 4^2)\")', 'code1.evaluate() ', 'code2 = compile(\"a * b\")', 'code2.evaluate({a: 3, b: 4})'],\n seealso: ['parser', 'parse', 'evaluate']\n};","export var helpDocs = {\n name: 'help',\n category: 'Expression',\n syntax: ['help(object)', 'help(string)'],\n description: 'Display documentation on a function or data type.',\n examples: ['help(sqrt)', 'help(\"complex\")'],\n seealso: []\n};","export var distanceDocs = {\n name: 'distance',\n category: 'Geometry',\n syntax: ['distance([x1, y1], [x2, y2])', 'distance([[x1, y1], [x2, y2]])'],\n description: 'Calculates the Euclidean distance between two points.',\n examples: ['distance([0,0], [4,4])', 'distance([[0,0], [4,4]])'],\n seealso: []\n};","export var intersectDocs = {\n name: 'intersect',\n category: 'Geometry',\n syntax: ['intersect(expr1, expr2, expr3, expr4)', 'intersect(expr1, expr2, expr3)'],\n description: 'Computes the intersection point of lines and/or planes.',\n examples: ['intersect([0, 0], [10, 10], [10, 0], [0, 10])', 'intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])'],\n seealso: []\n};","export var andDocs = {\n name: 'and',\n category: 'Logical',\n syntax: ['x and y', 'and(x, y)'],\n description: 'Logical and. Test whether two values are both defined with a nonzero/nonempty value.',\n examples: ['true and false', 'true and true', '2 and 4'],\n seealso: ['not', 'or', 'xor']\n};","export var notDocs = {\n name: 'not',\n category: 'Logical',\n syntax: ['not x', 'not(x)'],\n description: 'Logical not. Flips the boolean value of given argument.',\n examples: ['not true', 'not false', 'not 2', 'not 0'],\n seealso: ['and', 'or', 'xor']\n};","export var nullishDocs = {\n name: 'nullish',\n category: 'Logical',\n syntax: ['x ?? y', 'nullish(x, y)'],\n description: 'Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.',\n examples: ['null ?? 42', 'undefined ?? 42', '0 ?? 42', 'false ?? 42', 'null ?? undefined ?? 42'],\n seealso: ['and', 'or', 'not']\n};","export var orDocs = {\n name: 'or',\n category: 'Logical',\n syntax: ['x or y', 'or(x, y)'],\n description: 'Logical or. Test if at least one value is defined with a nonzero/nonempty value.',\n examples: ['true or false', 'false or false', '0 or 4'],\n seealso: ['not', 'and', 'xor']\n};","export var xorDocs = {\n name: 'xor',\n category: 'Logical',\n syntax: ['x xor y', 'xor(x, y)'],\n description: 'Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.',\n examples: ['true xor false', 'false xor false', 'true xor true', '0 xor 4'],\n seealso: ['not', 'and', 'or']\n};","export var mapSlicesDocs = {\n name: 'mapSlices',\n category: 'Matrix',\n syntax: ['mapSlices(A, dim, callback)'],\n description: 'Generate a matrix one dimension less than A by applying callback to ' + 'each slice of A along dimension dim.',\n examples: ['A = [[1, 2], [3, 4]]', 'mapSlices(A, 1, sum)',\n // returns [4, 6]\n 'mapSlices(A, 2, prod)' // returns [2, 12]\n ],\n seealso: ['map', 'forEach']\n};","export var columnDocs = {\n name: 'column',\n category: 'Matrix',\n syntax: ['column(x, index)'],\n description: 'Return a column from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'column(A, 1)', 'column(A, 2)'],\n seealso: ['row', 'matrixFromColumns']\n};","export var concatDocs = {\n name: 'concat',\n category: 'Matrix',\n syntax: ['concat(A, B, C, ...)', 'concat(A, B, C, ..., dim)'],\n description: 'Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.',\n examples: ['A = [1, 2; 5, 6]', 'B = [3, 4; 7, 8]', 'concat(A, B)', 'concat(A, B, 1)', 'concat(A, B, 2)'],\n seealso: ['det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var countDocs = {\n name: 'count',\n category: 'Matrix',\n syntax: ['count(x)'],\n description: 'Count the number of elements of a matrix, array or string.',\n examples: ['a = [1, 2; 3, 4; 5, 6]', 'count(a)', 'size(a)', 'count(\"hello world\")'],\n seealso: ['size']\n};","export var crossDocs = {\n name: 'cross',\n category: 'Matrix',\n syntax: ['cross(A, B)'],\n description: 'Calculate the cross product for two vectors in three dimensional space.',\n examples: ['cross([1, 1, 0], [0, 1, 1])', 'cross([3, -3, 1], [4, 9, 2])', 'cross([2, 3, 4], [5, 6, 7])'],\n seealso: ['multiply', 'dot']\n};","export var ctransposeDocs = {\n name: 'ctranspose',\n category: 'Matrix',\n syntax: ['x\\'', 'ctranspose(x)'],\n description: 'Complex Conjugate and Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'ctranspose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};","export var detDocs = {\n name: 'det',\n category: 'Matrix',\n syntax: ['det(x)'],\n description: 'Calculate the determinant of a matrix',\n examples: ['det([1, 2; 3, 4])', 'det([-2, 2, 3; -1, 1, 3; 2, 0, -1])'],\n seealso: ['concat', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var diagDocs = {\n name: 'diag',\n category: 'Matrix',\n syntax: ['diag(x)', 'diag(x, k)'],\n description: 'Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.',\n examples: ['diag(1:3)', 'diag(1:3, 1)', 'a = [1, 2, 3; 4, 5, 6; 7, 8, 9]', 'diag(a)'],\n seealso: ['concat', 'det', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var diffDocs = {\n name: 'diff',\n category: 'Matrix',\n syntax: ['diff(arr)', 'diff(arr, dim)'],\n description: ['Create a new matrix or array with the difference of the passed matrix or array.', 'Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference', 'If no dimension parameter is passed it is assumed as dimension 0', 'Dimension is zero-based in javascript and one-based in the parser', 'Arrays must be \\'rectangular\\' meaning arrays like [1, 2]', 'If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays'],\n examples: ['A = [1, 2, 4, 7, 0]', 'diff(A)', 'diff(A, 1)', 'B = [[1, 2], [3, 4]]', 'diff(B)', 'diff(B, 1)', 'diff(B, 2)', 'diff(B, bignumber(2))', 'diff([[1, 2], matrix([3, 4])], 2)'],\n seealso: ['subtract', 'partitionSelect']\n};","export var dotDocs = {\n name: 'dot',\n category: 'Matrix',\n syntax: ['dot(A, B)', 'A * B'],\n description: 'Calculate the dot product of two vectors. ' + 'The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] ' + 'is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn',\n examples: ['dot([2, 4, 1], [2, 2, 3])', '[2, 4, 1] * [2, 2, 3]'],\n seealso: ['multiply', 'cross']\n};","export var eigsDocs = {\n name: 'eigs',\n category: 'Matrix',\n syntax: ['eigs(x)'],\n description: 'Calculate the eigenvalues and optionally eigenvectors of a square matrix',\n examples: ['eigs([[5, 2.3], [2.3, 1]])', 'eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })'],\n seealso: ['inv']\n};","export var filterDocs = {\n name: 'filter',\n category: 'Matrix',\n syntax: ['filter(x, test)'],\n description: 'Filter items in a matrix.',\n examples: ['isPositive(x) = x > 0', 'filter([6, -2, -1, 4, 3], isPositive)', 'filter([6, -2, 0, 1, 0], x != 0)'],\n seealso: ['sort', 'map', 'forEach']\n};","export var flattenDocs = {\n name: 'flatten',\n category: 'Matrix',\n syntax: ['flatten(x)'],\n description: 'Flatten a multi dimensional matrix into a single dimensional matrix.',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'size(a)', 'b = flatten(a)', 'size(b)'],\n seealso: ['concat', 'resize', 'size', 'squeeze']\n};","export var forEachDocs = {\n name: 'forEach',\n category: 'Matrix',\n syntax: ['forEach(x, callback)'],\n description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',\n examples: ['numberOfPets = {}', 'addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;', 'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)', 'numberOfPets'],\n seealso: ['map', 'sort', 'filter']\n};","export var getMatrixDataTypeDocs = {\n name: 'getMatrixDataType',\n category: 'Matrix',\n syntax: ['getMatrixDataType(x)'],\n description: 'Find the data type of all elements in a matrix or array, ' + 'for example \"number\" if all items are a number ' + 'and \"Complex\" if all values are complex numbers. ' + 'If a matrix contains more than one data type, it will return \"mixed\".',\n examples: ['getMatrixDataType([1, 2, 3])', 'getMatrixDataType([[5 cm], [2 inch]])', 'getMatrixDataType([1, \"text\"])', 'getMatrixDataType([1, bignumber(4)])'],\n seealso: ['matrix', 'sparse', 'typeOf']\n};","export var identityDocs = {\n name: 'identity',\n category: 'Matrix',\n syntax: ['identity(n)', 'identity(m, n)', 'identity([m, n])'],\n description: 'Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.',\n examples: ['identity(3)', 'identity(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'identity(size(a))'],\n seealso: ['concat', 'det', 'diag', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var invDocs = {\n name: 'inv',\n category: 'Matrix',\n syntax: ['inv(x)'],\n description: 'Calculate the inverse of a matrix',\n examples: ['inv([1, 2; 3, 4])', 'inv(4)', '1 / 4'],\n seealso: ['concat', 'det', 'diag', 'identity', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var pinvDocs = {\n name: 'pinv',\n category: 'Matrix',\n syntax: ['pinv(x)'],\n description: 'Calculate the Moore–Penrose inverse of a matrix',\n examples: ['pinv([1, 2; 3, 4])', 'pinv([[1, 0], [0, 1], [0, 1]])', 'pinv(4)'],\n seealso: ['inv']\n};","export var kronDocs = {\n name: 'kron',\n category: 'Matrix',\n syntax: ['kron(x, y)'],\n description: 'Calculates the Kronecker product of 2 matrices or vectors.',\n examples: ['kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])', 'kron([1,1], [2,3,4])'],\n seealso: ['multiply', 'dot', 'cross']\n};","export var mapDocs = {\n name: 'map',\n category: 'Matrix',\n syntax: ['map(x, callback)', 'map(x, y, ..., callback)'],\n description: 'Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.',\n examples: ['map([1, 2, 3], square)', 'map([1, 2], [3, 4], f(a,b) = a + b)'],\n seealso: ['filter', 'forEach']\n};","export var matrixFromColumnsDocs = {\n name: 'matrixFromColumns',\n category: 'Matrix',\n syntax: ['matrixFromColumns(...arr)', 'matrixFromColumns(row1, row2)', 'matrixFromColumns(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual columns.',\n examples: ['matrixFromColumns([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromFunction', 'zeros']\n};","export var matrixFromFunctionDocs = {\n name: 'matrixFromFunction',\n category: 'Matrix',\n syntax: ['matrixFromFunction(size, fn)', 'matrixFromFunction(size, fn, format)', 'matrixFromFunction(size, fn, format, datatype)', 'matrixFromFunction(size, format, fn)', 'matrixFromFunction(size, format, datatype, fn)'],\n description: 'Create a matrix by evaluating a generating function at each index.',\n examples: ['f(I) = I[1] - I[2]', 'matrixFromFunction([3,3], f)', 'g(I) = I[1] - I[2] == 1 ? 4 : 0', 'matrixFromFunction([100, 100], \"sparse\", g)', 'matrixFromFunction([5], random)'],\n seealso: ['matrix', 'matrixFromRows', 'matrixFromColumns', 'zeros']\n};","export var matrixFromRowsDocs = {\n name: 'matrixFromRows',\n category: 'Matrix',\n syntax: ['matrixFromRows(...arr)', 'matrixFromRows(row1, row2)', 'matrixFromRows(row1, row2, row3)'],\n description: 'Create a dense matrix from vectors as individual rows.',\n examples: ['matrixFromRows([1, 2, 3], [[4],[5],[6]])'],\n seealso: ['matrix', 'matrixFromColumns', 'matrixFromFunction', 'zeros']\n};","export var onesDocs = {\n name: 'ones',\n category: 'Matrix',\n syntax: ['ones(m)', 'ones(m, n)', 'ones(m, n, p, ...)', 'ones([m])', 'ones([m, n])', 'ones([m, n, p, ...])'],\n description: 'Create a matrix containing ones.',\n examples: ['ones(3)', 'ones(3, 5)', 'ones([2,3]) * 4.5', 'a = [1, 2, 3; 4, 5, 6]', 'ones(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var partitionSelectDocs = {\n name: 'partitionSelect',\n category: 'Matrix',\n syntax: ['partitionSelect(x, k)', 'partitionSelect(x, k, compare)'],\n description: 'Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.',\n examples: ['partitionSelect([5, 10, 1], 2)', 'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)', 'arr = [5, 2, 1]', 'partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]', 'arr', 'partitionSelect(arr, 1, \\'desc\\') # returns 2, arr is now: [5, 2, 1]', 'arr'],\n seealso: ['sort']\n};","export var rangeDocs = {\n name: 'range',\n category: 'Type',\n syntax: ['start:end', 'start:step:end', 'range(start, end)', 'range(start, end, step)', 'range(string)'],\n description: 'Create a range. Lower bound of the range is included, upper bound is excluded.',\n examples: ['1:5', '3:-1:-3', 'range(3, 7)', 'range(0, 12, 2)', 'range(\"4:10\")', 'range(1m, 1m, 3m)', 'a = [1, 2, 3, 4; 5, 6, 7, 8]', 'a[1:2, 1:2]'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'size', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var reshapeDocs = {\n name: 'reshape',\n category: 'Matrix',\n syntax: ['reshape(x, sizes)'],\n description: 'Reshape a multi dimensional array to fit the specified dimensions.',\n examples: ['reshape([1, 2, 3, 4, 5, 6], [2, 3])', 'reshape([[1, 2], [3, 4]], [1, 4])', 'reshape([[1, 2], [3, 4]], [4])', 'reshape([1, 2, 3, 4], [-1, 2])'],\n seealso: ['size', 'squeeze', 'resize']\n};","export var resizeDocs = {\n name: 'resize',\n category: 'Matrix',\n syntax: ['resize(x, size)', 'resize(x, size, defaultValue)'],\n description: 'Resize a matrix.',\n examples: ['resize([1,2,3,4,5], [3])', 'resize([1,2,3], [5])', 'resize([1,2,3], [5], -1)', 'resize(2, [2, 3])', 'resize(\"hello\", [8], \"!\")'],\n seealso: ['size', 'subset', 'squeeze', 'reshape']\n};","export var rotateDocs = {\n name: 'rotate',\n category: 'Matrix',\n syntax: ['rotate(w, theta)', 'rotate(w, theta, v)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotate([1, 0], pi / 2)', 'rotate(matrix([1, 0]), unit(\"35deg\"))', 'rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])', 'rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],\n seealso: ['matrix', 'rotationMatrix']\n};","export var rotationMatrixDocs = {\n name: 'rotationMatrix',\n category: 'Matrix',\n syntax: ['rotationMatrix(theta)', 'rotationMatrix(theta, v)', 'rotationMatrix(theta, v, format)'],\n description: 'Returns a 2-D rotation matrix (2x2) for a given angle (in radians). ' + 'Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.',\n examples: ['rotationMatrix(pi / 2)', 'rotationMatrix(unit(\"45deg\"), [0, 0, 1])', 'rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],\n seealso: ['cos', 'sin']\n};","export var rowDocs = {\n name: 'row',\n category: 'Matrix',\n syntax: ['row(x, index)'],\n description: 'Return a row from a matrix or array.',\n examples: ['A = [[1, 2], [3, 4]]', 'row(A, 1)', 'row(A, 2)'],\n seealso: ['column', 'matrixFromRows']\n};","export var sizeDocs = {\n name: 'size',\n category: 'Matrix',\n syntax: ['size(x)'],\n description: 'Calculate the size of a matrix.',\n examples: ['size(2.3)', 'size(\"hello world\")', 'a = [1, 2; 3, 4; 5, 6]', 'size(a)', 'size(1:6)'],\n seealso: ['concat', 'count', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'squeeze', 'subset', 'trace', 'transpose', 'zeros']\n};","export var sortDocs = {\n name: 'sort',\n category: 'Matrix',\n syntax: ['sort(x)', 'sort(x, compare)'],\n description: 'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',\n examples: ['sort([5, 10, 1])', 'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")', 'sortByLength(a, b) = size(a)[1] - size(b)[1]', 'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)', 'sort([\"10\", \"1\", \"2\"], \"natural\")'],\n seealso: ['map', 'filter', 'forEach']\n};","export var squeezeDocs = {\n name: 'squeeze',\n category: 'Matrix',\n syntax: ['squeeze(x)'],\n description: 'Remove inner and outer singleton dimensions from a matrix.',\n examples: ['a = zeros(3,2,1)', 'size(squeeze(a))', 'b = zeros(1,1,3)', 'size(squeeze(b))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'subset', 'trace', 'transpose', 'zeros']\n};","export var subsetDocs = {\n name: 'subset',\n category: 'Matrix',\n syntax: ['value(index)', 'value(index) = replacement', 'subset(value, [index])', 'subset(value, [index], replacement)'],\n description: 'Get or set a subset of the entries of a matrix or ' + 'characters of a string. ' + 'Indexes are one-based. There should be one index specification for ' + 'each dimension of the target. Each specification can be a single ' + 'index, a list of indices, or a range in colon notation `l:u`. ' + 'In a range, both the lower bound l and upper bound u are included; ' + 'and if a bound is omitted it defaults to the most extreme valid value. ' + 'The cartesian product of the indices specified in each dimension ' + 'determines the target of the operation.',\n examples: ['d = [1, 2; 3, 4]', 'e = []', 'e[1, 1:2] = [5, 6]', 'e[2, :] = [7, 8]', 'f = d * e', 'f[2, 1]', 'f[:, 1]', 'f[[1,2], [1,3]] = [9, 10; 11, 12]', 'f'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'trace', 'transpose', 'zeros']\n};","export var traceDocs = {\n name: 'trace',\n category: 'Matrix',\n syntax: ['trace(A)'],\n description: 'Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.',\n examples: ['A = [1, 2, 3; -1, 2, 3; 2, 0, 3]', 'trace(A)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'transpose', 'zeros']\n};","export var transposeDocs = {\n name: 'transpose',\n category: 'Matrix',\n syntax: ['x\\'', 'transpose(x)'],\n description: 'Transpose a matrix',\n examples: ['a = [1, 2, 3; 4, 5, 6]', 'a\\'', 'transpose(a)'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'zeros']\n};","export var zerosDocs = {\n name: 'zeros',\n category: 'Matrix',\n syntax: ['zeros(m)', 'zeros(m, n)', 'zeros(m, n, p, ...)', 'zeros([m])', 'zeros([m, n])', 'zeros([m, n, p, ...])'],\n description: 'Create a matrix containing zeros.',\n examples: ['zeros(3)', 'zeros(3, 5)', 'a = [1, 2, 3; 4, 5, 6]', 'zeros(size(a))'],\n seealso: ['concat', 'det', 'diag', 'identity', 'inv', 'ones', 'range', 'size', 'squeeze', 'subset', 'trace', 'transpose']\n};","export var fftDocs = {\n name: 'fft',\n category: 'Matrix',\n syntax: ['fft(x)'],\n description: 'Calculate N-dimensional Fourier transform',\n examples: ['fft([[1, 0], [1, 0]])'],\n seealso: ['ifft']\n};","export var ifftDocs = {\n name: 'ifft',\n category: 'Matrix',\n syntax: ['ifft(x)'],\n description: 'Calculate N-dimensional inverse Fourier transform',\n examples: ['ifft([[2, 2], [0, 0]])'],\n seealso: ['fft']\n};","export var bernoulliDocs = {\n name: 'bernoulli',\n category: 'Probability',\n syntax: ['bernoulli(n)'],\n description: 'The nth Bernoulli number',\n examples: ['bernoulli(4)', 'bernoulli(fraction(12))'],\n seealso: ['combinations', 'gamma', 'stirlingS2']\n};","export var combinationsDocs = {\n name: 'combinations',\n category: 'Probability',\n syntax: ['combinations(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time',\n examples: ['combinations(7, 5)'],\n seealso: ['combinationsWithRep', 'permutations', 'factorial']\n};","export var combinationsWithRepDocs = {\n name: 'combinationsWithRep',\n category: 'Probability',\n syntax: ['combinationsWithRep(n, k)'],\n description: 'Compute the number of combinations of n items taken k at a time with replacements.',\n examples: ['combinationsWithRep(7, 5)'],\n seealso: ['combinations', 'permutations', 'factorial']\n};","export var factorialDocs = {\n name: 'factorial',\n category: 'Probability',\n syntax: ['n!', 'factorial(n)'],\n description: 'Compute the factorial of a value',\n examples: ['5!', '5 * 4 * 3 * 2 * 1', '3!'],\n seealso: ['combinations', 'combinationsWithRep', 'permutations', 'gamma']\n};","export var gammaDocs = {\n name: 'gamma',\n category: 'Probability',\n syntax: ['gamma(n)'],\n description: 'Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.',\n examples: ['gamma(4)', '3!', 'gamma(1/2)', 'sqrt(pi)'],\n seealso: ['factorial']\n};","export var lgammaDocs = {\n name: 'lgamma',\n category: 'Probability',\n syntax: ['lgamma(n)'],\n description: 'Logarithm of the gamma function for real, positive numbers and complex numbers, ' + 'using Lanczos approximation for numbers and Stirling series for complex numbers.',\n examples: ['lgamma(4)', 'lgamma(1/2)', 'lgamma(i)', 'lgamma(complex(1.1, 2))'],\n seealso: ['gamma']\n};","export var kldivergenceDocs = {\n name: 'kldivergence',\n category: 'Probability',\n syntax: ['kldivergence(x, y)'],\n description: 'Calculate the Kullback-Leibler (KL) divergence between two distributions.',\n examples: ['kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])'],\n seealso: []\n};","export var multinomialDocs = {\n name: 'multinomial',\n category: 'Probability',\n syntax: ['multinomial(A)'],\n description: 'Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.',\n examples: ['multinomial([1, 2, 1])'],\n seealso: ['combinations', 'factorial']\n};","export var permutationsDocs = {\n name: 'permutations',\n category: 'Probability',\n syntax: ['permutations(n)', 'permutations(n, k)'],\n description: 'Compute the number of permutations of n items taken k at a time',\n examples: ['permutations(5)', 'permutations(5, 3)'],\n seealso: ['combinations', 'combinationsWithRep', 'factorial']\n};","export var pickRandomDocs = {\n name: 'pickRandom',\n category: 'Probability',\n syntax: ['pickRandom(array)', 'pickRandom(array, number)', 'pickRandom(array, weights)', 'pickRandom(array, number, weights)', 'pickRandom(array, weights, number)'],\n description: 'Pick a random entry from a given array.',\n examples: ['pickRandom(0:10)', 'pickRandom([1, 3, 1, 6])', 'pickRandom([1, 3, 1, 6], 2)', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])', 'pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)'],\n seealso: ['random', 'randomInt']\n};","export var randomDocs = {\n name: 'random',\n category: 'Probability',\n syntax: ['random()', 'random(max)', 'random(min, max)', 'random(size)', 'random(size, max)', 'random(size, min, max)'],\n description: 'Return a random number.',\n examples: ['random()', 'random(10, 20)', 'random([2, 3])'],\n seealso: ['pickRandom', 'randomInt']\n};","export var randomIntDocs = {\n name: 'randomInt',\n category: 'Probability',\n syntax: ['randomInt(max)', 'randomInt(min, max)', 'randomInt(size)', 'randomInt(size, max)', 'randomInt(size, min, max)'],\n description: 'Return a random integer number',\n examples: ['randomInt(10, 20)', 'randomInt([2, 3], 10)'],\n seealso: ['pickRandom', 'random']\n};","export var compareDocs = {\n name: 'compare',\n category: 'Relational',\n syntax: ['compare(x, y)'],\n description: 'Compare two values. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compare(2, 3)', 'compare(3, 2)', 'compare(2, 2)', 'compare(5cm, 40mm)', 'compare(2, [1, 2, 3])'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compareNatural', 'compareText']\n};","export var compareNaturalDocs = {\n name: 'compareNatural',\n category: 'Relational',\n syntax: ['compareNatural(x, y)'],\n description: 'Compare two values of any type in a deterministic, natural way. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareNatural(2, 3)', 'compareNatural(3, 2)', 'compareNatural(2, 2)', 'compareNatural(5cm, 40mm)', 'compareNatural(\"2\", \"10\")', 'compareNatural(2 + 3i, 2 + 4i)', 'compareNatural([1, 2, 4], [1, 2, 3])', 'compareNatural([1, 5], [1, 2, 3])', 'compareNatural([1, 2], [1, 2])', 'compareNatural({a: 2}, {a: 4})'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare', 'compareText']\n};","export var compareTextDocs = {\n name: 'compareText',\n category: 'Relational',\n syntax: ['compareText(x, y)'],\n description: 'Compare two strings lexically. Comparison is case sensitive. ' + 'Returns 1 when x > y, -1 when x < y, and 0 when x == y.',\n examples: ['compareText(\"B\", \"A\")', 'compareText(\"A\", \"B\")', 'compareText(\"A\", \"A\")', 'compareText(\"2\", \"10\")', 'compare(\"2\", \"10\")', 'compare(2, 10)', 'compareNatural(\"2\", \"10\")', 'compareText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural']\n};","export var deepEqualDocs = {\n name: 'deepEqual',\n category: 'Relational',\n syntax: ['deepEqual(x, y)'],\n description: 'Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.',\n examples: ['deepEqual([1,3,4], [1,3,4])', 'deepEqual([1,3,4], [1,3])'],\n seealso: ['equal', 'unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare']\n};","export var equalDocs = {\n name: 'equal',\n category: 'Relational',\n syntax: ['x == y', 'equal(x, y)'],\n description: 'Check equality of two values. Returns true if the values are equal, and false if not.',\n examples: ['2+2 == 3', '2+2 == 4', 'a = 3.2', 'b = 6-2.8', 'a == b', '50cm == 0.5m'],\n seealso: ['unequal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual', 'equalText']\n};","export var equalTextDocs = {\n name: 'equalText',\n category: 'Relational',\n syntax: ['equalText(x, y)'],\n description: 'Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.',\n examples: ['equalText(\"Hello\", \"Hello\")', 'equalText(\"a\", \"A\")', 'equal(\"2e3\", \"2000\")', 'equalText(\"2e3\", \"2000\")', 'equalText(\"B\", [\"A\", \"B\", \"C\"])'],\n seealso: ['compare', 'compareNatural', 'compareText', 'equal']\n};","export var largerDocs = {\n name: 'larger',\n category: 'Relational',\n syntax: ['x > y', 'larger(x, y)'],\n description: 'Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.',\n examples: ['2 > 3', '5 > 2*2', 'a = 3.3', 'b = 6-2.8', '(a > b)', '(b < a)', '5 cm > 2 inch'],\n seealso: ['equal', 'unequal', 'smaller', 'smallerEq', 'largerEq', 'compare']\n};","export var largerEqDocs = {\n name: 'largerEq',\n category: 'Relational',\n syntax: ['x >= y', 'largerEq(x, y)'],\n description: 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.',\n examples: ['2 >= 1+1', '2 > 1+1', 'a = 3.2', 'b = 6-2.8', '(a >= b)'],\n seealso: ['equal', 'unequal', 'smallerEq', 'smaller', 'compare']\n};","export var smallerDocs = {\n name: 'smaller',\n category: 'Relational',\n syntax: ['x < y', 'smaller(x, y)'],\n description: 'Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.',\n examples: ['2 < 3', '5 < 2*2', 'a = 3.3', 'b = 6-2.8', '(a < b)', '5 cm < 2 inch'],\n seealso: ['equal', 'unequal', 'larger', 'smallerEq', 'largerEq', 'compare']\n};","export var smallerEqDocs = {\n name: 'smallerEq',\n category: 'Relational',\n syntax: ['x <= y', 'smallerEq(x, y)'],\n description: 'Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.',\n examples: ['2 <= 1+1', '2 < 1+1', 'a = 3.2', 'b = 6-2.8', '(a <= b)'],\n seealso: ['equal', 'unequal', 'larger', 'smaller', 'largerEq', 'compare']\n};","export var unequalDocs = {\n name: 'unequal',\n category: 'Relational',\n syntax: ['x != y', 'unequal(x, y)'],\n description: 'Check unequality of two values. Returns true if the values are unequal, and false if they are equal.',\n examples: ['2+2 != 3', '2+2 != 4', 'a = 3.2', 'b = 6-2.8', 'a != b', '50cm != 0.5m', '5 cm != 2 inch'],\n seealso: ['equal', 'smaller', 'larger', 'smallerEq', 'largerEq', 'compare', 'deepEqual']\n};","export var setCartesianDocs = {\n name: 'setCartesian',\n category: 'Set',\n syntax: ['setCartesian(set1, set2)'],\n description: 'Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.',\n examples: ['setCartesian([1, 2], [3, 4])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference', 'setPowerset']\n};","export var setDifferenceDocs = {\n name: 'setDifference',\n category: 'Set',\n syntax: ['setDifference(set1, set2)'],\n description: 'Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setSymDifference']\n};","export var setDistinctDocs = {\n name: 'setDistinct',\n category: 'Set',\n syntax: ['setDistinct(set)'],\n description: 'Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setDistinct([1, 1, 1, 2, 2, 3])'],\n seealso: ['setMultiplicity']\n};","export var setIntersectDocs = {\n name: 'setIntersect',\n category: 'Set',\n syntax: ['setIntersect(set1, set2)'],\n description: 'Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIntersect([1, 2, 3, 4], [3, 4, 5, 6])', 'setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setDifference']\n};","export var setIsSubsetDocs = {\n name: 'setIsSubset',\n category: 'Set',\n syntax: ['setIsSubset(set1, set2)'],\n description: 'Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setIsSubset([1, 2], [3, 4, 5, 6])', 'setIsSubset([3, 4], [3, 4, 5, 6])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setMultiplicityDocs = {\n name: 'setMultiplicity',\n category: 'Set',\n syntax: ['setMultiplicity(element, set)'],\n description: 'Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setMultiplicity(1, [1, 2, 2, 4])', 'setMultiplicity(2, [1, 2, 2, 4])'],\n seealso: ['setDistinct', 'setSize']\n};","export var setPowersetDocs = {\n name: 'setPowerset',\n category: 'Set',\n syntax: ['setPowerset(set)'],\n description: 'Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setPowerset([1, 2, 3])'],\n seealso: ['setCartesian']\n};","export var setSizeDocs = {\n name: 'setSize',\n category: 'Set',\n syntax: ['setSize(set)', 'setSize(set, unique)'],\n description: 'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',\n examples: ['setSize([1, 2, 2, 4])', 'setSize([1, 2, 2, 4], true)'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setSymDifferenceDocs = {\n name: 'setSymDifference',\n category: 'Set',\n syntax: ['setSymDifference(set1, set2)'],\n description: 'Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])', 'setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setUnion', 'setIntersect', 'setDifference']\n};","export var setUnionDocs = {\n name: 'setUnion',\n category: 'Set',\n syntax: ['setUnion(set1, set2)'],\n description: 'Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.',\n examples: ['setUnion([1, 2, 3, 4], [3, 4, 5, 6])', 'setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])'],\n seealso: ['setIntersect', 'setDifference']\n};","export var zpk2tfDocs = {\n name: 'zpk2tf',\n category: 'Signal',\n syntax: ['zpk2tf(z, p, k)'],\n description: 'Compute the transfer function of a zero-pole-gain model.',\n examples: ['zpk2tf([1, 2], [-1, -2], 1)', 'zpk2tf([1, 2], [-1, -2])', 'zpk2tf([1 - 3i, 2 + 2i], [-1, -2])'],\n seealso: []\n};","export var freqzDocs = {\n name: 'freqz',\n category: 'Signal',\n syntax: ['freqz(b, a)', 'freqz(b, a, w)'],\n description: 'Calculates the frequency response of a filter given its numerator and denominator coefficients.',\n examples: ['freqz([1, 2], [1, 2, 3])', 'freqz([1, 2], [1, 2, 3], [0, 1])', 'freqz([1, 2], [1, 2, 3], 512)'],\n seealso: []\n};","export var erfDocs = {\n name: 'erf',\n category: 'Special',\n syntax: ['erf(x)'],\n description: 'Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x',\n examples: ['erf(0.2)', 'erf(-0.5)', 'erf(4)'],\n seealso: []\n};","export var zetaDocs = {\n name: 'zeta',\n category: 'Special',\n syntax: ['zeta(s)'],\n description: 'Compute the Riemann Zeta Function using an infinite series and Riemann\\'s Functional Equation for the entire complex plane',\n examples: ['zeta(0.2)', 'zeta(-0.5)', 'zeta(4)'],\n seealso: []\n};","export var madDocs = {\n name: 'mad',\n category: 'Statistics',\n syntax: ['mad(a, b, c, ...)', 'mad(A)'],\n description: 'Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.',\n examples: ['mad(10, 20, 30)', 'mad([1, 2, 3])'],\n seealso: ['mean', 'median', 'std', 'abs']\n};","export var maxDocs = {\n name: 'max',\n category: 'Statistics',\n syntax: ['max(a, b, c, ...)', 'max(A)', 'max(A, dimension)'],\n description: 'Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.',\n examples: ['max(2, 3, 4, 1)', 'max([2, 3, 4, 1])', 'max([2, 5; 4, 3])', 'max([2, 5; 4, 3], 1)', 'max([2, 5; 4, 3], 2)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var meanDocs = {\n name: 'mean',\n category: 'Statistics',\n syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dimension)'],\n description: 'Compute the arithmetic mean of a list of values.',\n examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'],\n seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var medianDocs = {\n name: 'median',\n category: 'Statistics',\n syntax: ['median(a, b, c, ...)', 'median(A)'],\n description: 'Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.',\n examples: ['median(5, 2, 7)', 'median([3, -1, 5, 7])'],\n seealso: ['max', 'mean', 'min', 'prod', 'std', 'sum', 'variance', 'quantileSeq']\n};","export var minDocs = {\n name: 'min',\n category: 'Statistics',\n syntax: ['min(a, b, c, ...)', 'min(A)', 'min(A, dimension)'],\n description: 'Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.',\n examples: ['min(2, 3, 4, 1)', 'min([2, 3, 4, 1])', 'min([2, 5; 4, 3])', 'min([2, 5; 4, 3], 1)', 'min([2, 5; 4, 3], 2)', 'min(2.7, 7.1, -4.5, 2.0, 4.1)', 'max(2.7, 7.1, -4.5, 2.0, 4.1)'],\n seealso: ['max', 'mean', 'median', 'prod', 'std', 'sum', 'variance']\n};","export var modeDocs = {\n name: 'mode',\n category: 'Statistics',\n syntax: ['mode(a, b, c, ...)', 'mode(A)', 'mode(A, a, b, B, c, ...)'],\n description: 'Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.',\n examples: ['mode(2, 1, 4, 3, 1)', 'mode([1, 2.7, 3.2, 4, 2.7])', 'mode(1, 4, 6, 1, 6)'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'std', 'sum', 'variance']\n};","export var prodDocs = {\n name: 'prod',\n category: 'Statistics',\n syntax: ['prod(a, b, c, ...)', 'prod(A)'],\n description: 'Compute the product of all values.',\n examples: ['prod(2, 3, 4)', 'prod([2, 3, 4])', 'prod([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'std', 'sum', 'variance']\n};","export var quantileSeqDocs = {\n name: 'quantileSeq',\n category: 'Statistics',\n syntax: ['quantileSeq(A, prob[, sorted])', 'quantileSeq(A, [prob1, prob2, ...][, sorted])', 'quantileSeq(A, N[, sorted])'],\n description: 'Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.',\n examples: ['quantileSeq([3, -1, 5, 7], 0.5)', 'quantileSeq([3, -1, 5, 7], [1/3, 2/3])', 'quantileSeq([3, -1, 5, 7], 2)', 'quantileSeq([-1, 3, 5, 7], 0.5, true)'],\n seealso: ['mean', 'median', 'min', 'max', 'prod', 'std', 'sum', 'variance']\n};","export var stdDocs = {\n name: 'std',\n category: 'Statistics',\n syntax: ['std(a, b, c, ...)', 'std(A)', 'std(A, dimension)', 'std(A, normalization)', 'std(A, dimension, normalization)'],\n description: 'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['std(2, 4, 6)', 'std([2, 4, 6, 8])', 'std([2, 4, 6, 8], \"uncorrected\")', 'std([2, 4, 6, 8], \"biased\")', 'std([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'prod', 'sum', 'variance']\n};","export var cumSumDocs = {\n name: 'cumsum',\n category: 'Statistics',\n syntax: ['cumsum(a, b, c, ...)', 'cumsum(A)'],\n description: 'Compute the cumulative sum of all values.',\n examples: ['cumsum(2, 3, 4, 1)', 'cumsum([2, 3, 4, 1])', 'cumsum([1, 2; 3, 4])', 'cumsum([1, 2; 3, 4], 1)', 'cumsum([1, 2; 3, 4], 2)'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'sum', 'variance']\n};","export var sumDocs = {\n name: 'sum',\n category: 'Statistics',\n syntax: ['sum(a, b, c, ...)', 'sum(A)', 'sum(A, dimension)'],\n description: 'Compute the sum of all values.',\n examples: ['sum(2, 3, 4, 1)', 'sum([2, 3, 4, 1])', 'sum([2, 5; 4, 3])'],\n seealso: ['max', 'mean', 'median', 'min', 'prod', 'std', 'variance']\n};","export var varianceDocs = {\n name: 'variance',\n category: 'Statistics',\n syntax: ['variance(a, b, c, ...)', 'variance(A)', 'variance(A, dimension)', 'variance(A, normalization)', 'variance(A, dimension, normalization)'],\n description: 'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',\n examples: ['variance(2, 4, 6)', 'variance([2, 4, 6, 8])', 'variance([2, 4, 6, 8], \"uncorrected\")', 'variance([2, 4, 6, 8], \"biased\")', 'variance([1, 2, 3; 4, 5, 6])'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};","export var corrDocs = {\n name: 'corr',\n category: 'Statistics',\n syntax: ['corr(A,B)'],\n description: 'Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.',\n examples: ['corr([2, 4, 6, 8],[1, 2, 3, 6])', 'corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))'],\n seealso: ['max', 'mean', 'min', 'median', 'min', 'prod', 'std', 'sum']\n};","export var acosDocs = {\n name: 'acos',\n category: 'Trigonometry',\n syntax: ['acos(x)'],\n description: 'Compute the inverse cosine of a value in radians.',\n examples: ['acos(0.5)', 'acos(cos(2.3))'],\n seealso: ['cos', 'atan', 'asin']\n};","export var acoshDocs = {\n name: 'acosh',\n category: 'Trigonometry',\n syntax: ['acosh(x)'],\n description: 'Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.',\n examples: ['acosh(1.5)'],\n seealso: ['cosh', 'asinh', 'atanh']\n};","export var acotDocs = {\n name: 'acot',\n category: 'Trigonometry',\n syntax: ['acot(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acot(0.5)', 'acot(cot(0.5))', 'acot(2)'],\n seealso: ['cot', 'atan']\n};","export var acothDocs = {\n name: 'acoth',\n category: 'Trigonometry',\n syntax: ['acoth(x)'],\n description: 'Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.',\n examples: ['acoth(2)', 'acoth(0.5)'],\n seealso: ['acsch', 'asech']\n};","export var acscDocs = {\n name: 'acsc',\n category: 'Trigonometry',\n syntax: ['acsc(x)'],\n description: 'Calculate the inverse cotangent of a value.',\n examples: ['acsc(2)', 'acsc(csc(0.5))', 'acsc(0.5)'],\n seealso: ['csc', 'asin', 'asec']\n};","export var acschDocs = {\n name: 'acsch',\n category: 'Trigonometry',\n syntax: ['acsch(x)'],\n description: 'Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.',\n examples: ['acsch(0.5)'],\n seealso: ['asech', 'acoth']\n};","export var asecDocs = {\n name: 'asec',\n category: 'Trigonometry',\n syntax: ['asec(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asec(0.5)', 'asec(sec(0.5))', 'asec(2)'],\n seealso: ['acos', 'acot', 'acsc']\n};","export var asechDocs = {\n name: 'asech',\n category: 'Trigonometry',\n syntax: ['asech(x)'],\n description: 'Calculate the inverse secant of a value.',\n examples: ['asech(0.5)'],\n seealso: ['acsch', 'acoth']\n};","export var asinDocs = {\n name: 'asin',\n category: 'Trigonometry',\n syntax: ['asin(x)'],\n description: 'Compute the inverse sine of a value in radians.',\n examples: ['asin(0.5)', 'asin(sin(0.5))'],\n seealso: ['sin', 'acos', 'atan']\n};","export var asinhDocs = {\n name: 'asinh',\n category: 'Trigonometry',\n syntax: ['asinh(x)'],\n description: 'Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.',\n examples: ['asinh(0.5)'],\n seealso: ['acosh', 'atanh']\n};","export var atanDocs = {\n name: 'atan',\n category: 'Trigonometry',\n syntax: ['atan(x)'],\n description: 'Compute the inverse tangent of a value in radians.',\n examples: ['atan(0.5)', 'atan(tan(0.5))'],\n seealso: ['tan', 'acos', 'asin']\n};","export var atan2Docs = {\n name: 'atan2',\n category: 'Trigonometry',\n syntax: ['atan2(y, x)'],\n description: 'Computes the principal value of the arc tangent of y/x in radians.',\n examples: ['atan2(2, 2) / pi', 'angle = 60 deg in rad', 'x = cos(angle)', 'y = sin(angle)', 'atan2(y, x)'],\n seealso: ['sin', 'cos', 'tan']\n};","export var atanhDocs = {\n name: 'atanh',\n category: 'Trigonometry',\n syntax: ['atanh(x)'],\n description: 'Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.',\n examples: ['atanh(0.5)'],\n seealso: ['acosh', 'asinh']\n};","export var cosDocs = {\n name: 'cos',\n category: 'Trigonometry',\n syntax: ['cos(x)'],\n description: 'Compute the cosine of x in radians.',\n examples: ['cos(2)', 'cos(pi / 4) ^ 2', 'cos(180 deg)', 'cos(60 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['acos', 'sin', 'tan']\n};","export var coshDocs = {\n name: 'cosh',\n category: 'Trigonometry',\n syntax: ['cosh(x)'],\n description: 'Compute the hyperbolic cosine of x in radians.',\n examples: ['cosh(0.5)'],\n seealso: ['sinh', 'tanh', 'coth']\n};","export var cotDocs = {\n name: 'cot',\n category: 'Trigonometry',\n syntax: ['cot(x)'],\n description: 'Compute the cotangent of x in radians. Defined as 1/tan(x)',\n examples: ['cot(2)', '1 / tan(2)'],\n seealso: ['sec', 'csc', 'tan']\n};","export var cothDocs = {\n name: 'coth',\n category: 'Trigonometry',\n syntax: ['coth(x)'],\n description: 'Compute the hyperbolic cotangent of x in radians.',\n examples: ['coth(2)', '1 / tanh(2)'],\n seealso: ['sech', 'csch', 'tanh']\n};","export var cscDocs = {\n name: 'csc',\n category: 'Trigonometry',\n syntax: ['csc(x)'],\n description: 'Compute the cosecant of x in radians. Defined as 1/sin(x)',\n examples: ['csc(2)', '1 / sin(2)'],\n seealso: ['sec', 'cot', 'sin']\n};","export var cschDocs = {\n name: 'csch',\n category: 'Trigonometry',\n syntax: ['csch(x)'],\n description: 'Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)',\n examples: ['csch(2)', '1 / sinh(2)'],\n seealso: ['sech', 'coth', 'sinh']\n};","export var secDocs = {\n name: 'sec',\n category: 'Trigonometry',\n syntax: ['sec(x)'],\n description: 'Compute the secant of x in radians. Defined as 1/cos(x)',\n examples: ['sec(2)', '1 / cos(2)'],\n seealso: ['cot', 'csc', 'cos']\n};","export var sechDocs = {\n name: 'sech',\n category: 'Trigonometry',\n syntax: ['sech(x)'],\n description: 'Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)',\n examples: ['sech(2)', '1 / cosh(2)'],\n seealso: ['coth', 'csch', 'cosh']\n};","export var sinDocs = {\n name: 'sin',\n category: 'Trigonometry',\n syntax: ['sin(x)'],\n description: 'Compute the sine of x in radians.',\n examples: ['sin(2)', 'sin(pi / 4) ^ 2', 'sin(90 deg)', 'sin(30 deg)', 'sin(0.2)^2 + cos(0.2)^2'],\n seealso: ['asin', 'cos', 'tan']\n};","export var sinhDocs = {\n name: 'sinh',\n category: 'Trigonometry',\n syntax: ['sinh(x)'],\n description: 'Compute the hyperbolic sine of x in radians.',\n examples: ['sinh(0.5)'],\n seealso: ['cosh', 'tanh']\n};","export var tanDocs = {\n name: 'tan',\n category: 'Trigonometry',\n syntax: ['tan(x)'],\n description: 'Compute the tangent of x in radians.',\n examples: ['tan(0.5)', 'sin(0.5) / cos(0.5)', 'tan(pi / 4)', 'tan(45 deg)'],\n seealso: ['atan', 'sin', 'cos']\n};","export var tanhDocs = {\n name: 'tanh',\n category: 'Trigonometry',\n syntax: ['tanh(x)'],\n description: 'Compute the hyperbolic tangent of x in radians.',\n examples: ['tanh(0.5)', 'sinh(0.5) / cosh(0.5)'],\n seealso: ['sinh', 'cosh']\n};","export var toDocs = {\n name: 'to',\n category: 'Units',\n syntax: ['x to unit', 'to(x, unit)'],\n description: 'Change the unit of a value.',\n examples: ['5 inch to cm', '3.2kg to g', '16 bytes in bits'],\n seealso: []\n};","export var toBestDocs = {\n name: 'toBest',\n category: 'Units',\n syntax: ['toBest(x)', 'toBest(x, unitList)', 'toBest(x, unitList, options)'],\n description: 'Converts to the most appropriate display unit.',\n examples: ['toBest(unit(5000, \"m\"))', 'toBest(unit(3500000, \"W\"))', 'toBest(unit(0.000000123, \"A\"))', 'toBest(unit(10, \"m\"), \"cm\")', 'toBest(unit(10, \"m\"), \"mm,km\", {offset: 1.5})'],\n seealso: []\n};","export var binDocs = {\n name: 'bin',\n category: 'Utils',\n syntax: ['bin(value)'],\n description: 'Format a number as binary',\n examples: ['bin(2)'],\n seealso: ['oct', 'hex']\n};","export var cloneDocs = {\n name: 'clone',\n category: 'Utils',\n syntax: ['clone(x)'],\n description: 'Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices',\n examples: ['clone(3.5)', 'clone(2 - 4i)', 'clone(45 deg)', 'clone([1, 2; 3, 4])', 'clone(\"hello world\")'],\n seealso: []\n};","export var formatDocs = {\n name: 'format',\n category: 'Utils',\n syntax: ['format(value)', 'format(value, precision)'],\n description: 'Format a value of any type as string.',\n examples: ['format(2.3)', 'format(3 - 4i)', 'format([])', 'format(pi, 3)'],\n seealso: ['print']\n};","export var hasNumericValueDocs = {\n name: 'hasNumericValue',\n category: 'Utils',\n syntax: ['hasNumericValue(x)'],\n description: 'Test whether a value is an numeric value. ' + 'In case of a string, true is returned if the string contains a numeric value.',\n examples: ['hasNumericValue(2)', 'hasNumericValue(\"2\")', 'isNumeric(\"2\")', 'hasNumericValue(0)', 'hasNumericValue(bignumber(500))', 'hasNumericValue(fraction(0.125))', 'hasNumericValue(2 + 3i)', 'hasNumericValue([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'isNumeric']\n};","export var hexDocs = {\n name: 'hex',\n category: 'Utils',\n syntax: ['hex(value)'],\n description: 'Format a number as hexadecimal',\n examples: ['hex(240)'],\n seealso: ['bin', 'oct']\n};","export var isIntegerDocs = {\n name: 'isInteger',\n category: 'Utils',\n syntax: ['isInteger(x)'],\n description: 'Test whether a value is an integer number.',\n examples: ['isInteger(2)', 'isInteger(3.5)', 'isInteger([3, 0.5, -2])'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero']\n};","export var isNaNDocs = {\n name: 'isNaN',\n category: 'Utils',\n syntax: ['isNaN(x)'],\n description: 'Test whether a value is NaN (not a number)',\n examples: ['isNaN(2)', 'isNaN(0 / 0)', 'isNaN(NaN)', 'isNaN(Infinity)'],\n seealso: ['isNegative', 'isNumeric', 'isPositive', 'isZero', 'isFinite', 'isBounded']\n};","export var isBoundedDocs = {\n name: 'isBounded',\n category: 'Utils',\n syntax: ['isBounded(x)'],\n description: 'Test whether a value or its entries are bounded.',\n examples: ['isBounded(Infinity)', 'isBounded(bigint(3))', 'isBounded([3, -Infinity, -3])'],\n seealso: ['isFinite', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\n};","export var isFiniteDocs = {\n name: 'isFinite',\n category: 'Utils',\n syntax: ['isFinite(x)'],\n description: 'Test whether a value is finite, elementwise on collections.',\n examples: ['isFinite(Infinity)', 'isFinite(bigint(3))', 'isFinite([3, -Infinity, -3])'],\n seealso: ['isBounded', 'isNumeric', 'isNaN', 'isNegative', 'isPositive']\n};","export var isNegativeDocs = {\n name: 'isNegative',\n category: 'Utils',\n syntax: ['isNegative(x)'],\n description: 'Test whether a value is negative: smaller than zero.',\n examples: ['isNegative(2)', 'isNegative(0)', 'isNegative(-4)', 'isNegative([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isPositive', 'isZero']\n};","export var isNumericDocs = {\n name: 'isNumeric',\n category: 'Utils',\n syntax: ['isNumeric(x)'],\n description: 'Test whether a value is a numeric value. ' + 'Returns true when the input is a number, BigNumber, Fraction, or boolean.',\n examples: ['isNumeric(2)', 'isNumeric(\"2\")', 'hasNumericValue(\"2\")', 'isNumeric(0)', 'isNumeric(bignumber(500))', 'isNumeric(fraction(0.125))', 'isNumeric(2 + 3i)', 'isNumeric([2.3, \"foo\", false])'],\n seealso: ['isInteger', 'isZero', 'isNegative', 'isPositive', 'isNaN', 'hasNumericValue', 'isFinite', 'isBounded']\n};","export var isPositiveDocs = {\n name: 'isPositive',\n category: 'Utils',\n syntax: ['isPositive(x)'],\n description: 'Test whether a value is positive: larger than zero.',\n examples: ['isPositive(2)', 'isPositive(0)', 'isPositive(-4)', 'isPositive([3, 0.5, -2])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};","export var isPrimeDocs = {\n name: 'isPrime',\n category: 'Utils',\n syntax: ['isPrime(x)'],\n description: 'Test whether a value is prime: has no divisors other than itself and one.',\n examples: ['isPrime(3)', 'isPrime(-2)', 'isPrime([2, 17, 100])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isZero']\n};","export var isZeroDocs = {\n name: 'isZero',\n category: 'Utils',\n syntax: ['isZero(x)'],\n description: 'Test whether a value is zero.',\n examples: ['isZero(2)', 'isZero(0)', 'isZero(-4)', 'isZero([3, 0, -2, 0])'],\n seealso: ['isInteger', 'isNumeric', 'isNegative', 'isPositive']\n};","export var numericDocs = {\n name: 'numeric',\n category: 'Utils',\n syntax: ['numeric(x)'],\n description: 'Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.',\n examples: ['numeric(\"4\")', 'numeric(\"4\", \"number\")', 'numeric(\"4\", \"bigint\")', 'numeric(\"4\", \"BigNumber\")', 'numeric(\"4\", \"Fraction\")', 'numeric(4, \"Fraction\")', 'numeric(fraction(2, 5), \"number\")'],\n seealso: ['number', 'bigint', 'fraction', 'bignumber', 'string', 'format']\n};","export var octDocs = {\n name: 'oct',\n category: 'Utils',\n syntax: ['oct(value)'],\n description: 'Format a number as octal',\n examples: ['oct(56)'],\n seealso: ['bin', 'hex']\n};","export var printDocs = {\n name: 'print',\n category: 'Utils',\n syntax: ['print(template, values)', 'print(template, values, precision)'],\n description: 'Interpolate values into a string template.',\n examples: ['print(\"Lucy is $age years old\", {age: 5})', 'print(\"The value of pi is $pi\", {pi: pi}, 3)', 'print(\"Hello, $user.name!\", {user: {name: \"John\"}})', 'print(\"Values: $1, $2, $3\", [6, 9, 4])'],\n seealso: ['format']\n};","export var typeOfDocs = {\n name: 'typeOf',\n category: 'Utils',\n syntax: ['typeOf(x)'],\n description: 'Get the type of a variable.',\n examples: ['typeOf(3.5)', 'typeOf(2 - 4i)', 'typeOf(45 deg)', 'typeOf(\"hello world\")'],\n seealso: ['getMatrixDataType']\n};","export var solveODEDocs = {\n name: 'solveODE',\n category: 'Numeric',\n syntax: ['solveODE(func, tspan, y0)', 'solveODE(func, tspan, y0, options)'],\n description: 'Numerical Integration of Ordinary Differential Equations.',\n examples: ['f(t,y) = y', 'tspan = [0, 4]', 'solveODE(f, tspan, 1)', 'solveODE(f, tspan, [1, 2])', 'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],\n seealso: ['derivative', 'simplifyCore']\n};","import { eDocs } from './constants/e.js';\nimport { falseDocs } from './constants/false.js';\nimport { iDocs } from './constants/i.js';\nimport { InfinityDocs } from './constants/Infinity.js';\nimport { LN10Docs } from './constants/LN10.js';\nimport { LN2Docs } from './constants/LN2.js';\nimport { LOG10EDocs } from './constants/LOG10E.js';\nimport { LOG2EDocs } from './constants/LOG2E.js';\nimport { NaNDocs } from './constants/NaN.js';\nimport { nullDocs } from './constants/null.js';\nimport { phiDocs } from './constants/phi.js';\nimport { piDocs } from './constants/pi.js';\nimport { SQRT12Docs } from './constants/SQRT1_2.js';\nimport { SQRT2Docs } from './constants/SQRT2.js';\nimport { tauDocs } from './constants/tau.js';\nimport { trueDocs } from './constants/true.js';\nimport { versionDocs } from './constants/version.js';\nimport { bignumberDocs } from './construction/bignumber.js';\nimport { bigintDocs } from './construction/bigint.js';\nimport { booleanDocs } from './construction/boolean.js';\nimport { complexDocs } from './construction/complex.js';\nimport { createUnitDocs } from './construction/createUnit.js';\nimport { fractionDocs } from './construction/fraction.js';\nimport { indexDocs } from './construction/index.js';\nimport { matrixDocs } from './construction/matrix.js';\nimport { numberDocs } from './construction/number.js';\nimport { sparseDocs } from './construction/sparse.js';\nimport { splitUnitDocs } from './construction/splitUnit.js';\nimport { stringDocs } from './construction/string.js';\nimport { unitDocs } from './construction/unit.js';\nimport { configDocs } from './core/config.js';\nimport { importDocs } from './core/import.js';\nimport { typedDocs } from './core/typed.js';\nimport { derivativeDocs } from './function/algebra/derivative.js';\nimport { leafCountDocs } from './function/algebra/leafCount.js';\nimport { lsolveDocs } from './function/algebra/lsolve.js';\nimport { lsolveAllDocs } from './function/algebra/lsolveAll.js';\nimport { lupDocs } from './function/algebra/lup.js';\nimport { lusolveDocs } from './function/algebra/lusolve.js';\nimport { polynomialRootDocs } from './function/algebra/polynomialRoot.js';\nimport { qrDocs } from './function/algebra/qr.js';\nimport { rationalizeDocs } from './function/algebra/rationalize.js';\nimport { resolveDocs } from './function/algebra/resolve.js';\nimport { simplifyDocs } from './function/algebra/simplify.js';\nimport { simplifyConstantDocs } from './function/algebra/simplifyConstant.js';\nimport { simplifyCoreDocs } from './function/algebra/simplifyCore.js';\nimport { sluDocs } from './function/algebra/slu.js';\nimport { symbolicEqualDocs } from './function/algebra/symbolicEqual.js';\nimport { usolveDocs } from './function/algebra/usolve.js';\nimport { usolveAllDocs } from './function/algebra/usolveAll.js';\nimport { absDocs } from './function/arithmetic/abs.js';\nimport { addDocs } from './function/arithmetic/add.js';\nimport { cbrtDocs } from './function/arithmetic/cbrt.js';\nimport { ceilDocs } from './function/arithmetic/ceil.js';\nimport { cubeDocs } from './function/arithmetic/cube.js';\nimport { divideDocs } from './function/arithmetic/divide.js';\nimport { dotDivideDocs } from './function/arithmetic/dotDivide.js';\nimport { dotMultiplyDocs } from './function/arithmetic/dotMultiply.js';\nimport { dotPowDocs } from './function/arithmetic/dotPow.js';\nimport { expDocs } from './function/arithmetic/exp.js';\nimport { expmDocs } from './function/arithmetic/expm.js';\nimport { expm1Docs } from './function/arithmetic/expm1.js';\nimport { fixDocs } from './function/arithmetic/fix.js';\nimport { floorDocs } from './function/arithmetic/floor.js';\nimport { gcdDocs } from './function/arithmetic/gcd.js';\nimport { hypotDocs } from './function/arithmetic/hypot.js';\nimport { invmodDocs } from './function/arithmetic/invmod.js';\nimport { lcmDocs } from './function/arithmetic/lcm.js';\nimport { logDocs } from './function/arithmetic/log.js';\nimport { log10Docs } from './function/arithmetic/log10.js';\nimport { log1pDocs } from './function/arithmetic/log1p.js';\nimport { log2Docs } from './function/arithmetic/log2.js';\nimport { modDocs } from './function/arithmetic/mod.js';\nimport { multiplyDocs } from './function/arithmetic/multiply.js';\nimport { normDocs } from './function/arithmetic/norm.js';\nimport { nthRootDocs } from './function/arithmetic/nthRoot.js';\nimport { nthRootsDocs } from './function/arithmetic/nthRoots.js';\nimport { powDocs } from './function/arithmetic/pow.js';\nimport { roundDocs } from './function/arithmetic/round.js';\nimport { signDocs } from './function/arithmetic/sign.js';\nimport { sqrtDocs } from './function/arithmetic/sqrt.js';\nimport { sqrtmDocs } from './function/arithmetic/sqrtm.js';\nimport { sylvesterDocs } from './function/algebra/sylvester.js';\nimport { schurDocs } from './function/algebra/schur.js';\nimport { lyapDocs } from './function/algebra/lyap.js';\nimport { squareDocs } from './function/arithmetic/square.js';\nimport { subtractDocs } from './function/arithmetic/subtract.js';\nimport { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';\nimport { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';\nimport { xgcdDocs } from './function/arithmetic/xgcd.js';\nimport { numDocs } from './function/fraction/num.js';\nimport { denDocs } from './function/fraction/den.js';\nimport { bitAndDocs } from './function/bitwise/bitAnd.js';\nimport { bitNotDocs } from './function/bitwise/bitNot.js';\nimport { bitOrDocs } from './function/bitwise/bitOr.js';\nimport { bitXorDocs } from './function/bitwise/bitXor.js';\nimport { leftShiftDocs } from './function/bitwise/leftShift.js';\nimport { rightArithShiftDocs } from './function/bitwise/rightArithShift.js';\nimport { rightLogShiftDocs } from './function/bitwise/rightLogShift.js';\nimport { bellNumbersDocs } from './function/combinatorics/bellNumbers.js';\nimport { catalanDocs } from './function/combinatorics/catalan.js';\nimport { compositionDocs } from './function/combinatorics/composition.js';\nimport { stirlingS2Docs } from './function/combinatorics/stirlingS2.js';\nimport { argDocs } from './function/complex/arg.js';\nimport { conjDocs } from './function/complex/conj.js';\nimport { imDocs } from './function/complex/im.js';\nimport { reDocs } from './function/complex/re.js';\nimport { evaluateDocs } from './function/expression/evaluate.js';\nimport { parserDocs } from './function/expression/parser.js';\nimport { parseDocs } from './function/expression/parse.js';\nimport { compileDocs } from './function/expression/compile.js';\nimport { helpDocs } from './function/expression/help.js';\nimport { distanceDocs } from './function/geometry/distance.js';\nimport { intersectDocs } from './function/geometry/intersect.js';\nimport { andDocs } from './function/logical/and.js';\nimport { notDocs } from './function/logical/not.js';\nimport { nullishDocs } from './function/logical/nullish.js';\nimport { orDocs } from './function/logical/or.js';\nimport { xorDocs } from './function/logical/xor.js';\nimport { mapSlicesDocs } from './function/matrix/mapSlices.js';\nimport { columnDocs } from './function/matrix/column.js';\nimport { concatDocs } from './function/matrix/concat.js';\nimport { countDocs } from './function/matrix/count.js';\nimport { crossDocs } from './function/matrix/cross.js';\nimport { ctransposeDocs } from './function/matrix/ctranspose.js';\nimport { detDocs } from './function/matrix/det.js';\nimport { diagDocs } from './function/matrix/diag.js';\nimport { diffDocs } from './function/matrix/diff.js';\nimport { dotDocs } from './function/matrix/dot.js';\nimport { eigsDocs } from './function/matrix/eigs.js';\nimport { filterDocs } from './function/matrix/filter.js';\nimport { flattenDocs } from './function/matrix/flatten.js';\nimport { forEachDocs } from './function/matrix/forEach.js';\nimport { getMatrixDataTypeDocs } from './function/matrix/getMatrixDataType.js';\nimport { identityDocs } from './function/matrix/identity.js';\nimport { invDocs } from './function/matrix/inv.js';\nimport { pinvDocs } from './function/matrix/pinv.js';\nimport { kronDocs } from './function/matrix/kron.js';\nimport { mapDocs } from './function/matrix/map.js';\nimport { matrixFromColumnsDocs } from './function/matrix/matrixFromColumns.js';\nimport { matrixFromFunctionDocs } from './function/matrix/matrixFromFunction.js';\nimport { matrixFromRowsDocs } from './function/matrix/matrixFromRows.js';\nimport { onesDocs } from './function/matrix/ones.js';\nimport { partitionSelectDocs } from './function/matrix/partitionSelect.js';\nimport { rangeDocs } from './function/matrix/range.js';\nimport { reshapeDocs } from './function/matrix/reshape.js';\nimport { resizeDocs } from './function/matrix/resize.js';\nimport { rotateDocs } from './function/matrix/rotate.js';\nimport { rotationMatrixDocs } from './function/matrix/rotationMatrix.js';\nimport { rowDocs } from './function/matrix/row.js';\nimport { sizeDocs } from './function/matrix/size.js';\nimport { sortDocs } from './function/matrix/sort.js';\nimport { squeezeDocs } from './function/matrix/squeeze.js';\nimport { subsetDocs } from './function/matrix/subset.js';\nimport { traceDocs } from './function/matrix/trace.js';\nimport { transposeDocs } from './function/matrix/transpose.js';\nimport { zerosDocs } from './function/matrix/zeros.js';\nimport { fftDocs } from './function/matrix/fft.js';\nimport { ifftDocs } from './function/matrix/ifft.js';\nimport { bernoulliDocs } from './function/probability/bernoulli.js';\nimport { combinationsDocs } from './function/probability/combinations.js';\nimport { combinationsWithRepDocs } from './function/probability/combinationsWithRep.js';\nimport { factorialDocs } from './function/probability/factorial.js';\nimport { gammaDocs } from './function/probability/gamma.js';\nimport { lgammaDocs } from './function/probability/lgamma.js';\nimport { kldivergenceDocs } from './function/probability/kldivergence.js';\nimport { multinomialDocs } from './function/probability/multinomial.js';\nimport { permutationsDocs } from './function/probability/permutations.js';\nimport { pickRandomDocs } from './function/probability/pickRandom.js';\nimport { randomDocs } from './function/probability/random.js';\nimport { randomIntDocs } from './function/probability/randomInt.js';\nimport { compareDocs } from './function/relational/compare.js';\nimport { compareNaturalDocs } from './function/relational/compareNatural.js';\nimport { compareTextDocs } from './function/relational/compareText.js';\nimport { deepEqualDocs } from './function/relational/deepEqual.js';\nimport { equalDocs } from './function/relational/equal.js';\nimport { equalTextDocs } from './function/relational/equalText.js';\nimport { largerDocs } from './function/relational/larger.js';\nimport { largerEqDocs } from './function/relational/largerEq.js';\nimport { smallerDocs } from './function/relational/smaller.js';\nimport { smallerEqDocs } from './function/relational/smallerEq.js';\nimport { unequalDocs } from './function/relational/unequal.js';\nimport { setCartesianDocs } from './function/set/setCartesian.js';\nimport { setDifferenceDocs } from './function/set/setDifference.js';\nimport { setDistinctDocs } from './function/set/setDistinct.js';\nimport { setIntersectDocs } from './function/set/setIntersect.js';\nimport { setIsSubsetDocs } from './function/set/setIsSubset.js';\nimport { setMultiplicityDocs } from './function/set/setMultiplicity.js';\nimport { setPowersetDocs } from './function/set/setPowerset.js';\nimport { setSizeDocs } from './function/set/setSize.js';\nimport { setSymDifferenceDocs } from './function/set/setSymDifference.js';\nimport { setUnionDocs } from './function/set/setUnion.js';\nimport { zpk2tfDocs } from './function/signal/zpk2tf.js';\nimport { freqzDocs } from './function/signal/freqz.js';\nimport { erfDocs } from './function/special/erf.js';\nimport { zetaDocs } from './function/special/zeta.js';\nimport { madDocs } from './function/statistics/mad.js';\nimport { maxDocs } from './function/statistics/max.js';\nimport { meanDocs } from './function/statistics/mean.js';\nimport { medianDocs } from './function/statistics/median.js';\nimport { minDocs } from './function/statistics/min.js';\nimport { modeDocs } from './function/statistics/mode.js';\nimport { prodDocs } from './function/statistics/prod.js';\nimport { quantileSeqDocs } from './function/statistics/quantileSeq.js';\nimport { stdDocs } from './function/statistics/std.js';\nimport { cumSumDocs } from './function/statistics/cumsum.js';\nimport { sumDocs } from './function/statistics/sum.js';\nimport { varianceDocs } from './function/statistics/variance.js';\nimport { corrDocs } from './function/statistics/corr.js';\nimport { acosDocs } from './function/trigonometry/acos.js';\nimport { acoshDocs } from './function/trigonometry/acosh.js';\nimport { acotDocs } from './function/trigonometry/acot.js';\nimport { acothDocs } from './function/trigonometry/acoth.js';\nimport { acscDocs } from './function/trigonometry/acsc.js';\nimport { acschDocs } from './function/trigonometry/acsch.js';\nimport { asecDocs } from './function/trigonometry/asec.js';\nimport { asechDocs } from './function/trigonometry/asech.js';\nimport { asinDocs } from './function/trigonometry/asin.js';\nimport { asinhDocs } from './function/trigonometry/asinh.js';\nimport { atanDocs } from './function/trigonometry/atan.js';\nimport { atan2Docs } from './function/trigonometry/atan2.js';\nimport { atanhDocs } from './function/trigonometry/atanh.js';\nimport { cosDocs } from './function/trigonometry/cos.js';\nimport { coshDocs } from './function/trigonometry/cosh.js';\nimport { cotDocs } from './function/trigonometry/cot.js';\nimport { cothDocs } from './function/trigonometry/coth.js';\nimport { cscDocs } from './function/trigonometry/csc.js';\nimport { cschDocs } from './function/trigonometry/csch.js';\nimport { secDocs } from './function/trigonometry/sec.js';\nimport { sechDocs } from './function/trigonometry/sech.js';\nimport { sinDocs } from './function/trigonometry/sin.js';\nimport { sinhDocs } from './function/trigonometry/sinh.js';\nimport { tanDocs } from './function/trigonometry/tan.js';\nimport { tanhDocs } from './function/trigonometry/tanh.js';\nimport { toDocs } from './function/units/to.js';\nimport { toBestDocs } from './function/units/toBest.js';\nimport { binDocs } from './function/utils/bin.js';\nimport { cloneDocs } from './function/utils/clone.js';\nimport { formatDocs } from './function/utils/format.js';\nimport { hasNumericValueDocs } from './function/utils/hasNumericValue.js';\nimport { hexDocs } from './function/utils/hex.js';\nimport { isIntegerDocs } from './function/utils/isInteger.js';\nimport { isNaNDocs } from './function/utils/isNaN.js';\nimport { isBoundedDocs } from './function/utils/isBounded.js';\nimport { isFiniteDocs } from './function/utils/isFinite.js';\nimport { isNegativeDocs } from './function/utils/isNegative.js';\nimport { isNumericDocs } from './function/utils/isNumeric.js';\nimport { isPositiveDocs } from './function/utils/isPositive.js';\nimport { isPrimeDocs } from './function/utils/isPrime.js';\nimport { isZeroDocs } from './function/utils/isZero.js';\nimport { numericDocs } from './function/utils/numeric.js';\nimport { octDocs } from './function/utils/oct.js';\nimport { printDocs } from './function/utils/print.js';\nimport { typeOfDocs } from './function/utils/typeOf.js';\nimport { solveODEDocs } from './function/numeric/solveODE.js';\nexport var embeddedDocs = {\n // construction functions\n bignumber: bignumberDocs,\n bigint: bigintDocs,\n boolean: booleanDocs,\n complex: complexDocs,\n createUnit: createUnitDocs,\n fraction: fractionDocs,\n index: indexDocs,\n matrix: matrixDocs,\n number: numberDocs,\n sparse: sparseDocs,\n splitUnit: splitUnitDocs,\n string: stringDocs,\n unit: unitDocs,\n // constants\n e: eDocs,\n E: eDocs,\n false: falseDocs,\n i: iDocs,\n Infinity: InfinityDocs,\n LN2: LN2Docs,\n LN10: LN10Docs,\n LOG2E: LOG2EDocs,\n LOG10E: LOG10EDocs,\n NaN: NaNDocs,\n null: nullDocs,\n pi: piDocs,\n PI: piDocs,\n phi: phiDocs,\n SQRT1_2: SQRT12Docs,\n SQRT2: SQRT2Docs,\n tau: tauDocs,\n true: trueDocs,\n version: versionDocs,\n // physical constants\n // TODO: more detailed docs for physical constants\n speedOfLight: {\n description: 'Speed of light in vacuum',\n examples: ['speedOfLight']\n },\n gravitationConstant: {\n description: 'Newtonian constant of gravitation',\n examples: ['gravitationConstant']\n },\n planckConstant: {\n description: 'Planck constant',\n examples: ['planckConstant']\n },\n reducedPlanckConstant: {\n description: 'Reduced Planck constant',\n examples: ['reducedPlanckConstant']\n },\n magneticConstant: {\n description: 'Magnetic constant (vacuum permeability)',\n examples: ['magneticConstant']\n },\n electricConstant: {\n description: 'Electric constant (vacuum permeability)',\n examples: ['electricConstant']\n },\n vacuumImpedance: {\n description: 'Characteristic impedance of vacuum',\n examples: ['vacuumImpedance']\n },\n coulomb: {\n description: 'Coulomb\\'s constant. Deprecated in favor of coulombConstant',\n examples: ['coulombConstant']\n },\n coulombConstant: {\n description: 'Coulomb\\'s constant',\n examples: ['coulombConstant']\n },\n elementaryCharge: {\n description: 'Elementary charge',\n examples: ['elementaryCharge']\n },\n bohrMagneton: {\n description: 'Bohr magneton',\n examples: ['bohrMagneton']\n },\n conductanceQuantum: {\n description: 'Conductance quantum',\n examples: ['conductanceQuantum']\n },\n inverseConductanceQuantum: {\n description: 'Inverse conductance quantum',\n examples: ['inverseConductanceQuantum']\n },\n // josephson: {description: 'Josephson constant', examples: ['josephson']},\n magneticFluxQuantum: {\n description: 'Magnetic flux quantum',\n examples: ['magneticFluxQuantum']\n },\n nuclearMagneton: {\n description: 'Nuclear magneton',\n examples: ['nuclearMagneton']\n },\n klitzing: {\n description: 'Von Klitzing constant',\n examples: ['klitzing']\n },\n bohrRadius: {\n description: 'Bohr radius',\n examples: ['bohrRadius']\n },\n classicalElectronRadius: {\n description: 'Classical electron radius',\n examples: ['classicalElectronRadius']\n },\n electronMass: {\n description: 'Electron mass',\n examples: ['electronMass']\n },\n fermiCoupling: {\n description: 'Fermi coupling constant',\n examples: ['fermiCoupling']\n },\n fineStructure: {\n description: 'Fine-structure constant',\n examples: ['fineStructure']\n },\n hartreeEnergy: {\n description: 'Hartree energy',\n examples: ['hartreeEnergy']\n },\n protonMass: {\n description: 'Proton mass',\n examples: ['protonMass']\n },\n deuteronMass: {\n description: 'Deuteron Mass',\n examples: ['deuteronMass']\n },\n neutronMass: {\n description: 'Neutron mass',\n examples: ['neutronMass']\n },\n quantumOfCirculation: {\n description: 'Quantum of circulation',\n examples: ['quantumOfCirculation']\n },\n rydberg: {\n description: 'Rydberg constant',\n examples: ['rydberg']\n },\n thomsonCrossSection: {\n description: 'Thomson cross section',\n examples: ['thomsonCrossSection']\n },\n weakMixingAngle: {\n description: 'Weak mixing angle',\n examples: ['weakMixingAngle']\n },\n efimovFactor: {\n description: 'Efimov factor',\n examples: ['efimovFactor']\n },\n atomicMass: {\n description: 'Atomic mass constant',\n examples: ['atomicMass']\n },\n avogadro: {\n description: 'Avogadro\\'s number',\n examples: ['avogadro']\n },\n boltzmann: {\n description: 'Boltzmann constant',\n examples: ['boltzmann']\n },\n faraday: {\n description: 'Faraday constant',\n examples: ['faraday']\n },\n firstRadiation: {\n description: 'First radiation constant',\n examples: ['firstRadiation']\n },\n loschmidt: {\n description: 'Loschmidt constant at T=273.15 K and p=101.325 kPa',\n examples: ['loschmidt']\n },\n gasConstant: {\n description: 'Gas constant',\n examples: ['gasConstant']\n },\n molarPlanckConstant: {\n description: 'Molar Planck constant',\n examples: ['molarPlanckConstant']\n },\n molarVolume: {\n description: 'Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa',\n examples: ['molarVolume']\n },\n sackurTetrode: {\n description: 'Sackur-Tetrode constant at T=1 K and p=101.325 kPa',\n examples: ['sackurTetrode']\n },\n secondRadiation: {\n description: 'Second radiation constant',\n examples: ['secondRadiation']\n },\n stefanBoltzmann: {\n description: 'Stefan-Boltzmann constant',\n examples: ['stefanBoltzmann']\n },\n wienDisplacement: {\n description: 'Wien displacement law constant',\n examples: ['wienDisplacement']\n },\n // spectralRadiance: {description: 'First radiation constant for spectral radiance', examples: ['spectralRadiance']},\n\n molarMass: {\n description: 'Molar mass constant',\n examples: ['molarMass']\n },\n molarMassC12: {\n description: 'Molar mass constant of carbon-12',\n examples: ['molarMassC12']\n },\n gravity: {\n description: 'Standard acceleration of gravity (standard acceleration of free-fall on Earth)',\n examples: ['gravity']\n },\n planckLength: {\n description: 'Planck length',\n examples: ['planckLength']\n },\n planckMass: {\n description: 'Planck mass',\n examples: ['planckMass']\n },\n planckTime: {\n description: 'Planck time',\n examples: ['planckTime']\n },\n planckCharge: {\n description: 'Planck charge',\n examples: ['planckCharge']\n },\n planckTemperature: {\n description: 'Planck temperature',\n examples: ['planckTemperature']\n },\n // functions - algebra\n derivative: derivativeDocs,\n lsolve: lsolveDocs,\n lsolveAll: lsolveAllDocs,\n lup: lupDocs,\n lusolve: lusolveDocs,\n leafCount: leafCountDocs,\n polynomialRoot: polynomialRootDocs,\n resolve: resolveDocs,\n simplify: simplifyDocs,\n simplifyConstant: simplifyConstantDocs,\n simplifyCore: simplifyCoreDocs,\n symbolicEqual: symbolicEqualDocs,\n rationalize: rationalizeDocs,\n slu: sluDocs,\n usolve: usolveDocs,\n usolveAll: usolveAllDocs,\n qr: qrDocs,\n // functions - arithmetic\n abs: absDocs,\n add: addDocs,\n cbrt: cbrtDocs,\n ceil: ceilDocs,\n cube: cubeDocs,\n divide: divideDocs,\n dotDivide: dotDivideDocs,\n dotMultiply: dotMultiplyDocs,\n dotPow: dotPowDocs,\n exp: expDocs,\n expm: expmDocs,\n expm1: expm1Docs,\n fix: fixDocs,\n floor: floorDocs,\n gcd: gcdDocs,\n hypot: hypotDocs,\n lcm: lcmDocs,\n log: logDocs,\n log2: log2Docs,\n log1p: log1pDocs,\n log10: log10Docs,\n mod: modDocs,\n multiply: multiplyDocs,\n norm: normDocs,\n nthRoot: nthRootDocs,\n nthRoots: nthRootsDocs,\n pow: powDocs,\n round: roundDocs,\n sign: signDocs,\n sqrt: sqrtDocs,\n sqrtm: sqrtmDocs,\n square: squareDocs,\n subtract: subtractDocs,\n unaryMinus: unaryMinusDocs,\n unaryPlus: unaryPlusDocs,\n xgcd: xgcdDocs,\n invmod: invmodDocs,\n num: numDocs,\n den: denDocs,\n // functions - bitwise\n bitAnd: bitAndDocs,\n bitNot: bitNotDocs,\n bitOr: bitOrDocs,\n bitXor: bitXorDocs,\n leftShift: leftShiftDocs,\n rightArithShift: rightArithShiftDocs,\n rightLogShift: rightLogShiftDocs,\n // functions - combinatorics\n bellNumbers: bellNumbersDocs,\n catalan: catalanDocs,\n composition: compositionDocs,\n stirlingS2: stirlingS2Docs,\n // functions - core\n config: configDocs,\n import: importDocs,\n typed: typedDocs,\n // functions - complex\n arg: argDocs,\n conj: conjDocs,\n re: reDocs,\n im: imDocs,\n // functions - expression\n evaluate: evaluateDocs,\n help: helpDocs,\n parse: parseDocs,\n parser: parserDocs,\n compile: compileDocs,\n // functions - geometry\n distance: distanceDocs,\n intersect: intersectDocs,\n // functions - logical\n and: andDocs,\n not: notDocs,\n nullish: nullishDocs,\n or: orDocs,\n xor: xorDocs,\n // functions - matrix\n mapSlices: mapSlicesDocs,\n concat: concatDocs,\n count: countDocs,\n cross: crossDocs,\n column: columnDocs,\n ctranspose: ctransposeDocs,\n det: detDocs,\n diag: diagDocs,\n diff: diffDocs,\n dot: dotDocs,\n getMatrixDataType: getMatrixDataTypeDocs,\n identity: identityDocs,\n filter: filterDocs,\n flatten: flattenDocs,\n forEach: forEachDocs,\n inv: invDocs,\n pinv: pinvDocs,\n eigs: eigsDocs,\n kron: kronDocs,\n matrixFromFunction: matrixFromFunctionDocs,\n matrixFromRows: matrixFromRowsDocs,\n matrixFromColumns: matrixFromColumnsDocs,\n map: mapDocs,\n ones: onesDocs,\n partitionSelect: partitionSelectDocs,\n range: rangeDocs,\n resize: resizeDocs,\n reshape: reshapeDocs,\n rotate: rotateDocs,\n rotationMatrix: rotationMatrixDocs,\n row: rowDocs,\n size: sizeDocs,\n sort: sortDocs,\n squeeze: squeezeDocs,\n subset: subsetDocs,\n trace: traceDocs,\n transpose: transposeDocs,\n zeros: zerosDocs,\n fft: fftDocs,\n ifft: ifftDocs,\n sylvester: sylvesterDocs,\n schur: schurDocs,\n lyap: lyapDocs,\n // functions - numeric\n solveODE: solveODEDocs,\n // functions - probability\n bernoulli: bernoulliDocs,\n combinations: combinationsDocs,\n combinationsWithRep: combinationsWithRepDocs,\n // distribution: distributionDocs,\n factorial: factorialDocs,\n gamma: gammaDocs,\n kldivergence: kldivergenceDocs,\n lgamma: lgammaDocs,\n multinomial: multinomialDocs,\n permutations: permutationsDocs,\n pickRandom: pickRandomDocs,\n random: randomDocs,\n randomInt: randomIntDocs,\n // functions - relational\n compare: compareDocs,\n compareNatural: compareNaturalDocs,\n compareText: compareTextDocs,\n deepEqual: deepEqualDocs,\n equal: equalDocs,\n equalText: equalTextDocs,\n larger: largerDocs,\n largerEq: largerEqDocs,\n smaller: smallerDocs,\n smallerEq: smallerEqDocs,\n unequal: unequalDocs,\n // functions - set\n setCartesian: setCartesianDocs,\n setDifference: setDifferenceDocs,\n setDistinct: setDistinctDocs,\n setIntersect: setIntersectDocs,\n setIsSubset: setIsSubsetDocs,\n setMultiplicity: setMultiplicityDocs,\n setPowerset: setPowersetDocs,\n setSize: setSizeDocs,\n setSymDifference: setSymDifferenceDocs,\n setUnion: setUnionDocs,\n // functions - signal\n zpk2tf: zpk2tfDocs,\n freqz: freqzDocs,\n // functions - special\n erf: erfDocs,\n zeta: zetaDocs,\n // functions - statistics\n cumsum: cumSumDocs,\n mad: madDocs,\n max: maxDocs,\n mean: meanDocs,\n median: medianDocs,\n min: minDocs,\n mode: modeDocs,\n prod: prodDocs,\n quantileSeq: quantileSeqDocs,\n std: stdDocs,\n sum: sumDocs,\n variance: varianceDocs,\n corr: corrDocs,\n // functions - trigonometry\n acos: acosDocs,\n acosh: acoshDocs,\n acot: acotDocs,\n acoth: acothDocs,\n acsc: acscDocs,\n acsch: acschDocs,\n asec: asecDocs,\n asech: asechDocs,\n asin: asinDocs,\n asinh: asinhDocs,\n atan: atanDocs,\n atanh: atanhDocs,\n atan2: atan2Docs,\n cos: cosDocs,\n cosh: coshDocs,\n cot: cotDocs,\n coth: cothDocs,\n csc: cscDocs,\n csch: cschDocs,\n sec: secDocs,\n sech: sechDocs,\n sin: sinDocs,\n sinh: sinhDocs,\n tan: tanDocs,\n tanh: tanhDocs,\n // functions - units\n to: toDocs,\n toBest: toBestDocs,\n // functions - utils\n clone: cloneDocs,\n format: formatDocs,\n bin: binDocs,\n oct: octDocs,\n hex: hexDocs,\n isNaN: isNaNDocs,\n isBounded: isBoundedDocs,\n isFinite: isFiniteDocs,\n isInteger: isIntegerDocs,\n isNegative: isNegativeDocs,\n isNumeric: isNumericDocs,\n hasNumericValue: hasNumericValueDocs,\n isPositive: isPositiveDocs,\n isPrime: isPrimeDocs,\n isZero: isZeroDocs,\n print: printDocs,\n typeOf: typeOfDocs,\n numeric: numericDocs\n};","import { factory } from '../../utils/factory.js';\nimport { getSafeProperty } from '../../utils/customs.js';\nimport { embeddedDocs } from '../embeddedDocs/embeddedDocs.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nvar name = 'help';\nvar dependencies = ['typed', 'mathWithTransform', 'Help'];\nexport var createHelp = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n mathWithTransform,\n Help\n } = _ref;\n /**\n * Retrieve help on a function or data type.\n * Help files are retrieved from the embedded documentation in math.docs.\n *\n * Syntax:\n *\n * math.help(search)\n *\n * Examples:\n *\n * console.log(math.help('sin').toString())\n * console.log(math.help(math.add).toString())\n * console.log(math.help(math.add).toJSON())\n *\n * @param {Function | string | Object} search A function or function name\n * for which to get help\n * @return {Help} A help object\n */\n return typed(name, {\n any: function any(search) {\n var prop;\n var searchName = search;\n if (typeof search !== 'string') {\n for (prop in mathWithTransform) {\n // search in functions and constants\n if (hasOwnProperty(mathWithTransform, prop) && search === mathWithTransform[prop]) {\n searchName = prop;\n break;\n }\n }\n\n /* TODO: implement help for data types\n if (!text) {\n // search data type\n for (prop in math.type) {\n if (hasOwnProperty(math, prop)) {\n if (search === math.type[prop]) {\n text = prop\n break\n }\n }\n }\n }\n */\n }\n var doc = getSafeProperty(embeddedDocs, searchName);\n if (!doc) {\n var searchText = typeof searchName === 'function' ? searchName.name : searchName;\n throw new Error('No documentation found on \"' + searchText + '\"');\n }\n return new Help(doc);\n }\n });\n});","import { factory } from '../../../utils/factory.js';\nvar name = 'chain';\nvar dependencies = ['typed', 'Chain'];\nexport var createChain = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Chain\n } = _ref;\n /**\n * Wrap any value in a chain, allowing to perform chained operations on\n * the value.\n *\n * All methods available in the math.js library can be called upon the chain,\n * and then will be evaluated with the value itself as first argument.\n * The chain can be closed by executing `chain.done()`, which returns\n * the final value.\n *\n * The chain has a number of special functions:\n *\n * - `done()` Finalize the chain and return the chain's value.\n * - `valueOf()` The same as `done()`\n * - `toString()` Executes `math.format()` onto the chain's value, returning\n * a string representation of the value.\n *\n * Syntax:\n *\n * math.chain(value)\n *\n * Examples:\n *\n * math.chain(3)\n * .add(4)\n * .subtract(2)\n * .done() // 5\n *\n * math.chain( [[1, 2], [3, 4]] )\n * .subset(math.index(0, 0), 8)\n * .multiply(3)\n * .done() // [[24, 6], [9, 12]]\n *\n * @param {*} [value] A value of any type on which to start a chained operation.\n * @return {math.Chain} The created chain\n */\n return typed(name, {\n '': function _() {\n return new Chain();\n },\n any: function any(value) {\n return new Chain(value);\n }\n });\n});","import { factory } from '../../utils/factory.js';\nvar name = 'leafCount';\nvar dependencies = ['parse', 'typed'];\nexport var createLeafCount = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n typed\n } = _ref;\n // This does the real work, but we don't have to recurse through\n // a typed call if we separate it out\n function countLeaves(node) {\n var count = 0;\n node.forEach(n => {\n count += countLeaves(n);\n });\n return count || 1;\n }\n\n /**\n * Gives the number of \"leaf nodes\" in the parse tree of the given expression\n * A leaf node is one that has no subexpressions, essentially either a\n * symbol or a constant. Note that `5!` has just one leaf, the '5'; the\n * unary factorial operator does not add a leaf. On the other hand,\n * function symbols do add leaves, so `sin(x)/cos(x)` has four leaves.\n *\n * The `simplify()` function should generally not increase the `leafCount()`\n * of an expression, although currently there is no guarantee that it never\n * does so. In many cases, `simplify()` reduces the leaf count.\n *\n * Syntax:\n *\n * math.leafCount(expr)\n *\n * Examples:\n *\n * math.leafCount('x') // 1\n * math.leafCount(math.parse('a*d-b*c')) // 4\n * math.leafCount('[a,b;c,d][0,1]') // 6\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to count the leaves of\n *\n * @return {number} The number of leaves of `expr`\n *\n */\n return typed(name, {\n Node: function Node(expr) {\n return countLeaves(expr);\n }\n });\n});","import { isConstantNode, isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nexport { isConstantNode, isSymbolNode as isVariableNode } from '../../../utils/is.js';\nexport function isNumericNode(x) {\n return isConstantNode(x) || isOperatorNode(x) && x.isUnary() && isConstantNode(x.args[0]);\n}\nexport function isConstantExpression(x) {\n if (isConstantNode(x)) {\n // Basic Constant types\n return true;\n }\n if ((isFunctionNode(x) || isOperatorNode(x)) && x.args.every(isConstantExpression)) {\n // Can be constant depending on arguments\n return true;\n }\n if (isParenthesisNode(x) && isConstantExpression(x.content)) {\n // Parenthesis are transparent\n return true;\n }\n return false; // Probably missing some edge cases\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { isFunctionNode, isOperatorNode, isParenthesisNode } from '../../../utils/is.js';\nimport { factory } from '../../../utils/factory.js';\nimport { hasOwnProperty } from '../../../utils/object.js';\nvar name = 'simplifyUtil';\nvar dependencies = ['FunctionNode', 'OperatorNode', 'SymbolNode'];\nexport var createUtil = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n FunctionNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n // TODO commutative/associative properties rely on the arguments\n // e.g. multiply is not commutative for matrices\n // The properties should be calculated from an argument to simplify, or possibly something in math.config\n // the other option is for typed() to specify a return type so that we can evaluate the type of arguments\n\n /* So that properties of an operator fit on one line: */\n var T = true;\n var F = false;\n var defaultName = 'defaultF';\n var defaultContext = {\n /* */add: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /**/unaryPlus: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */subtract: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */multiply: {\n trivial: T,\n total: T,\n commutative: T,\n associative: T\n },\n /* */divide: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n },\n /* */paren: {\n trivial: T,\n total: T,\n commutative: T,\n associative: F\n },\n /* */defaultF: {\n trivial: F,\n total: T,\n commutative: F,\n associative: F\n }\n };\n var realContext = {\n divide: {\n total: F\n },\n log: {\n total: F\n }\n };\n var positiveContext = {\n subtract: {\n total: F\n },\n abs: {\n trivial: T\n },\n log: {\n total: T\n }\n };\n function hasProperty(nodeOrName, property) {\n var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultContext;\n var name = defaultName;\n if (typeof nodeOrName === 'string') {\n name = nodeOrName;\n } else if (isOperatorNode(nodeOrName)) {\n name = nodeOrName.fn.toString();\n } else if (isFunctionNode(nodeOrName)) {\n name = nodeOrName.name;\n } else if (isParenthesisNode(nodeOrName)) {\n name = 'paren';\n }\n if (hasOwnProperty(context, name)) {\n var properties = context[name];\n if (hasOwnProperty(properties, property)) {\n return properties[property];\n }\n if (hasOwnProperty(defaultContext, name)) {\n return defaultContext[name][property];\n }\n }\n if (hasOwnProperty(context, defaultName)) {\n var _properties = context[defaultName];\n if (hasOwnProperty(_properties, property)) {\n return _properties[property];\n }\n return defaultContext[defaultName][property];\n }\n /* name not found in context and context has no global default */\n /* So use default context. */\n if (hasOwnProperty(defaultContext, name)) {\n var _properties2 = defaultContext[name];\n if (hasOwnProperty(_properties2, property)) {\n return _properties2[property];\n }\n }\n return defaultContext[defaultName][property];\n }\n function isCommutative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'commutative', context);\n }\n function isAssociative(node) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultContext;\n return hasProperty(node, 'associative', context);\n }\n\n /**\n * Merge the given contexts, with primary overriding secondary\n * wherever they might conflict\n */\n function mergeContext(primary, secondary) {\n var merged = _objectSpread({}, primary);\n for (var prop in secondary) {\n if (hasOwnProperty(primary, prop)) {\n merged[prop] = _objectSpread(_objectSpread({}, secondary[prop]), primary[prop]);\n } else {\n merged[prop] = secondary[prop];\n }\n }\n return merged;\n }\n\n /**\n * Flatten all associative operators in an expression tree.\n * Assumes parentheses have already been removed.\n */\n function flatten(node, context) {\n if (!node.args || node.args.length === 0) {\n return node;\n }\n node.args = allChildren(node, context);\n for (var i = 0; i < node.args.length; i++) {\n flatten(node.args[i], context);\n }\n }\n\n /**\n * Get the children of a node as if it has been flattened.\n * TODO implement for FunctionNodes\n */\n function allChildren(node, context) {\n var op;\n var children = [];\n var _findChildren = function findChildren(node) {\n for (var i = 0; i < node.args.length; i++) {\n var child = node.args[i];\n if (isOperatorNode(child) && op === child.op) {\n _findChildren(child);\n } else {\n children.push(child);\n }\n }\n };\n if (isAssociative(node, context)) {\n op = node.op;\n _findChildren(node);\n return children;\n } else {\n return node.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a right-heavy binary tree.\n */\n function unflattenr(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.pop();\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n node.args = curnode.args;\n }\n }\n\n /**\n * Unflatten all flattened operators to a left-heavy binary tree.\n */\n function unflattenl(node, context) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n for (var i = 0; i < l; i++) {\n unflattenl(node.args[i], context);\n }\n if (l > 2 && isAssociative(node, context)) {\n var curnode = node.args.shift();\n while (node.args.length > 0) {\n curnode = makeNode([curnode, node.args.shift()]);\n }\n node.args = curnode.args;\n }\n }\n function createMakeNodeFunction(node) {\n if (isOperatorNode(node)) {\n return function (args) {\n try {\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } catch (err) {\n console.error(err);\n return [];\n }\n };\n } else {\n return function (args) {\n return new FunctionNode(new SymbolNode(node.name), args);\n };\n }\n }\n return {\n createMakeNodeFunction,\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n allChildren,\n unflattenr,\n unflattenl,\n defaultContext,\n realContext,\n positiveContext\n };\n});","import { isParenthesisNode } from '../../utils/is.js';\nimport { isConstantNode, isVariableNode, isNumericNode, isConstantExpression } from './simplify/wildcards.js';\nimport { factory } from '../../utils/factory.js';\nimport { createUtil } from './simplify/util.js';\nimport { hasOwnProperty } from '../../utils/object.js';\nimport { createEmptyMap, createMap } from '../../utils/map.js';\nvar name = 'simplify';\nvar dependencies = ['typed', 'parse', 'equal', 'resolve', 'simplifyConstant', 'simplifyCore', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode', 'replacer'];\nexport var createSimplify = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n resolve,\n simplifyConstant,\n simplifyCore,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n replacer\n } = _ref;\n var {\n hasProperty,\n isCommutative,\n isAssociative,\n mergeContext,\n flatten,\n unflattenr,\n unflattenl,\n createMakeNodeFunction,\n defaultContext,\n realContext,\n positiveContext\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * Simplify an expression tree.\n *\n * A list of rules are applied to an expression, repeating over the list until\n * no further changes are made.\n * It's possible to pass a custom set of rules to the function as second\n * argument. A rule can be specified as an object, string, or function:\n *\n * const rules = [\n * { l: 'n1*n3 + n2*n3', r: '(n1+n2)*n3' },\n * 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n * function (node) {\n * // ... return a new node or return the node unchanged\n * return node\n * }\n * ]\n *\n * String and object rules consist of a left and right pattern. The left is\n * used to match against the expression and the right determines what matches\n * are replaced with. The main difference between a pattern and a normal\n * expression is that variables starting with the following characters are\n * interpreted as wildcards:\n *\n * - 'n' - Matches any node [Node]\n * - 'c' - Matches a constant literal (5 or 3.2) [ConstantNode]\n * - 'cl' - Matches a constant literal; same as c [ConstantNode]\n * - 'cd' - Matches a decimal literal (5 or -3.2) [ConstantNode or unaryMinus wrapping a ConstantNode]\n * - 'ce' - Matches a constant expression (-5 or √3) [Expressions consisting of only ConstantNodes, functions, and operators]\n * - 'v' - Matches a variable; anything not matched by c (-5 or x) [Node that is not a ConstantNode]\n * - 'vl' - Matches a variable literal (x or y) [SymbolNode]\n * - 'vd' - Matches a non-decimal expression; anything not matched by cd (x or √3) [Node that is not a ConstantNode or unaryMinus that is wrapping a ConstantNode]\n * - 've' - Matches a variable expression; anything not matched by ce (x or 2x) [Expressions that contain a SymbolNode or other non-constant term]\n *\n * The default list of rules is exposed on the function as `simplify.rules`\n * and can be used as a basis to built a set of custom rules. Note that since\n * the `simplifyCore` function is in the default list of rules, by default\n * simplify will convert any function calls in the expression that have\n * operator equivalents to their operator forms.\n *\n * To specify a rule as a string, separate the left and right pattern by '->'\n * When specifying a rule as an object, the following keys are meaningful:\n * - l - the left pattern\n * - r - the right pattern\n * - s - in lieu of l and r, the string form that is broken at -> to give them\n * - repeat - whether to repeat this rule until the expression stabilizes\n * - assuming - gives a context object, as in the 'context' option to\n * simplify. Every property in the context object must match the current\n * context in order, or else the rule will not be applied.\n * - imposeContext - gives a context object, as in the 'context' option to\n * simplify. Any settings specified will override the incoming context\n * for all matches of this rule.\n *\n * For more details on the theory, see:\n *\n * - [Strategies for simplifying math expressions (Stackoverflow)](https://stackoverflow.com/questions/7540227/strategies-for-simplifying-math-expressions)\n * - [Symbolic computation - Simplification (Wikipedia)](https://en.wikipedia.org/wiki/Symbolic_computation#Simplification)\n *\n * An optional `options` argument can be passed as last argument of `simplify`.\n * Currently available options (defaults in parentheses):\n * - `consoleDebug` (false): whether to write the expression being simplified\n * and any changes to it, along with the rule responsible, to console\n * - `context` (simplify.defaultContext): an object giving properties of\n * each operator, which determine what simplifications are allowed. The\n * currently meaningful properties are commutative, associative,\n * total (whether the operation is defined for all arguments), and\n * trivial (whether the operation applied to a single argument leaves\n * that argument unchanged). The default context is very permissive and\n * allows almost all simplifications. Only properties differing from\n * the default need to be specified; the default context is used as a\n * fallback. Additional contexts `simplify.realContext` and\n * `simplify.positiveContext` are supplied to cause simplify to perform\n * just simplifications guaranteed to preserve all values of the expression\n * assuming all variables and subexpressions are real numbers or\n * positive real numbers, respectively. (Note that these are in some cases\n * more restrictive than the default context; for example, the default\n * context will allow `x/x` to simplify to 1, whereas\n * `simplify.realContext` will not, as `0/0` is not equal to 1.)\n * - `exactFractions` (true): whether to try to convert all constants to\n * exact rational numbers.\n * - `fractionsLimit` (10000): when `exactFractions` is true, constants will\n * be expressed as fractions only when both numerator and denominator\n * are smaller than `fractionsLimit`.\n *\n * Syntax:\n *\n * math.simplify(expr)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules)\n * math.simplify(expr, rules, scope)\n * math.simplify(expr, rules, scope, options)\n * math.simplify(expr, scope)\n * math.simplify(expr, scope, options)\n *\n * Examples:\n *\n * math.simplify('2 * 1 * x ^ (2 - 1)') // Node \"2 * x\"\n * math.simplify('2 * 3 * x', {x: 4}) // Node \"24\"\n * const f = math.parse('2 * 1 * x ^ (2 - 1)')\n * math.simplify(f) // Node \"2 * x\"\n * math.simplify('0.4 * x', {}, {exactFractions: true}) // Node \"x * 2 / 5\"\n * math.simplify('0.4 * x', {}, {exactFractions: false}) // Node \"0.4 * x\"\n *\n * See also:\n *\n * simplifyCore, derivative, evaluate, parse, rationalize, resolve\n *\n * @param {Node | string} expr\n * The expression to be simplified\n * @param {SimplifyRule[]} [rules]\n * Optional list with custom rules\n * @param {Object} [scope] Optional scope with variables\n * @param {SimplifyOptions} [options] Optional configuration settings\n * @return {Node} Returns the simplified form of `expr`\n */\n typed.addConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n var simplify = typed('simplify', {\n Node: _simplify,\n 'Node, Map': (expr, scope) => _simplify(expr, false, scope),\n 'Node, Map, Object': (expr, scope, options) => _simplify(expr, false, scope, options),\n 'Node, Array': _simplify,\n 'Node, Array, Map': _simplify,\n 'Node, Array, Map, Object': _simplify\n });\n typed.removeConversion({\n from: 'Object',\n to: 'Map',\n convert: createMap\n });\n simplify.defaultContext = defaultContext;\n simplify.realContext = realContext;\n simplify.positiveContext = positiveContext;\n function removeParens(node) {\n return node.transform(function (node) {\n return isParenthesisNode(node) ? removeParens(node.content) : node;\n });\n }\n\n // All constants that are allowed in rules\n var SUPPORTED_CONSTANTS = {\n true: true,\n false: true,\n e: true,\n i: true,\n Infinity: true,\n LN2: true,\n LN10: true,\n LOG2E: true,\n LOG10E: true,\n NaN: true,\n phi: true,\n pi: true,\n SQRT1_2: true,\n SQRT2: true,\n tau: true\n // null: false,\n // undefined: false,\n // version: false,\n };\n\n // Array of strings, used to build the ruleSet.\n // Each l (left side) and r (right side) are parsed by\n // the expression parser into a node tree.\n // Left hand sides are matched to subtrees within the\n // expression to be parsed and replaced with the right\n // hand side.\n // TODO: Add support for constraints on constants (either in the form of a '=' expression or a callback [callback allows things like comparing symbols alphabetically])\n // To evaluate lhs constants for rhs constants, use: { l: 'c1+c2', r: 'c3', evaluate: 'c3 = c1 + c2' }. Multiple assignments are separated by ';' in block format.\n // It is possible to get into an infinite loop with conflicting rules\n simplify.rules = [simplifyCore,\n // { l: 'n+0', r: 'n' }, // simplifyCore\n // { l: 'n^0', r: '1' }, // simplifyCore\n // { l: '0*n', r: '0' }, // simplifyCore\n // { l: 'n/n', r: '1'}, // simplifyCore\n // { l: 'n^1', r: 'n' }, // simplifyCore\n // { l: '+n1', r:'n1' }, // simplifyCore\n // { l: 'n--n1', r:'n+n1' }, // simplifyCore\n {\n l: 'log(e)',\n r: '1'\n },\n // temporary rules\n // Note initially we tend constants to the right because like-term\n // collection prefers the left, and we would rather collect nonconstants\n {\n s: 'n-n1 -> n+-n1',\n // temporarily replace 'subtract' so we can further flatten the 'add' operator\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n-n -> 0',\n // partial alternative when we can't always subtract\n assuming: {\n subtract: {\n total: false\n }\n }\n }, {\n s: '-(cl*v) -> v * (-cl)',\n // make non-constant terms positive\n assuming: {\n multiply: {\n commutative: true\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(cl*v) -> (-cl) * v',\n // non-commutative version, part 1\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n s: '-(v*cl) -> v * (-cl)',\n // non-commutative version, part 2\n assuming: {\n multiply: {\n commutative: false\n },\n subtract: {\n total: true\n }\n }\n }, {\n l: '-(n1/n2)',\n r: '-n1/n2'\n }, {\n l: '-v',\n r: 'v * (-1)'\n },\n // finish making non-constant terms positive\n {\n l: '(n1 + n2)*(-1)',\n r: 'n1*(-1) + n2*(-1)',\n repeat: true\n },\n // expand negations to achieve as much sign cancellation as possible\n {\n l: 'n/n1^n2',\n r: 'n*n1^-n2'\n },\n // temporarily replace 'divide' so we can further flatten the 'multiply' operator\n {\n l: 'n/n1',\n r: 'n*n1^-1'\n }, {\n s: '(n1*n2)^n3 -> n1^n3 * n2^n3',\n assuming: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: '(n1*n2)^(-1) -> n2^(-1) * n1^(-1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n },\n // expand nested exponentiation\n {\n s: '(n ^ n1) ^ n2 -> n ^ (n1 * n2)',\n assuming: {\n divide: {\n total: true\n }\n } // 1/(1/n) = n needs 1/n to exist\n },\n // collect like factors; into a sum, only do this for nonconstants\n {\n l: ' vd * ( vd * n1 + n2)',\n r: 'vd^2 * n1 + vd * n2'\n }, {\n s: ' vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2',\n assuming: {\n divide: {\n total: true\n }\n } // v*1/v = v^(1+-1) needs 1/v\n }, {\n s: 'vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n s: 'vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2',\n assuming: {\n divide: {\n total: true\n }\n }\n }, {\n l: 'n*n',\n r: 'n^2'\n }, {\n s: 'n * n^n1 -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n }\n } // n*1/n = n^(-1+1) needs 1/n\n }, {\n s: 'n^n1 * n^n2 -> n^(n1+n2)',\n assuming: {\n divide: {\n total: true\n }\n } // ditto for n^2*1/n^2\n },\n // Unfortunately, to deal with more complicated cancellations, it\n // becomes necessary to simplify constants twice per pass. It's not\n // terribly expensive compared to matching rules, so this should not\n // pose a performance problem.\n simplifyConstant,\n // First: before collecting like terms\n\n // collect like terms\n {\n s: 'n+n -> 2*n',\n assuming: {\n add: {\n total: true\n }\n } // 2 = 1 + 1 needs to exist\n }, {\n l: 'n+-n',\n r: '0'\n }, {\n l: 'vd*n + vd',\n r: 'vd*(n+1)'\n },\n // NOTE: leftmost position is special:\n {\n l: 'n3*n1 + n3*n2',\n r: 'n3*(n1+n2)'\n },\n // All sub-monomials tried there.\n {\n l: 'n3^(-n4)*n1 + n3 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+1) *n2)'\n }, {\n l: 'n3^(-n4)*n1 + n3^n5 * n2',\n r: 'n3^(-n4)*(n1 + n3^(n4+n5)*n2)'\n },\n // noncommutative additional cases (term collection & factoring)\n {\n s: 'n*vd + vd -> (n+1)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'vd + n*vd -> (1+n)*vd',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3 + n2*n3 -> (n1+n2)*n3',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n^n1 * n -> n^(n1+1)',\n assuming: {\n divide: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n l: 'n*cd + cd',\n r: '(n+1)*cd'\n }, {\n s: 'cd*n + cd -> cd*(n+1)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, {\n s: 'cd + cd*n -> cd*(1+n)',\n assuming: {\n multiply: {\n commutative: false\n }\n }\n }, simplifyConstant,\n // Second: before returning expressions to \"standard form\"\n\n // make factors positive (and undo 'make non-constant terms positive')\n {\n s: '(-n)*n1 -> -(n*n1)',\n assuming: {\n subtract: {\n total: true\n }\n }\n }, {\n s: 'n1*(-n) -> -(n1*n)',\n // in case * non-commutative\n assuming: {\n subtract: {\n total: true\n },\n multiply: {\n commutative: false\n }\n }\n },\n // final ordering of constants\n {\n s: 'ce+ve -> ve+ce',\n assuming: {\n add: {\n commutative: true\n }\n },\n imposeContext: {\n add: {\n commutative: false\n }\n }\n }, {\n s: 'vd*cd -> cd*vd',\n assuming: {\n multiply: {\n commutative: true\n }\n },\n imposeContext: {\n multiply: {\n commutative: false\n }\n }\n },\n // undo temporary rules\n // { l: '(-1) * n', r: '-n' }, // #811 added test which proved this is redundant\n {\n l: 'n+-n1',\n r: 'n-n1'\n },\n // undo replace 'subtract'\n {\n l: 'n+-(n1)',\n r: 'n-(n1)'\n }, {\n s: 'n*(n1^-1) -> n/n1',\n // undo replace 'divide'; for * commutative\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n*n1^-n2 -> n/n1^n2',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n s: 'n^-1 -> 1/n',\n assuming: {\n multiply: {\n commutative: true\n }\n } // o.w. / not conventional\n }, {\n l: 'n^1',\n r: 'n'\n },\n // can be produced by power cancellation\n {\n s: 'n*(n1/n2) -> (n*n1)/n2',\n // '*' before '/'\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n s: 'n-(n1+n2) -> n-n1-n2',\n // '-' before '+'\n assuming: {\n addition: {\n associative: true,\n commutative: true\n }\n }\n },\n // { l: '(n1/n2)/n3', r: 'n1/(n2*n3)' },\n // { l: '(n*n1)/(n*n2)', r: 'n1/n2' },\n\n // simplifyConstant can leave an extra factor of 1, which can always\n // be eliminated, since the identity always commutes\n {\n l: '1*n',\n r: 'n',\n imposeContext: {\n multiply: {\n commutative: true\n }\n }\n }, {\n s: 'n1/(n2/n3) -> (n1*n3)/n2',\n assuming: {\n multiply: {\n associative: true\n }\n }\n }, {\n l: 'n1/(-n2)',\n r: '-n1/n2'\n }];\n\n /**\n * Takes any rule object as allowed by the specification in simplify\n * and puts it in a standard form used by applyRule\n */\n function _canonicalizeRule(ruleObject, context) {\n var newRule = {};\n if (ruleObject.s) {\n var lr = ruleObject.s.split('->');\n if (lr.length === 2) {\n newRule.l = lr[0];\n newRule.r = lr[1];\n } else {\n throw SyntaxError('Could not parse rule: ' + ruleObject.s);\n }\n } else {\n newRule.l = ruleObject.l;\n newRule.r = ruleObject.r;\n }\n newRule.l = removeParens(parse(newRule.l));\n newRule.r = removeParens(parse(newRule.r));\n for (var prop of ['imposeContext', 'repeat', 'assuming']) {\n if (prop in ruleObject) {\n newRule[prop] = ruleObject[prop];\n }\n }\n if (ruleObject.evaluate) {\n newRule.evaluate = parse(ruleObject.evaluate);\n }\n if (isAssociative(newRule.l, context)) {\n var nonCommutative = !isCommutative(newRule.l, context);\n var leftExpandsym;\n // Gen. the LHS placeholder used in this NC-context specific expansion rules\n if (nonCommutative) leftExpandsym = _getExpandPlaceholderSymbol();\n var makeNode = createMakeNodeFunction(newRule.l);\n var expandsym = _getExpandPlaceholderSymbol();\n newRule.expanded = {};\n newRule.expanded.l = makeNode([newRule.l, expandsym]);\n // Push the expandsym into the deepest possible branch.\n // This helps to match the newRule against nodes returned from getSplits() later on.\n flatten(newRule.expanded.l, context);\n unflattenr(newRule.expanded.l, context);\n newRule.expanded.r = makeNode([newRule.r, expandsym]);\n\n // In and for a non-commutative context, attempting with yet additional expansion rules makes\n // way for more matches cases of multi-arg expressions; such that associative rules (such as\n // 'n*n -> n^2') can be applied to exprs. such as 'a * b * b' and 'a * b * b * a'.\n if (nonCommutative) {\n // 'Non-commutative' 1: LHS (placeholder) only\n newRule.expandedNC1 = {};\n newRule.expandedNC1.l = makeNode([leftExpandsym, newRule.l]);\n newRule.expandedNC1.r = makeNode([leftExpandsym, newRule.r]);\n // 'Non-commutative' 2: farmost LHS and RHS placeholders\n newRule.expandedNC2 = {};\n newRule.expandedNC2.l = makeNode([leftExpandsym, newRule.expanded.l]);\n newRule.expandedNC2.r = makeNode([leftExpandsym, newRule.expanded.r]);\n }\n }\n return newRule;\n }\n\n /**\n * Parse the string array of rules into nodes\n *\n * Example syntax for rules:\n *\n * Position constants to the left in a product:\n * { l: 'n1 * c1', r: 'c1 * n1' }\n * n1 is any Node, and c1 is a ConstantNode.\n *\n * Apply difference of squares formula:\n * { l: '(n1 - n2) * (n1 + n2)', r: 'n1^2 - n2^2' }\n * n1, n2 mean any Node.\n *\n * Short hand notation:\n * 'n1 * c1 -> c1 * n1'\n */\n function _buildRules(rules, context) {\n // Array of rules to be used to simplify expressions\n var ruleSet = [];\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n var newRule = void 0;\n var ruleType = typeof rule;\n switch (ruleType) {\n case 'string':\n rule = {\n s: rule\n };\n /* falls through */\n case 'object':\n newRule = _canonicalizeRule(rule, context);\n break;\n case 'function':\n newRule = rule;\n break;\n default:\n throw TypeError('Unsupported type of rule: ' + ruleType);\n }\n // console.log('Adding rule: ' + rules[i])\n // console.log(newRule)\n ruleSet.push(newRule);\n }\n return ruleSet;\n }\n var _lastsym = 0;\n function _getExpandPlaceholderSymbol() {\n return new SymbolNode('_p' + _lastsym++);\n }\n function _simplify(expr, rules) {\n var scope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createEmptyMap();\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var debug = options.consoleDebug;\n rules = _buildRules(rules || simplify.rules, options.context);\n var res = resolve(expr, scope);\n res = removeParens(res);\n var visited = {};\n var str = res.toString({\n parenthesis: 'all'\n });\n while (!visited[str]) {\n visited[str] = true;\n _lastsym = 0; // counter for placeholder symbols\n var laststr = str;\n if (debug) console.log('Working on: ', str);\n for (var i = 0; i < rules.length; i++) {\n var rulestr = '';\n if (typeof rules[i] === 'function') {\n res = rules[i](res, options);\n if (debug) rulestr = rules[i].name;\n } else {\n flatten(res, options.context);\n res = applyRule(res, rules[i], options.context);\n if (debug) {\n rulestr = \"\".concat(rules[i].l.toString(), \" -> \").concat(rules[i].r.toString());\n }\n }\n if (debug) {\n var newstr = res.toString({\n parenthesis: 'all'\n });\n if (newstr !== laststr) {\n console.log('Applying', rulestr, 'produced', newstr);\n laststr = newstr;\n }\n }\n /* Use left-heavy binary tree internally,\n * since custom rule functions may expect it\n */\n unflattenl(res, options.context);\n }\n str = res.toString({\n parenthesis: 'all'\n });\n }\n return res;\n }\n function mapRule(nodes, rule, context) {\n var resNodes = nodes;\n if (nodes) {\n for (var i = 0; i < nodes.length; ++i) {\n var newNode = applyRule(nodes[i], rule, context);\n if (newNode !== nodes[i]) {\n if (resNodes === nodes) {\n resNodes = nodes.slice();\n }\n resNodes[i] = newNode;\n }\n }\n }\n return resNodes;\n }\n\n /**\n * Returns a simplfied form of node, or the original node if no simplification was possible.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object | Function} rule\n * @param {Object} context -- information about assumed properties of operators\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The simplified form of `expr`, or the original node if no simplification was possible.\n */\n function applyRule(node, rule, context) {\n // console.log('Entering applyRule(\"', rule.l.toString({parenthesis:'all'}), '->', rule.r.toString({parenthesis:'all'}), '\",', node.toString({parenthesis:'all'}),')')\n\n // check that the assumptions for this rule are satisfied by the current\n // context:\n if (rule.assuming) {\n for (var symbol in rule.assuming) {\n for (var property in rule.assuming[symbol]) {\n if (hasProperty(symbol, property, context) !== rule.assuming[symbol][property]) {\n return node;\n }\n }\n }\n }\n var mergedContext = mergeContext(rule.imposeContext, context);\n\n // Do not clone node unless we find a match\n var res = node;\n\n // First replace our child nodes with their simplified versions\n // If a child could not be simplified, applying the rule to it\n // will have no effect since the node is returned unchanged\n if (res instanceof OperatorNode || res instanceof FunctionNode) {\n var newArgs = mapRule(res.args, rule, context);\n if (newArgs !== res.args) {\n res = res.clone();\n res.args = newArgs;\n }\n } else if (res instanceof ParenthesisNode) {\n if (res.content) {\n var newContent = applyRule(res.content, rule, context);\n if (newContent !== res.content) {\n res = new ParenthesisNode(newContent);\n }\n }\n } else if (res instanceof ArrayNode) {\n var newItems = mapRule(res.items, rule, context);\n if (newItems !== res.items) {\n res = new ArrayNode(newItems);\n }\n } else if (res instanceof AccessorNode) {\n var newObj = res.object;\n if (res.object) {\n newObj = applyRule(res.object, rule, context);\n }\n var newIndex = res.index;\n if (res.index) {\n newIndex = applyRule(res.index, rule, context);\n }\n if (newObj !== res.object || newIndex !== res.index) {\n res = new AccessorNode(newObj, newIndex);\n }\n } else if (res instanceof IndexNode) {\n var newDims = mapRule(res.dimensions, rule, context);\n if (newDims !== res.dimensions) {\n res = new IndexNode(newDims);\n }\n } else if (res instanceof ObjectNode) {\n var changed = false;\n var newProps = {};\n for (var prop in res.properties) {\n newProps[prop] = applyRule(res.properties[prop], rule, context);\n if (newProps[prop] !== res.properties[prop]) {\n changed = true;\n }\n }\n if (changed) {\n res = new ObjectNode(newProps);\n }\n }\n\n // Try to match a rule against this node\n var repl = rule.r;\n var matches = _ruleMatch(rule.l, res, mergedContext)[0];\n\n // If the rule is associative operator, we can try matching it while allowing additional terms.\n // This allows us to match rules like 'n+n' to the expression '(1+x)+x' or even 'x+1+x' if the operator is commutative.\n if (!matches && rule.expanded) {\n repl = rule.expanded.r;\n matches = _ruleMatch(rule.expanded.l, res, mergedContext)[0];\n }\n // Additional, non-commutative context expansion-rules\n if (!matches && rule.expandedNC1) {\n repl = rule.expandedNC1.r;\n matches = _ruleMatch(rule.expandedNC1.l, res, mergedContext)[0];\n if (!matches) {\n // Existence of NC1 implies NC2\n repl = rule.expandedNC2.r;\n matches = _ruleMatch(rule.expandedNC2.l, res, mergedContext)[0];\n }\n }\n if (matches) {\n // const before = res.toString({parenthesis: 'all'})\n\n // Create a new node by cloning the rhs of the matched rule\n // we keep any implicit multiplication state if relevant\n var implicit = res.implicit;\n res = repl.clone();\n if (implicit && 'implicit' in repl) {\n res.implicit = true;\n }\n\n // Replace placeholders with their respective nodes without traversing deeper into the replaced nodes\n res = res.transform(function (node) {\n if (node.isSymbolNode && hasOwnProperty(matches.placeholders, node.name)) {\n return matches.placeholders[node.name].clone();\n } else {\n return node;\n }\n });\n\n // const after = res.toString({parenthesis: 'all'})\n // console.log('Simplified ' + before + ' to ' + after)\n }\n if (rule.repeat && res !== node) {\n res = applyRule(res, rule, context);\n }\n return res;\n }\n\n /**\n * Get (binary) combinations of a flattened binary node\n * e.g. +(node1, node2, node3) -> [\n * +(node1, +(node2, node3)),\n * +(node2, +(node1, node3)),\n * +(node3, +(node1, node2))]\n *\n */\n function getSplits(node, context) {\n var res = [];\n var right, rightArgs;\n var makeNode = createMakeNodeFunction(node);\n if (isCommutative(node, context)) {\n for (var i = 0; i < node.args.length; i++) {\n rightArgs = node.args.slice(0);\n rightArgs.splice(i, 1);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([node.args[i], right]));\n }\n } else {\n // Keep order, but try all parenthesizations\n for (var _i = 1; _i < node.args.length; _i++) {\n var left = node.args[0];\n if (_i > 1) {\n left = makeNode(node.args.slice(0, _i));\n }\n rightArgs = node.args.slice(_i);\n right = rightArgs.length === 1 ? rightArgs[0] : makeNode(rightArgs);\n res.push(makeNode([left, right]));\n }\n }\n return res;\n }\n\n /**\n * Returns the set union of two match-placeholders or null if there is a conflict.\n */\n function mergeMatch(match1, match2) {\n var res = {\n placeholders: {}\n };\n\n // Some matches may not have placeholders; this is OK\n if (!match1.placeholders && !match2.placeholders) {\n return res;\n } else if (!match1.placeholders) {\n return match2;\n } else if (!match2.placeholders) {\n return match1;\n }\n\n // Placeholders with the same key must match exactly\n for (var key in match1.placeholders) {\n if (hasOwnProperty(match1.placeholders, key)) {\n res.placeholders[key] = match1.placeholders[key];\n if (hasOwnProperty(match2.placeholders, key)) {\n if (!_exactMatch(match1.placeholders[key], match2.placeholders[key])) {\n return null;\n }\n }\n }\n }\n for (var _key in match2.placeholders) {\n if (hasOwnProperty(match2.placeholders, _key)) {\n res.placeholders[_key] = match2.placeholders[_key];\n }\n }\n return res;\n }\n\n /**\n * Combine two lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n */\n function combineChildMatches(list1, list2) {\n var res = [];\n if (list1.length === 0 || list2.length === 0) {\n return res;\n }\n var merged;\n for (var i1 = 0; i1 < list1.length; i1++) {\n for (var i2 = 0; i2 < list2.length; i2++) {\n merged = mergeMatch(list1[i1], list2[i2]);\n if (merged) {\n res.push(merged);\n }\n }\n }\n return res;\n }\n\n /**\n * Combine multiple lists of matches by applying mergeMatch to the cartesian product of two lists of matches.\n * Each list represents matches found in one child of a node.\n * Returns a list of unique matches.\n */\n function mergeChildMatches(childMatches) {\n if (childMatches.length === 0) {\n return childMatches;\n }\n var sets = childMatches.reduce(combineChildMatches);\n var uniqueSets = [];\n var unique = {};\n for (var i = 0; i < sets.length; i++) {\n var s = JSON.stringify(sets[i], replacer);\n if (!unique[s]) {\n unique[s] = true;\n uniqueSets.push(sets[i]);\n }\n }\n return uniqueSets;\n }\n\n /**\n * Determines whether node matches rule.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} rule\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {Object} context -- provides assumed properties of operators\n * @param {Boolean} isSplit -- whether we are in process of splitting an\n * n-ary operator node into possible binary combinations.\n * Defaults to false.\n * @return {Object} Information about the match, if it exists.\n */\n function _ruleMatch(rule, node, context, isSplit) {\n // console.log('Entering _ruleMatch(' + JSON.stringify(rule) + ', ' + JSON.stringify(node) + ')')\n // console.log('rule = ' + rule)\n // console.log('node = ' + node)\n\n // console.log('Entering _ruleMatch(', rule.toString({parenthesis:'all'}), ', ', node.toString({parenthesis:'all'}), ', ', context, ')')\n var res = [{\n placeholders: {}\n }];\n if (rule instanceof OperatorNode && node instanceof OperatorNode || rule instanceof FunctionNode && node instanceof FunctionNode) {\n // If the rule is an OperatorNode or a FunctionNode, then node must match exactly\n if (rule instanceof OperatorNode) {\n if (rule.op !== node.op || rule.fn !== node.fn) {\n return [];\n }\n } else if (rule instanceof FunctionNode) {\n if (rule.name !== node.name) {\n return [];\n }\n }\n\n // rule and node match. Search the children of rule and node.\n if (node.args.length === 1 && rule.args.length === 1 || !isAssociative(node, context) && node.args.length === rule.args.length || isSplit) {\n // Expect non-associative operators to match exactly,\n // except in any order if operator is commutative\n var childMatches = [];\n for (var i = 0; i < rule.args.length; i++) {\n var childMatch = _ruleMatch(rule.args[i], node.args[i], context);\n if (childMatch.length === 0) {\n // Child did not match, so stop searching immediately\n break;\n }\n // The child matched, so add the information returned from the child to our result\n childMatches.push(childMatch);\n }\n if (childMatches.length !== rule.args.length) {\n if (!isCommutative(node, context) ||\n // exact match in order needed\n rule.args.length === 1) {\n // nothing to commute\n return [];\n }\n if (rule.args.length > 2) {\n /* Need to generate all permutations and try them.\n * It's a bit complicated, and unlikely to come up since there\n * are very few ternary or higher operators. So punt for now.\n */\n throw new Error('permuting >2 commutative non-associative rule arguments not yet implemented');\n }\n /* Exactly two arguments, try them reversed */\n var leftMatch = _ruleMatch(rule.args[0], node.args[1], context);\n if (leftMatch.length === 0) {\n return [];\n }\n var rightMatch = _ruleMatch(rule.args[1], node.args[0], context);\n if (rightMatch.length === 0) {\n return [];\n }\n childMatches = [leftMatch, rightMatch];\n }\n res = mergeChildMatches(childMatches);\n } else if (node.args.length >= 2 && rule.args.length === 2) {\n // node is flattened, rule is not\n // Associative operators/functions can be split in different ways so we check if the rule\n // matches for each of them and return their union.\n var splits = getSplits(node, context);\n var splitMatches = [];\n for (var _i2 = 0; _i2 < splits.length; _i2++) {\n var matchSet = _ruleMatch(rule, splits[_i2], context, true); // recursing at the same tree depth here\n splitMatches = splitMatches.concat(matchSet);\n }\n return splitMatches;\n } else if (rule.args.length > 2) {\n throw Error('Unexpected non-binary associative function: ' + rule.toString());\n } else {\n // Incorrect number of arguments in rule and node, so no match\n return [];\n }\n } else if (rule instanceof SymbolNode) {\n // If the rule is a SymbolNode, then it carries a special meaning\n // according to the first one or two characters of the symbol node name.\n // These meanings are expalined in the documentation for simplify()\n if (rule.name.length === 0) {\n throw new Error('Symbol in rule has 0 length...!?');\n }\n if (SUPPORTED_CONSTANTS[rule.name]) {\n // built-in constant must match exactly\n if (rule.name !== node.name) {\n return [];\n }\n } else {\n // wildcards are composed of up to two alphabetic or underscore characters\n switch (rule.name[1] >= 'a' && rule.name[1] <= 'z' ? rule.name.substring(0, 2) : rule.name[0]) {\n case 'n':\n case '_p':\n // rule matches _anything_, so assign this node to the rule.name placeholder\n // Assign node to the rule.name placeholder.\n // Our parent will check for matches among placeholders.\n res[0].placeholders[rule.name] = node;\n break;\n case 'c':\n case 'cl':\n // rule matches a ConstantNode\n if (isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'v':\n // rule matches anything other than a ConstantNode\n if (!isConstantNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vl':\n // rule matches VariableNode\n if (isVariableNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'cd':\n // rule matches a ConstantNode or unaryMinus-wrapped ConstantNode\n if (isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'vd':\n // rule matches anything other than a ConstantNode or unaryMinus-wrapped ConstantNode\n if (!isNumericNode(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 'ce':\n // rule matches expressions that have a constant value\n if (isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n case 've':\n // rule matches expressions that do not have a constant value\n if (!isConstantExpression(node)) {\n res[0].placeholders[rule.name] = node;\n } else {\n // mis-match: rule does not encompass current node\n return [];\n }\n break;\n default:\n throw new Error('Invalid symbol in rule: ' + rule.name);\n }\n }\n } else if (rule instanceof ConstantNode) {\n // Literal constant must match exactly\n if (!equal(rule.value, node.value)) {\n return [];\n }\n } else {\n // Some other node was encountered which we aren't prepared for, so no match\n return [];\n }\n\n // It's a match!\n\n // console.log('_ruleMatch(' + rule.toString() + ', ' + node.toString() + ') found a match')\n return res;\n }\n\n /**\n * Determines whether p and q (and all their children nodes) are identical.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} p\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} q\n * @return {Object} Information about the match, if it exists.\n */\n function _exactMatch(p, q) {\n if (p instanceof ConstantNode && q instanceof ConstantNode) {\n if (!equal(p.value, q.value)) {\n return false;\n }\n } else if (p instanceof SymbolNode && q instanceof SymbolNode) {\n if (p.name !== q.name) {\n return false;\n }\n } else if (p instanceof OperatorNode && q instanceof OperatorNode || p instanceof FunctionNode && q instanceof FunctionNode) {\n if (p instanceof OperatorNode) {\n if (p.op !== q.op || p.fn !== q.fn) {\n return false;\n }\n } else if (p instanceof FunctionNode) {\n if (p.name !== q.name) {\n return false;\n }\n }\n if (p.args.length !== q.args.length) {\n return false;\n }\n for (var i = 0; i < p.args.length; i++) {\n if (!_exactMatch(p.args[i], q.args[i])) {\n return false;\n }\n }\n } else {\n return false;\n }\n return true;\n }\n return simplify;\n});","import { isFraction, isMatrix, isNode, isArrayNode, isConstantNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nimport { createUtil } from './simplify/util.js';\nimport { noBignumber, noFraction } from '../../utils/noop.js';\nvar name = 'simplifyConstant';\nvar dependencies = ['typed', 'config', 'mathWithTransform', 'matrix', 'isBounded', '?fraction', '?bignumber', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode'];\nexport var createSimplifyConstant = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n mathWithTransform,\n matrix,\n isBounded,\n fraction,\n bignumber,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode\n } = _ref;\n var {\n isCommutative,\n isAssociative,\n allChildren,\n createMakeNodeFunction\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n\n /**\n * simplifyConstant() takes a mathjs expression (either a Node representing\n * a parse tree or a string which it parses to produce a node), and replaces\n * any subexpression of it consisting entirely of constants with the computed\n * value of that subexpression.\n *\n * Syntax:\n *\n * math.simplifyConstant(expr)\n * math.simplifyConstant(expr, options)\n *\n * Examples:\n *\n * math.simplifyConstant('x + 4*3/6') // Node \"x + 2\"\n * math.simplifyConstant('z cos(0)') // Node \"z 1\"\n * math.simplifyConstant('(5.2 + 1.08)t', {exactFractions: false}) // Node \"6.28 t\"\n *\n * See also:\n *\n * simplify, simplifyCore, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with constant subexpressions evaluated\n */\n var simplifyConstant = typed('simplifyConstant', {\n Node: node => _ensureNode(foldFraction(node, {})),\n 'Node, Object': function Node_Object(expr, options) {\n return _ensureNode(foldFraction(expr, options));\n }\n });\n function _removeFractions(thing) {\n if (isFraction(thing)) {\n return thing.valueOf();\n }\n if (thing instanceof Array) {\n return thing.map(_removeFractions);\n }\n if (isMatrix(thing)) {\n return matrix(_removeFractions(thing.valueOf()));\n }\n return thing;\n }\n function _eval(fnname, args, options) {\n try {\n return mathWithTransform[fnname].apply(null, args);\n } catch (ignore) {\n // sometimes the implicit type conversion causes the evaluation to fail, so we'll try again after removing Fractions\n args = args.map(_removeFractions);\n return _toNumber(mathWithTransform[fnname].apply(null, args), options);\n }\n }\n var _toNode = typed({\n Fraction: _fractionToNode,\n number: function number(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n BigNumber: function BigNumber(n) {\n if (n < 0) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n); // old parameters: (n.toString(), 'number')\n },\n bigint: function bigint(n) {\n if (n < 0n) {\n return unaryMinusNode(new ConstantNode(-n));\n }\n return new ConstantNode(n);\n },\n Complex: function Complex(s) {\n throw new Error('Cannot convert Complex number to Node');\n },\n string: function string(s) {\n return new ConstantNode(s);\n },\n Matrix: function Matrix(m) {\n return new ArrayNode(m.valueOf().map(e => _toNode(e)));\n }\n });\n function _ensureNode(thing) {\n if (isNode(thing)) {\n return thing;\n }\n return _toNode(thing);\n }\n\n // convert a number to a fraction only if it can be expressed exactly,\n // and when both numerator and denominator are small enough\n function _exactFraction(n, options) {\n var exactFractions = options && options.exactFractions !== false;\n if (exactFractions && isBounded(n) && fraction) {\n var f = fraction(n);\n var fractionsLimit = options && typeof options.fractionsLimit === 'number' ? options.fractionsLimit : Infinity; // no limit by default\n\n if (f.valueOf() === n && f.n < fractionsLimit && f.d < fractionsLimit) {\n return f;\n }\n }\n return n;\n }\n\n // Convert numbers to a preferred number type in preference order: Fraction, number, Complex\n // BigNumbers are left alone\n var _toNumber = typed({\n 'string, Object': function string_Object(s, options) {\n var numericType = safeNumberType(s, config);\n if (numericType === 'BigNumber') {\n if (bignumber === undefined) {\n noBignumber();\n }\n return bignumber(s);\n } else if (numericType === 'bigint') {\n return BigInt(s);\n } else if (numericType === 'Fraction') {\n if (fraction === undefined) {\n noFraction();\n }\n return fraction(s);\n } else {\n var n = parseFloat(s);\n return _exactFraction(n, options);\n }\n },\n 'Fraction, Object': function Fraction_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'BigNumber, Object': function BigNumber_Object(s, options) {\n return s;\n },\n // we don't need options here\n\n 'number, Object': function number_Object(s, options) {\n return _exactFraction(s, options);\n },\n 'bigint, Object': function bigint_Object(s, options) {\n return s;\n },\n 'Complex, Object': function Complex_Object(s, options) {\n if (s.im !== 0) {\n return s;\n }\n return _exactFraction(s.re, options);\n },\n 'Matrix, Object': function Matrix_Object(s, options) {\n return matrix(_exactFraction(s.valueOf()));\n },\n 'Array, Object': function Array_Object(s, options) {\n return s.map(_exactFraction);\n }\n });\n function unaryMinusNode(n) {\n return new OperatorNode('-', 'unaryMinus', [n]);\n }\n function _fractionToNode(f) {\n // note: we convert await from bigint values, because bigint values gives issues with divisions: 1n/2n=0n and not 0.5\n var fromBigInt = value => config.number === 'BigNumber' && bignumber ? bignumber(value) : Number(value);\n var numeratorValue = f.s * f.n;\n var numeratorNode = numeratorValue < 0n ? new OperatorNode('-', 'unaryMinus', [new ConstantNode(-fromBigInt(numeratorValue))]) : new ConstantNode(fromBigInt(numeratorValue));\n return f.d === 1n ? numeratorNode : new OperatorNode('/', 'divide', [numeratorNode, new ConstantNode(fromBigInt(f.d))]);\n }\n\n /* Handles constant indexing of ArrayNodes, matrices, and ObjectNodes */\n function _foldAccessor(obj, index, options) {\n if (!isIndexNode(index)) {\n // don't know what to do with that...\n return new AccessorNode(_ensureNode(obj), _ensureNode(index));\n }\n if (isArrayNode(obj) || isMatrix(obj)) {\n var remainingDims = Array.from(index.dimensions);\n /* We will resolve constant indices one at a time, looking\n * just in the first or second dimensions because (a) arrays\n * of more than two dimensions are likely rare, and (b) pulling\n * out the third or higher dimension would be pretty intricate.\n * The price is that we miss simplifying [..3d array][x,y,1]\n */\n while (remainingDims.length > 0) {\n if (isConstantNode(remainingDims[0]) && typeof remainingDims[0].value !== 'string') {\n var first = _toNumber(remainingDims.shift().value, options);\n if (isArrayNode(obj)) {\n obj = obj.items[first - 1];\n } else {\n // matrix\n obj = obj.valueOf()[first - 1];\n if (obj instanceof Array) {\n obj = matrix(obj);\n }\n }\n } else if (remainingDims.length > 1 && isConstantNode(remainingDims[1]) && typeof remainingDims[1].value !== 'string') {\n var second = _toNumber(remainingDims[1].value, options);\n var tryItems = [];\n var fromItems = isArrayNode(obj) ? obj.items : obj.valueOf();\n for (var item of fromItems) {\n if (isArrayNode(item)) {\n tryItems.push(item.items[second - 1]);\n } else if (isMatrix(obj)) {\n tryItems.push(item[second - 1]);\n } else {\n break;\n }\n }\n if (tryItems.length === fromItems.length) {\n if (isArrayNode(obj)) {\n obj = new ArrayNode(tryItems);\n } else {\n // matrix\n obj = matrix(tryItems);\n }\n remainingDims.splice(1, 1);\n } else {\n // extracting slice along 2nd dimension failed, give up\n break;\n }\n } else {\n // neither 1st or 2nd dimension is constant, give up\n break;\n }\n }\n if (remainingDims.length === index.dimensions.length) {\n /* No successful constant indexing */\n return new AccessorNode(_ensureNode(obj), index);\n }\n if (remainingDims.length > 0) {\n /* Indexed some but not all dimensions */\n index = new IndexNode(remainingDims);\n return new AccessorNode(_ensureNode(obj), index);\n }\n /* All dimensions were constant, access completely resolved */\n return obj;\n }\n if (isObjectNode(obj) && index.dimensions.length === 1 && isConstantNode(index.dimensions[0])) {\n var key = index.dimensions[0].value;\n if (key in obj.properties) {\n return obj.properties[key];\n }\n return new ConstantNode(); // undefined\n }\n /* Don't know how to index this sort of obj, at least not with this index */\n return new AccessorNode(_ensureNode(obj), index);\n }\n\n /*\n * Create a binary tree from a list of Fractions and Nodes.\n * Tries to fold Fractions by evaluating them until the first Node in the list is hit, so\n * `args` should be sorted to have the Fractions at the start (if the operator is commutative).\n * @param args - list of Fractions and Nodes\n * @param fn - evaluator for the binary operation evaluator that accepts two Fractions\n * @param makeNode - creates a binary OperatorNode/FunctionNode from a list of child Nodes\n * if args.length is 1, returns args[0]\n * @return - Either a Node representing a binary expression or Fraction\n */\n function foldOp(fn, args, makeNode, options) {\n var first = args.shift();\n\n // In the following reduction, sofar always has one of the three following\n // forms: [NODE], [CONSTANT], or [NODE, CONSTANT]\n var reduction = args.reduce((sofar, next) => {\n if (!isNode(next)) {\n var last = sofar.pop();\n if (isNode(last)) {\n return [last, next];\n }\n // Two constants in a row, try to fold them into one\n try {\n sofar.push(_eval(fn, [last, next], options));\n return sofar;\n } catch (ignoreandcontinue) {\n sofar.push(last);\n // fall through to Node case\n }\n }\n\n // Encountered a Node, or failed folding --\n // collapse everything so far into a single tree:\n sofar.push(_ensureNode(sofar.pop()));\n var newtree = sofar.length === 1 ? sofar[0] : makeNode(sofar);\n return [makeNode([newtree, _ensureNode(next)])];\n }, [first]);\n if (reduction.length === 1) {\n return reduction[0];\n }\n // Might end up with a tree and a constant at the end:\n return makeNode([reduction[0], _toNode(reduction[1])]);\n }\n\n // destroys the original node and returns a folded one\n function foldFraction(node, options) {\n switch (node.type) {\n case 'SymbolNode':\n return node;\n case 'ConstantNode':\n switch (typeof node.value) {\n case 'number':\n return _toNumber(node.value, options);\n case 'bigint':\n return _toNumber(node.value, options);\n case 'string':\n return node.value;\n default:\n if (!isNaN(node.value)) return _toNumber(node.value, options);\n }\n return node;\n case 'FunctionNode':\n if (mathWithTransform[node.name] && mathWithTransform[node.name].rawArgs) {\n return node;\n }\n {\n // Process operators as OperatorNode\n var operatorFunctions = ['add', 'multiply'];\n if (!operatorFunctions.includes(node.name)) {\n var args = node.args.map(arg => foldFraction(arg, options));\n\n // If all args are numbers\n if (!args.some(isNode)) {\n try {\n return _eval(node.name, args, options);\n } catch (ignoreandcontinue) {}\n }\n\n // Size of a matrix does not depend on entries\n if (node.name === 'size' && args.length === 1 && isArrayNode(args[0])) {\n var sz = [];\n var section = args[0];\n while (isArrayNode(section)) {\n sz.push(section.items.length);\n section = section.items[0];\n }\n return matrix(sz);\n }\n\n // Convert all args to nodes and construct a symbolic function call\n return new FunctionNode(node.name, args.map(_ensureNode));\n } else {\n // treat as operator\n }\n }\n /* falls through */\n case 'OperatorNode':\n {\n var fn = node.fn.toString();\n var _args;\n var res;\n var makeNode = createMakeNodeFunction(node);\n if (isOperatorNode(node) && node.isUnary()) {\n _args = [foldFraction(node.args[0], options)];\n if (!isNode(_args[0])) {\n res = _eval(fn, _args, options);\n } else {\n res = makeNode(_args);\n }\n } else if (isAssociative(node, options.context)) {\n _args = allChildren(node, options.context);\n _args = _args.map(arg => foldFraction(arg, options));\n if (isCommutative(fn, options.context)) {\n // commutative binary operator\n var consts = [];\n var vars = [];\n for (var i = 0; i < _args.length; i++) {\n if (!isNode(_args[i])) {\n consts.push(_args[i]);\n } else {\n vars.push(_args[i]);\n }\n }\n if (consts.length > 1) {\n res = foldOp(fn, consts, makeNode, options);\n vars.unshift(res);\n res = foldOp(fn, vars, makeNode, options);\n } else {\n // we won't change the children order since it's not neccessary\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-commutative binary operator\n res = foldOp(fn, _args, makeNode, options);\n }\n } else {\n // non-associative binary operator\n _args = node.args.map(arg => foldFraction(arg, options));\n res = foldOp(fn, _args, makeNode, options);\n }\n return res;\n }\n case 'ParenthesisNode':\n // remove the uneccessary parenthesis\n return foldFraction(node.content, options);\n case 'AccessorNode':\n return _foldAccessor(foldFraction(node.object, options), foldFraction(node.index, options), options);\n case 'ArrayNode':\n {\n var foldItems = node.items.map(item => foldFraction(item, options));\n if (foldItems.some(isNode)) {\n return new ArrayNode(foldItems.map(_ensureNode));\n }\n /* All literals -- return a Matrix so we can operate on it */\n return matrix(foldItems);\n }\n case 'IndexNode':\n {\n return new IndexNode(node.dimensions.map(n => simplifyConstant(n, options)));\n }\n case 'ObjectNode':\n {\n var foldProps = {};\n for (var prop in node.properties) {\n foldProps[prop] = simplifyConstant(node.properties[prop], options);\n }\n return new ObjectNode(foldProps);\n }\n case 'AssignmentNode':\n /* falls through */\n case 'BlockNode':\n /* falls through */\n case 'FunctionAssignmentNode':\n /* falls through */\n case 'RangeNode':\n /* falls through */\n case 'ConditionalNode':\n /* falls through */\n default:\n throw new Error(\"Unimplemented node type in simplifyConstant: \".concat(node.type));\n }\n }\n return simplifyConstant;\n});","import { isAccessorNode, isArrayNode, isConstantNode, isFunctionNode, isIndexNode, isObjectNode, isOperatorNode } from '../../utils/is.js';\nimport { getOperator } from '../../expression/operators.js';\nimport { createUtil } from './simplify/util.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'simplifyCore';\nvar dependencies = ['typed', 'parse', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createSimplifyCore = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n var node0 = new ConstantNode(0);\n var node1 = new ConstantNode(1);\n var nodeT = new ConstantNode(true);\n var nodeF = new ConstantNode(false);\n // test if a node will always have a boolean value (true/false)\n // not sure if this list is complete\n function isAlwaysBoolean(node) {\n return isOperatorNode(node) && ['and', 'not', 'or'].includes(node.op);\n }\n var {\n hasProperty,\n isCommutative\n } = createUtil({\n FunctionNode,\n OperatorNode,\n SymbolNode\n });\n /**\n * simplifyCore() performs single pass simplification suitable for\n * applications requiring ultimate performance. To roughly summarize,\n * it handles cases along the lines of simplifyConstant() but where\n * knowledge of a single argument is sufficient to determine the value.\n * In contrast, simplify() extends simplifyCore() with additional passes\n * to provide deeper simplification (such as gathering like terms).\n *\n * Specifically, simplifyCore:\n *\n * * Converts all function calls with operator equivalents to their\n * operator forms.\n * * Removes operators or function calls that are guaranteed to have no\n * effect (such as unary '+').\n * * Removes double unary '-', '~', and 'not'\n * * Eliminates addition/subtraction of 0 and multiplication/division/powers\n * by 1 or 0.\n * * Converts addition of a negation into subtraction.\n * * Eliminates logical operations with constant true or false leading\n * arguments.\n * * Puts constants on the left of a product, if multiplication is\n * considered commutative by the options (which is the default)\n *\n * Syntax:\n *\n * math.simplifyCore(expr)\n * math.simplifyCore(expr, options)\n *\n * Examples:\n *\n * const f = math.parse('2 * 1 * x ^ (1 - 0)')\n * math.simplifyCore(f) // Node \"2 * x\"\n * math.simplify('2 * 1 * x ^ (1 - 0)', [math.simplifyCore]) // Node \"2 * x\"\n *\n * See also:\n *\n * simplify, simplifyConstant, resolve, derivative\n *\n * @param {Node | string} node\n * The expression to be simplified\n * @param {Object} options\n * Simplification options, as per simplify()\n * @return {Node} Returns expression with basic simplifications applied\n */\n function _simplifyCore(nodeToSimplify) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var context = options ? options.context : undefined;\n if (hasProperty(nodeToSimplify, 'trivial', context)) {\n // This node does nothing if it has only one argument, so if so,\n // return that argument simplified\n if (isFunctionNode(nodeToSimplify) && nodeToSimplify.args.length === 1) {\n return _simplifyCore(nodeToSimplify.args[0], options);\n }\n // For other node types, we try the generic methods\n var simpChild = false;\n var childCount = 0;\n nodeToSimplify.forEach(c => {\n ++childCount;\n if (childCount === 1) {\n simpChild = _simplifyCore(c, options);\n }\n });\n if (childCount === 1) {\n return simpChild;\n }\n }\n var node = nodeToSimplify;\n if (isFunctionNode(node)) {\n var op = getOperator(node.name);\n if (op) {\n // Replace FunctionNode with a new OperatorNode\n if (node.args.length > 2 && hasProperty(node, 'associative', context)) {\n // unflatten into binary operations since that's what simplifyCore handles\n while (node.args.length > 2) {\n var last = node.args.pop();\n var seclast = node.args.pop();\n node.args.push(new OperatorNode(op, node.name, [last, seclast]));\n }\n }\n node = new OperatorNode(op, node.name, node.args);\n } else {\n return new FunctionNode(_simplifyCore(node.fn), node.args.map(n => _simplifyCore(n, options)));\n }\n }\n if (isOperatorNode(node) && node.isUnary()) {\n var a0 = _simplifyCore(node.args[0], options);\n if (node.op === '~') {\n // bitwise not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === '~') {\n return a0.args[0];\n }\n }\n if (node.op === 'not') {\n // logical not\n if (isOperatorNode(a0) && a0.isUnary() && a0.op === 'not') {\n // Has the effect of turning the argument into a boolean\n // So can only eliminate the double negation if\n // the inside is already boolean\n if (isAlwaysBoolean(a0.args[0])) {\n return a0.args[0];\n }\n }\n }\n var finish = true;\n if (node.op === '-') {\n // unary minus\n if (isOperatorNode(a0)) {\n if (a0.isBinary() && a0.fn === 'subtract') {\n node = new OperatorNode('-', 'subtract', [a0.args[1], a0.args[0]]);\n finish = false; // continue to process the new binary node\n }\n if (a0.isUnary() && a0.op === '-') {\n return a0.args[0];\n }\n }\n }\n if (finish) return new OperatorNode(node.op, node.fn, [a0]);\n }\n if (isOperatorNode(node) && node.isBinary()) {\n var _a = _simplifyCore(node.args[0], options);\n var a1 = _simplifyCore(node.args[1], options);\n if (node.op === '+') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return a1;\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n a1 = a1.args[0];\n node = new OperatorNode('-', 'subtract', [_a, a1]);\n }\n }\n if (node.op === '-') {\n if (isOperatorNode(a1) && a1.isUnary() && a1.op === '-') {\n return _simplifyCore(new OperatorNode('+', 'add', [_a, a1.args[0]]), options);\n }\n if (isConstantNode(_a) && isZero(_a.value)) {\n return _simplifyCore(new OperatorNode('-', 'unaryMinus', [a1]));\n }\n if (isConstantNode(a1) && isZero(a1.value)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '*') {\n if (isConstantNode(_a)) {\n if (isZero(_a.value)) {\n return node0;\n } else if (equal(_a.value, 1)) {\n return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node0;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n if (isCommutative(node, context)) {\n return new OperatorNode(node.op, node.fn, [a1, _a], node.implicit); // constants on left\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1], node.implicit);\n }\n if (node.op === '/') {\n if (isConstantNode(_a) && isZero(_a.value)) {\n return node0;\n }\n if (isConstantNode(a1) && equal(a1.value, 1)) {\n return _a;\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (node.op === '^') {\n if (isConstantNode(a1)) {\n if (isZero(a1.value)) {\n return node1;\n } else if (equal(a1.value, 1)) {\n return _a;\n }\n }\n }\n if (node.op === 'and') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n if (isAlwaysBoolean(a1)) return a1;\n if (isConstantNode(a1)) {\n return a1.value ? nodeT : nodeF;\n }\n } else {\n return nodeF;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n if (isAlwaysBoolean(_a)) return _a;\n } else {\n return nodeF;\n }\n }\n }\n if (node.op === 'or') {\n if (isConstantNode(_a)) {\n if (_a.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(a1)) return a1;\n }\n }\n if (isConstantNode(a1)) {\n if (a1.value) {\n return nodeT;\n } else {\n if (isAlwaysBoolean(_a)) return _a;\n }\n }\n }\n return new OperatorNode(node.op, node.fn, [_a, a1]);\n }\n if (isOperatorNode(node)) {\n return new OperatorNode(node.op, node.fn, node.args.map(a => _simplifyCore(a, options)));\n }\n if (isArrayNode(node)) {\n return new ArrayNode(node.items.map(n => _simplifyCore(n, options)));\n }\n if (isAccessorNode(node)) {\n return new AccessorNode(_simplifyCore(node.object, options), _simplifyCore(node.index, options));\n }\n if (isIndexNode(node)) {\n return new IndexNode(node.dimensions.map(n => _simplifyCore(n, options)));\n }\n if (isObjectNode(node)) {\n var newProps = {};\n for (var prop in node.properties) {\n newProps[prop] = _simplifyCore(node.properties[prop], options);\n }\n return new ObjectNode(newProps);\n }\n // cannot simplify\n return node;\n }\n return typed(name, {\n Node: _simplifyCore,\n 'Node,Object': _simplifyCore\n });\n});","import { createMap } from '../../utils/map.js';\nimport { isFunctionNode, isNode, isOperatorNode, isParenthesisNode, isSymbolNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'resolve';\nvar dependencies = ['typed', 'parse', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode'];\nexport var createResolve = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n parse,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode\n } = _ref;\n /**\n * resolve(expr, scope) replaces variable nodes with their scoped values\n *\n * Syntax:\n *\n * math.resolve(expr, scope)\n *\n * Examples:\n *\n * math.resolve('x + y', {x:1, y:2}) // Node '1 + 2'\n * math.resolve(math.parse('x+y'), {x:1, y:2}) // Node '1 + 2'\n * math.simplify('x+y', {x:2, y: math.parse('x+x')}).toString() // \"6\"\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node | Node[]} node\n * The expression tree (or trees) to be simplified\n * @param {Object} scope\n * Scope specifying variables to be resolved\n * @return {Node | Node[]} Returns `node` with variables recursively substituted.\n * @throws {ReferenceError}\n * If there is a cyclic dependency among the variables in `scope`,\n * resolution is impossible and a ReferenceError is thrown.\n */\n function _resolve(node, scope) {\n var within = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set();\n // note `within`:\n // `within` is not documented, since it is for internal cycle\n // detection only\n if (!scope) {\n return node;\n }\n if (isSymbolNode(node)) {\n if (within.has(node.name)) {\n var variables = Array.from(within).join(', ');\n throw new ReferenceError(\"recursive loop of variable definitions among {\".concat(variables, \"}\"));\n }\n var value = scope.get(node.name);\n if (isNode(value)) {\n var nextWithin = new Set(within);\n nextWithin.add(node.name);\n return _resolve(value, scope, nextWithin);\n } else if (typeof value === 'number') {\n return parse(String(value));\n } else if (value !== undefined) {\n return new ConstantNode(value);\n } else {\n return node;\n }\n } else if (isOperatorNode(node)) {\n var args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new OperatorNode(node.op, node.fn, args, node.implicit);\n } else if (isParenthesisNode(node)) {\n return new ParenthesisNode(_resolve(node.content, scope, within));\n } else if (isFunctionNode(node)) {\n var _args = node.args.map(function (arg) {\n return _resolve(arg, scope, within);\n });\n return new FunctionNode(node.name, _args);\n }\n\n // Otherwise just recursively resolve any children (might also work\n // for some of the above special cases)\n return node.map(child => _resolve(child, scope, within));\n }\n return typed('resolve', {\n Node: _resolve,\n 'Node, Map | null | undefined': _resolve,\n 'Node, Object': (n, scope) => _resolve(n, createMap(scope)),\n // For arrays and matrices, we map `self` rather than `_resolve`\n // because resolve is fairly expensive anyway, and this way\n // we get nice error messages if one entry in the array has wrong type.\n 'Array | Matrix': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array | Matrix, null | undefined': typed.referToSelf(self => A => A.map(n => self(n))),\n 'Array, Object': typed.referTo('Array,Map', selfAM => (A, scope) => selfAM(A, createMap(scope))),\n 'Matrix, Object': typed.referTo('Matrix,Map', selfMM => (A, scope) => selfMM(A, createMap(scope))),\n 'Array | Matrix, Map': typed.referToSelf(self => (A, scope) => A.map(n => self(n, scope)))\n });\n});","import { isConstantNode } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'symbolicEqual';\nvar dependencies = ['parse', 'simplify', 'typed', 'OperatorNode'];\nexport var createSymbolicEqual = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n parse,\n simplify,\n typed,\n OperatorNode\n } = _ref;\n /**\n * Attempts to determine if two expressions are symbolically equal, i.e.\n * one is the result of valid algebraic manipulations on the other.\n * Currently, this simply checks if the difference of the two expressions\n * simplifies down to 0. So there are two important caveats:\n * 1. whether two expressions are symbolically equal depends on the\n * manipulations allowed. Therefore, this function takes an optional\n * third argument, which are the options that control the behavior\n * as documented for the `simplify()` function.\n * 2. it is in general intractable to find the minimal simplification of\n * an arbitrarily complicated expression. So while a `true` value\n * of `symbolicEqual` ensures that the two expressions can be manipulated\n * to match each other, a `false` value does not absolutely rule this out.\n *\n * Syntax:\n *\n * math.symbolicEqual(expr1, expr2)\n * math.symbolicEqual(expr1, expr2, options)\n *\n * Examples:\n *\n * math.symbolicEqual('x*y', 'y*x') // Returns true\n * math.symbolicEqual('x*y', 'y*x', {context: {multiply: {commutative: false}}}) // Returns false\n * math.symbolicEqual('x/y', '(y*x^(-1))^(-1)') // Returns true\n * math.symbolicEqual('abs(x)','x') // Returns false\n * math.symbolicEqual('abs(x)','x', simplify.positiveContext) // Returns true\n *\n * See also:\n *\n * simplify, evaluate\n *\n * @param {Node|string} expr1 The first expression to compare\n * @param {Node|string} expr2 The second expression to compare\n * @param {Object} [options] Optional option object, passed to simplify\n * @returns {boolean}\n * Returns true if a valid manipulation making the expressions equal\n * is found.\n */\n function _symbolicEqual(e1, e2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var diff = new OperatorNode('-', 'subtract', [e1, e2]);\n var simplified = simplify(diff, {}, options);\n return isConstantNode(simplified) && !simplified.value;\n }\n return typed(name, {\n 'Node, Node': _symbolicEqual,\n 'Node, Node, Object': _symbolicEqual\n });\n});","import { isConstantNode, typeOf } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { safeNumberType } from '../../utils/number.js';\nvar name = 'derivative';\nvar dependencies = ['typed', 'config', 'parse', 'simplify', 'equal', 'isZero', 'numeric', 'ConstantNode', 'FunctionNode', 'OperatorNode', 'ParenthesisNode', 'SymbolNode'];\nexport var createDerivative = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n parse,\n simplify,\n equal,\n isZero,\n numeric,\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode\n } = _ref;\n /**\n * Takes the derivative of an expression expressed in parser Nodes.\n * The derivative will be taken over the supplied variable in the\n * second parameter. If there are multiple variables in the expression,\n * it will return a partial derivative.\n *\n * This uses rules of differentiation which can be found here:\n *\n * - [Differentiation rules (Wikipedia)](https://en.wikipedia.org/wiki/Differentiation_rules)\n *\n * Syntax:\n *\n * math.derivative(expr, variable)\n * math.derivative(expr, variable, options)\n *\n * Examples:\n *\n * math.derivative('x^2', 'x') // Node '2 * x'\n * math.derivative('x^2', 'x', {simplify: false}) // Node '2 * 1 * x ^ (2 - 1)'\n * math.derivative('sin(2x)', 'x')) // Node '2 * cos(2 * x)'\n * math.derivative('2*x', 'x').evaluate() // number 2\n * math.derivative('x^2', 'x').evaluate({x: 4}) // number 8\n * const f = math.parse('x^2')\n * const x = math.parse('x')\n * math.derivative(f, x) // Node {2 * x}\n *\n * See also:\n *\n * simplify, parse, evaluate\n *\n * @param {Node | string} expr The expression to differentiate\n * @param {SymbolNode | string} variable The variable over which to differentiate\n * @param {{simplify: boolean}} [options]\n * There is one option available, `simplify`, which\n * is true by default. When false, output will not\n * be simplified.\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n function plainDerivative(expr, variable) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n simplify: true\n };\n var cache = new Map();\n var variableName = variable.name;\n function isConstCached(node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var res = _isConst(isConstCached, node, variableName);\n cache.set(node, res);\n return res;\n }\n var res = _derivative(expr, isConstCached);\n return options.simplify ? simplify(res) : res;\n }\n function parseIdentifier(string) {\n var symbol = parse(string);\n if (!symbol.isSymbolNode) {\n throw new TypeError('Invalid variable. ' + \"Cannot parse \".concat(JSON.stringify(string), \" into a variable in function derivative\"));\n }\n return symbol;\n }\n var derivative = typed(name, {\n 'Node, SymbolNode': plainDerivative,\n 'Node, SymbolNode, Object': plainDerivative,\n 'Node, string': (node, symbol) => plainDerivative(node, parseIdentifier(symbol)),\n 'Node, string, Object': (node, symbol, options) => plainDerivative(node, parseIdentifier(symbol), options)\n\n /* TODO: implement and test syntax with order of derivatives -> implement as an option {order: number}\n 'Node, SymbolNode, ConstantNode': function (expr, variable, {order}) {\n let res = expr\n for (let i = 0; i < order; i++) {\n <create caching isConst>\n res = _derivative(res, isConst)\n }\n return res\n }\n */\n });\n derivative._simplify = true;\n derivative.toTex = function (deriv) {\n return _derivTex.apply(null, deriv.args);\n };\n\n // FIXME: move the toTex method of derivative to latex.js. Difficulty is that it relies on parse.\n // NOTE: the optional \"order\" parameter here is currently unused\n var _derivTex = typed('_derivTex', {\n 'Node, SymbolNode': function Node_SymbolNode(expr, x) {\n if (isConstantNode(expr) && typeOf(expr.value) === 'string') {\n return _derivTex(parse(expr.value).toString(), x.toString(), 1);\n } else {\n return _derivTex(expr.toTex(), x.toString(), 1);\n }\n },\n 'Node, ConstantNode': function Node_ConstantNode(expr, x) {\n if (typeOf(x.value) === 'string') {\n return _derivTex(expr, parse(x.value));\n } else {\n throw new Error(\"The second parameter to 'derivative' is a non-string constant\");\n }\n },\n 'Node, SymbolNode, ConstantNode': function Node_SymbolNode_ConstantNode(expr, x, order) {\n return _derivTex(expr.toString(), x.name, order.value);\n },\n 'string, string, number': function string_string_number(expr, x, order) {\n var d;\n if (order === 1) {\n d = '{d\\\\over d' + x + '}';\n } else {\n d = '{d^{' + order + '}\\\\over d' + x + '^{' + order + '}}';\n }\n return d + \"\\\\left[\".concat(expr, \"\\\\right]\");\n }\n });\n\n /**\n * Checks if a node is constants (e.g. 2 + 2).\n * Accepts (usually memoized) version of self as the first parameter for recursive calls.\n * Classification is done as follows:\n *\n * 1. ConstantNodes are constants.\n * 2. If there exists a SymbolNode, of which we are differentiating over,\n * in the subtree it is not constant.\n *\n * @param {function} isConst Function that tells whether sub-expression is a constant\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {string} varName Variable that we are differentiating\n * @return {boolean} if node is constant\n */\n var _isConst = typed('_isConst', {\n 'function, ConstantNode, string': function function_ConstantNode_string() {\n return true;\n },\n 'function, SymbolNode, string': function function_SymbolNode_string(isConst, node, varName) {\n // Treat other variables like constants. For reasoning, see:\n // https://en.wikipedia.org/wiki/Partial_derivative\n return node.name !== varName;\n },\n 'function, ParenthesisNode, string': function function_ParenthesisNode_string(isConst, node, varName) {\n return isConst(node.content, varName);\n },\n 'function, FunctionAssignmentNode, string': function function_FunctionAssignmentNode_string(isConst, node, varName) {\n if (!node.params.includes(varName)) {\n return true;\n }\n return isConst(node.expr, varName);\n },\n 'function, FunctionNode | OperatorNode, string': function function_FunctionNode__OperatorNode_string(isConst, node, varName) {\n return node.args.every(arg => isConst(arg, varName));\n }\n });\n\n /**\n * Applies differentiation rules.\n *\n * @param {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} node\n * @param {function} isConst Function that tells if a node is constant\n * @return {ConstantNode | SymbolNode | ParenthesisNode | FunctionNode | OperatorNode} The derivative of `expr`\n */\n var _derivative = typed('_derivative', {\n 'ConstantNode, function': function ConstantNode_function() {\n return createConstantNode(0);\n },\n 'SymbolNode, function': function SymbolNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n return createConstantNode(1);\n },\n 'ParenthesisNode, function': function ParenthesisNode_function(node, isConst) {\n return new ParenthesisNode(_derivative(node.content, isConst));\n },\n 'FunctionAssignmentNode, function': function FunctionAssignmentNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n return _derivative(node.expr, isConst);\n },\n 'FunctionNode, function': function FunctionNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n var arg0 = node.args[0];\n var arg1;\n var div = false; // is output a fraction?\n var negative = false; // is output negative?\n\n var funcDerivative;\n switch (node.name) {\n case 'cbrt':\n // d/dx(cbrt(x)) = 1 / (3x^(2/3))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(3), new OperatorNode('^', 'pow', [arg0, new OperatorNode('/', 'divide', [createConstantNode(2), createConstantNode(3)])])]);\n break;\n case 'sqrt':\n case 'nthRoot':\n // d/dx(sqrt(x)) = 1 / (2*sqrt(x))\n if (node.args.length === 1) {\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [createConstantNode(2), new FunctionNode('sqrt', [arg0])]);\n } else if (node.args.length === 2) {\n // Rearrange from nthRoot(x, a) -> x^(1/a)\n arg1 = new OperatorNode('/', 'divide', [createConstantNode(1), node.args[1]]);\n return _derivative(new OperatorNode('^', 'pow', [arg0, arg1]), isConst);\n }\n break;\n case 'log10':\n arg1 = createConstantNode(10);\n /* fall through! */\n case 'log':\n if (!arg1 && node.args.length === 1) {\n // d/dx(log(x)) = 1 / x\n funcDerivative = arg0.clone();\n div = true;\n } else if (node.args.length === 1 && arg1 || node.args.length === 2 && isConst(node.args[1])) {\n // d/dx(log(x, c)) = 1 / (x*ln(c))\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('log', [arg1 || node.args[1]])]);\n div = true;\n } else if (node.args.length === 2) {\n // d/dx(log(f(x), g(x))) = d/dx(log(f(x)) / log(g(x)))\n return _derivative(new OperatorNode('/', 'divide', [new FunctionNode('log', [arg0]), new FunctionNode('log', [node.args[1]])]), isConst);\n }\n break;\n case 'pow':\n if (node.args.length === 2) {\n // Pass to pow operator node parser\n return _derivative(new OperatorNode('^', 'pow', [arg0, node.args[1]]), isConst);\n }\n break;\n case 'exp':\n // d/dx(e^x) = e^x\n funcDerivative = new FunctionNode('exp', [arg0.clone()]);\n break;\n case 'sin':\n // d/dx(sin(x)) = cos(x)\n funcDerivative = new FunctionNode('cos', [arg0.clone()]);\n break;\n case 'cos':\n // d/dx(cos(x)) = -sin(x)\n funcDerivative = new OperatorNode('-', 'unaryMinus', [new FunctionNode('sin', [arg0.clone()])]);\n break;\n case 'tan':\n // d/dx(tan(x)) = sec(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sec', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sec':\n // d/dx(sec(x)) = sec(x)tan(x)\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tan', [arg0.clone()])]);\n break;\n case 'csc':\n // d/dx(csc(x)) = -csc(x)cot(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('cot', [arg0.clone()])]);\n break;\n case 'cot':\n // d/dx(cot(x)) = -csc(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csc', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asin':\n // d/dx(asin(x)) = 1 / sqrt(1 - x^2)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'acos':\n // d/dx(acos(x)) = -1 / sqrt(1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])]);\n break;\n case 'atan':\n // d/dx(atan(x)) = 1 / (x^2 + 1)\n div = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'asec':\n // d/dx(asec(x)) = 1 / (|x|*sqrt(x^2 - 1))\n div = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acsc':\n // d/dx(acsc(x)) = -1 / (|x|*sqrt(x^2 - 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acot':\n // d/dx(acot(x)) = -1 / (x^2 + 1)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)]);\n break;\n case 'sinh':\n // d/dx(sinh(x)) = cosh(x)\n funcDerivative = new FunctionNode('cosh', [arg0.clone()]);\n break;\n case 'cosh':\n // d/dx(cosh(x)) = sinh(x)\n funcDerivative = new FunctionNode('sinh', [arg0.clone()]);\n break;\n case 'tanh':\n // d/dx(tanh(x)) = sech(x)^2\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('sech', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'sech':\n // d/dx(sech(x)) = -sech(x)tanh(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('tanh', [arg0.clone()])]);\n break;\n case 'csch':\n // d/dx(csch(x)) = -csch(x)coth(x)\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [node, new FunctionNode('coth', [arg0.clone()])]);\n break;\n case 'coth':\n // d/dx(coth(x)) = -csch(x)^2\n negative = true;\n funcDerivative = new OperatorNode('^', 'pow', [new FunctionNode('csch', [arg0.clone()]), createConstantNode(2)]);\n break;\n case 'asinh':\n // d/dx(asinh(x)) = 1 / sqrt(x^2 + 1)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'acosh':\n // d/dx(acosh(x)) = 1 / sqrt(x^2 - 1); XXX potentially only for x >= 1 (the real spectrum)\n div = true;\n funcDerivative = new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])]);\n break;\n case 'atanh':\n // d/dx(atanh(x)) = 1 / (1 - x^2)\n div = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'asech':\n // d/dx(asech(x)) = -1 / (x*sqrt(1 - x^2))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [arg0.clone(), new FunctionNode('sqrt', [new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])])])]);\n break;\n case 'acsch':\n // d/dx(acsch(x)) = -1 / (|x|*sqrt(x^2 + 1))\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('*', 'multiply', [new FunctionNode('abs', [arg0.clone()]), new FunctionNode('sqrt', [new OperatorNode('+', 'add', [new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)]), createConstantNode(1)])])]);\n break;\n case 'acoth':\n // d/dx(acoth(x)) = -1 / (1 - x^2)\n div = true;\n negative = true;\n funcDerivative = new OperatorNode('-', 'subtract', [createConstantNode(1), new OperatorNode('^', 'pow', [arg0.clone(), createConstantNode(2)])]);\n break;\n case 'abs':\n // d/dx(abs(x)) = abs(x)/x\n funcDerivative = new OperatorNode('/', 'divide', [new FunctionNode(new SymbolNode('abs'), [arg0.clone()]), arg0.clone()]);\n break;\n case 'gamma': // Needs digamma function, d/dx(gamma(x)) = gamma(x)digamma(x)\n default:\n throw new Error('Cannot process function \"' + node.name + '\" in derivative: ' + 'the function is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n var op, func;\n if (div) {\n op = '/';\n func = 'divide';\n } else {\n op = '*';\n func = 'multiply';\n }\n\n /* Apply chain rule to all functions:\n F(x) = f(g(x))\n F'(x) = g'(x)*f'(g(x)) */\n var chainDerivative = _derivative(arg0, isConst);\n if (negative) {\n chainDerivative = new OperatorNode('-', 'unaryMinus', [chainDerivative]);\n }\n return new OperatorNode(op, func, [chainDerivative, funcDerivative]);\n },\n 'OperatorNode, function': function OperatorNode_function(node, isConst) {\n if (isConst(node)) {\n return createConstantNode(0);\n }\n if (node.op === '+') {\n // d/dx(sum(f(x)) = sum(f'(x))\n return new OperatorNode(node.op, node.fn, node.args.map(function (arg) {\n return _derivative(arg, isConst);\n }));\n }\n if (node.op === '-') {\n // d/dx(+/-f(x)) = +/-f'(x)\n if (node.isUnary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst)]);\n }\n\n // Linearity of differentiation, d/dx(f(x) +/- g(x)) = f'(x) +/- g'(x)\n if (node.isBinary()) {\n return new OperatorNode(node.op, node.fn, [_derivative(node.args[0], isConst), _derivative(node.args[1], isConst)]);\n }\n }\n if (node.op === '*') {\n // d/dx(c*f(x)) = c*f'(x)\n var constantTerms = node.args.filter(function (arg) {\n return isConst(arg);\n });\n if (constantTerms.length > 0) {\n var nonConstantTerms = node.args.filter(function (arg) {\n return !isConst(arg);\n });\n var nonConstantNode = nonConstantTerms.length === 1 ? nonConstantTerms[0] : new OperatorNode('*', 'multiply', nonConstantTerms);\n var newArgs = constantTerms.concat(_derivative(nonConstantNode, isConst));\n return new OperatorNode('*', 'multiply', newArgs);\n }\n\n // Product Rule, d/dx(f(x)*g(x)) = f'(x)*g(x) + f(x)*g'(x)\n return new OperatorNode('+', 'add', node.args.map(function (argOuter) {\n return new OperatorNode('*', 'multiply', node.args.map(function (argInner) {\n return argInner === argOuter ? _derivative(argInner, isConst) : argInner.clone();\n }));\n }));\n }\n if (node.op === '/' && node.isBinary()) {\n var arg0 = node.args[0];\n var arg1 = node.args[1];\n\n // d/dx(f(x) / c) = f'(x) / c\n if (isConst(arg1)) {\n return new OperatorNode('/', 'divide', [_derivative(arg0, isConst), arg1]);\n }\n\n // Reciprocal Rule, d/dx(c / f(x)) = -c(f'(x)/f(x)^2)\n if (isConst(arg0)) {\n return new OperatorNode('*', 'multiply', [new OperatorNode('-', 'unaryMinus', [arg0]), new OperatorNode('/', 'divide', [_derivative(arg1, isConst), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])])]);\n }\n\n // Quotient rule, d/dx(f(x) / g(x)) = (f'(x)g(x) - f(x)g'(x)) / g(x)^2\n return new OperatorNode('/', 'divide', [new OperatorNode('-', 'subtract', [new OperatorNode('*', 'multiply', [_derivative(arg0, isConst), arg1.clone()]), new OperatorNode('*', 'multiply', [arg0.clone(), _derivative(arg1, isConst)])]), new OperatorNode('^', 'pow', [arg1.clone(), createConstantNode(2)])]);\n }\n if (node.op === '^' && node.isBinary()) {\n var _arg = node.args[0];\n var _arg2 = node.args[1];\n if (isConst(_arg)) {\n // If is secretly constant; 0^f(x) = 1 (in JS), 1^f(x) = 1\n if (isConstantNode(_arg) && (isZero(_arg.value) || equal(_arg.value, 1))) {\n return createConstantNode(0);\n }\n\n // d/dx(c^f(x)) = c^f(x)*ln(c)*f'(x)\n return new OperatorNode('*', 'multiply', [node, new OperatorNode('*', 'multiply', [new FunctionNode('log', [_arg.clone()]), _derivative(_arg2.clone(), isConst)])]);\n }\n if (isConst(_arg2)) {\n if (isConstantNode(_arg2)) {\n // If is secretly constant; f(x)^0 = 1 -> d/dx(1) = 0\n if (isZero(_arg2.value)) {\n return createConstantNode(0);\n }\n // Ignore exponent; f(x)^1 = f(x)\n if (equal(_arg2.value, 1)) {\n return _derivative(_arg, isConst);\n }\n }\n\n // Elementary Power Rule, d/dx(f(x)^c) = c*f'(x)*f(x)^(c-1)\n var powMinusOne = new OperatorNode('^', 'pow', [_arg.clone(), new OperatorNode('-', 'subtract', [_arg2, createConstantNode(1)])]);\n return new OperatorNode('*', 'multiply', [_arg2.clone(), new OperatorNode('*', 'multiply', [_derivative(_arg, isConst), powMinusOne])]);\n }\n\n // Functional Power Rule, d/dx(f^g) = f^g*[f'*(g/f) + g'ln(f)]\n return new OperatorNode('*', 'multiply', [new OperatorNode('^', 'pow', [_arg.clone(), _arg2.clone()]), new OperatorNode('+', 'add', [new OperatorNode('*', 'multiply', [_derivative(_arg, isConst), new OperatorNode('/', 'divide', [_arg2.clone(), _arg.clone()])]), new OperatorNode('*', 'multiply', [_derivative(_arg2, isConst), new FunctionNode('log', [_arg.clone()])])])]);\n }\n throw new Error('Cannot process operator \"' + node.op + '\" in derivative: ' + 'the operator is not supported, undefined, or the number of arguments passed to it are not supported');\n }\n });\n\n /**\n * Helper function to create a constant node with a specific type\n * (number, BigNumber, Fraction)\n * @param {number} value\n * @param {string} [valueType]\n * @return {ConstantNode}\n */\n function createConstantNode(value, valueType) {\n return new ConstantNode(numeric(value, valueType || safeNumberType(String(value), config)));\n }\n return derivative;\n});","import { isInteger } from '../../utils/number.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'rationalize';\nvar dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplifyConstant', 'simplifyCore', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];\nexport var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n config,\n typed,\n equal,\n isZero,\n add,\n subtract,\n multiply,\n divide,\n pow,\n parse,\n simplifyConstant,\n simplifyCore,\n simplify,\n fraction,\n bignumber,\n mathWithTransform,\n matrix,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n ParenthesisNode\n } = _ref;\n /**\n * Transform a rationalizable expression in a rational fraction.\n * If rational fraction is one variable polynomial then converts\n * the numerator and denominator in canonical form, with decreasing\n * exponents, returning the coefficients of numerator.\n *\n * Syntax:\n *\n * math.rationalize(expr)\n * math.rationalize(expr, detailed)\n * math.rationalize(expr, scope)\n * math.rationalize(expr, scope, detailed)\n *\n * Examples:\n *\n * math.rationalize('sin(x)+y')\n * // Error: There is an unsolved function call\n * math.rationalize('2x/y - y/(x+1)')\n * // (2*x^2-y^2+2*x)/(x*y+y)\n * math.rationalize('(2x+1)^6')\n * // 64*x^6+192*x^5+240*x^4+160*x^3+60*x^2+12*x+1\n * math.rationalize('2x/( (2x-1) / (3x+2) ) - 5x/ ( (3x+4) / (2x^2-5) ) + 3')\n * // -20*x^4+28*x^3+104*x^2+6*x-12)/(6*x^2+5*x-4)\n * math.rationalize('x/(1-x)/(x-2)/(x-3)/(x-4) + 2x/ ( (1-2x)/(2-3x) )/ ((3-4x)/(4-5x) )') =\n * // (-30*x^7+344*x^6-1506*x^5+3200*x^4-3472*x^3+1846*x^2-381*x)/\n * // (-8*x^6+90*x^5-383*x^4+780*x^3-797*x^2+390*x-72)\n *\n * math.rationalize('x+x+x+y',{y:1}) // 3*x+1\n * math.rationalize('x+x+x+y',{}) // 3*x+y\n *\n * const ret = math.rationalize('x+x+x+y',{},true)\n * // ret.expression=3*x+y, ret.variables = [\"x\",\"y\"]\n * const ret = math.rationalize('-2+5x^2',{},true)\n * // ret.expression=5*x^2-2, ret.variables = [\"x\"], ret.coefficients=[-2,0,5]\n *\n * See also:\n *\n * simplify\n *\n * @param {Node|string} expr The expression to check if is a polynomial expression\n * @param {Object|boolean} optional scope of expression or true for already evaluated rational expression at input\n * @param {Boolean} detailed optional True if return an object, false if return expression node (default)\n *\n * @return {Object | Node} The rational polynomial of `expr` or an object\n * `{expression, numerator, denominator, variables, coefficients}`, where\n * `expression` is a `Node` with the node simplified expression,\n * `numerator` is a `Node` with the simplified numerator of expression,\n * `denominator` is a `Node` or `boolean` with the simplified denominator or `false` (if there is no denominator),\n * `variables` is an array with variable names,\n * and `coefficients` is an array with coefficients of numerator sorted by increased exponent\n * {Expression Node} node simplified expression\n *\n */\n function _rationalize(expr) {\n var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var detailed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var setRules = rulesRationalize(); // Rules for change polynomial in near canonical form\n var polyRet = polynomial(expr, scope, true, setRules.firstRules); // Check if expression is a rationalizable polynomial\n var nVars = polyRet.variables.length;\n var noExactFractions = {\n exactFractions: false\n };\n var withExactFractions = {\n exactFractions: true\n };\n expr = polyRet.expression;\n if (nVars >= 1) {\n // If expression in not a constant\n expr = expandPower(expr); // First expand power of polynomials (cannot be made from rules!)\n var sBefore; // Previous expression\n var rules;\n var eDistrDiv = true;\n var redoInic = false;\n // Apply the initial rules, including succ div rules:\n expr = simplify(expr, setRules.firstRules, {}, noExactFractions);\n var s;\n while (true) {\n // Alternate applying successive division rules and distr.div.rules\n // until there are no more changes:\n rules = eDistrDiv ? setRules.distrDivRules : setRules.sucDivRules;\n expr = simplify(expr, rules, {}, withExactFractions);\n eDistrDiv = !eDistrDiv; // Swap between Distr.Div and Succ. Div. Rules\n\n s = expr.toString();\n if (s === sBefore) {\n break; // No changes : end of the loop\n }\n redoInic = true;\n sBefore = s;\n }\n if (redoInic) {\n // Apply first rules again without succ div rules (if there are changes)\n expr = simplify(expr, setRules.firstRulesAgain, {}, noExactFractions);\n }\n // Apply final rules:\n expr = simplify(expr, setRules.finalRules, {}, noExactFractions);\n } // NVars >= 1\n\n var coefficients = [];\n var retRationalize = {};\n if (expr.type === 'OperatorNode' && expr.isBinary() && expr.op === '/') {\n // Separate numerator from denominator\n if (nVars === 1) {\n expr.args[0] = polyToCanonical(expr.args[0], coefficients);\n expr.args[1] = polyToCanonical(expr.args[1]);\n }\n if (detailed) {\n retRationalize.numerator = expr.args[0];\n retRationalize.denominator = expr.args[1];\n }\n } else {\n if (nVars === 1) {\n expr = polyToCanonical(expr, coefficients);\n }\n if (detailed) {\n retRationalize.numerator = expr;\n retRationalize.denominator = null;\n }\n }\n // nVars\n\n if (!detailed) return expr;\n retRationalize.coefficients = coefficients;\n retRationalize.variables = polyRet.variables;\n retRationalize.expression = expr;\n return retRationalize;\n }\n return typed(name, {\n Node: _rationalize,\n 'Node, boolean': (expr, detailed) => _rationalize(expr, {}, detailed),\n 'Node, Object': _rationalize,\n 'Node, Object, boolean': _rationalize\n }); // end of typed rationalize\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * polynomial(expr,scope,extended, rules)\n *\n * @param {Node | string} expr The expression to simplify and check if is polynomial expression\n * @param {object} scope Optional scope for expression simplification\n * @param {boolean} extended Optional. Default is false. When true allows divide operator.\n * @param {array} rules Optional. Default is no rule.\n *\n *\n * @return {Object}\n * {Object} node: node simplified expression\n * {Array} variables: variable names\n */\n function polynomial(expr, scope, extended, rules) {\n var variables = [];\n var node = simplify(expr, rules, scope, {\n exactFractions: false\n }); // Resolves any variables and functions with all defined parameters\n extended = !!extended;\n var oper = '+-*' + (extended ? '/' : '');\n recPoly(node);\n var retFunc = {};\n retFunc.expression = node;\n retFunc.variables = variables;\n return retFunc;\n\n // -------------------------------------------------------------------------------------------------------\n\n /**\n * Function to simplify an expression using an optional scope and\n * return it if the expression is a polynomial expression, i.e.\n * an expression with one or more variables and the operators\n * +, -, *, and ^, where the exponent can only be a positive integer.\n *\n * Syntax:\n *\n * recPoly(node)\n *\n *\n * @param {Node} node The current sub tree expression in recursion\n *\n * @return nothing, throw an exception if error\n */\n function recPoly(node) {\n var tp = node.type; // node type\n if (tp === 'FunctionNode') {\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n if (node.op === '^') {\n // TODO: handle negative exponents like in '1/x^(-2)'\n if (node.args[1].type !== 'ConstantNode' || !isInteger(parseFloat(node.args[1].value))) {\n throw new Error('There is a non-integer exponent');\n } else {\n recPoly(node.args[0]);\n }\n } else {\n if (!oper.includes(node.op)) {\n throw new Error('Operator ' + node.op + ' invalid in polynomial expression');\n }\n for (var i = 0; i < node.args.length; i++) {\n recPoly(node.args[i]);\n }\n } // type of operator\n } else if (tp === 'SymbolNode') {\n var _name = node.name; // variable name\n var pos = variables.indexOf(_name);\n if (pos === -1) {\n // new variable in expression\n variables.push(_name);\n }\n } else if (tp === 'ParenthesisNode') {\n recPoly(node.content);\n } else if (tp !== 'ConstantNode') {\n throw new Error('type ' + tp + ' is not allowed in polynomial expression');\n }\n } // end of recPoly\n } // end of polynomial\n\n // ---------------------------------------------------------------------------------------\n /**\n * Return a rule set to rationalize an polynomial expression in rationalize\n *\n * Syntax:\n *\n * rulesRationalize()\n *\n * @return {array} rule set to rationalize an polynomial expression\n */\n function rulesRationalize() {\n var oldRules = [simplifyCore,\n // sCore\n {\n l: 'n+n',\n r: '2*n'\n }, {\n l: 'n+-n',\n r: '0'\n }, simplifyConstant,\n // sConstant\n {\n l: 'n*(n1^-1)',\n r: 'n/n1'\n }, {\n l: 'n*n1^-n2',\n r: 'n/n1^n2'\n }, {\n l: 'n1^-1',\n r: '1/n1'\n }, {\n l: 'n*(n1/n2)',\n r: '(n*n1)/n2'\n }, {\n l: '1*n',\n r: 'n'\n }];\n var rulesFirst = [{\n l: '(-n1)/(-n2)',\n r: 'n1/n2'\n },\n // Unary division\n {\n l: '(-n1)*(-n2)',\n r: 'n1*n2'\n },\n // Unary multiplication\n {\n l: 'n1--n2',\n r: 'n1+n2'\n },\n // '--' elimination\n {\n l: 'n1-n2',\n r: 'n1+(-n2)'\n },\n // Subtraction turn into add with un�ry minus\n {\n l: '(n1+n2)*n3',\n r: '(n1*n3 + n2*n3)'\n },\n // Distributive 1\n {\n l: 'n1*(n2+n3)',\n r: '(n1*n2+n1*n3)'\n },\n // Distributive 2\n {\n l: 'c1*n + c2*n',\n r: '(c1+c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n + n',\n r: '(c1+1)*n'\n },\n // Joining constants\n {\n l: 'c1*n - c2*n',\n r: '(c1-c2)*n'\n },\n // Joining constants\n {\n l: 'c1*n - n',\n r: '(c1-1)*n'\n },\n // Joining constants\n {\n l: 'v/c',\n r: '(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: 'v/-c',\n r: '-(1/c)*v'\n },\n // variable/constant (new!)\n {\n l: '-v*-c',\n r: 'c*v'\n },\n // Inversion constant and variable 1\n {\n l: '-v*c',\n r: '-c*v'\n },\n // Inversion constant and variable 2\n {\n l: 'v*-c',\n r: '-c*v'\n },\n // Inversion constant and variable 3\n {\n l: 'v*c',\n r: 'c*v'\n },\n // Inversion constant and variable 4\n {\n l: '-(-n1*n2)',\n r: '(n1*n2)'\n },\n // Unary propagation\n {\n l: '-(n1*n2)',\n r: '(-n1*n2)'\n },\n // Unary propagation\n {\n l: '-(-n1+n2)',\n r: '(n1-n2)'\n },\n // Unary propagation\n {\n l: '-(n1+n2)',\n r: '(-n1-n2)'\n },\n // Unary propagation\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n },\n // Power to Power\n {\n l: '-(-n1/n2)',\n r: '(n1/n2)'\n },\n // Division and Unary\n {\n l: '-(n1/n2)',\n r: '(-n1/n2)'\n }]; // Divisao and Unary\n\n var rulesDistrDiv = [{\n l: '(n1/n2 + n3/n4)',\n r: '((n1*n4 + n3*n2)/(n2*n4))'\n },\n // Sum of fractions\n {\n l: '(n1/n2 + n3)',\n r: '((n1 + n3*n2)/n2)'\n },\n // Sum fraction with number 1\n {\n l: '(n1 + n2/n3)',\n r: '((n1*n3 + n2)/n3)'\n }]; // Sum fraction with number 1\n\n var rulesSucDiv = [{\n l: '(n1/(n2/n3))',\n r: '((n1*n3)/n2)'\n },\n // Division simplification\n {\n l: '(n1/n2/n3)',\n r: '(n1/(n2*n3))'\n }];\n var setRules = {}; // rules set in 4 steps.\n\n // All rules => infinite loop\n // setRules.allRules =oldRules.concat(rulesFirst,rulesDistrDiv,rulesSucDiv)\n\n setRules.firstRules = oldRules.concat(rulesFirst, rulesSucDiv); // First rule set\n setRules.distrDivRules = rulesDistrDiv; // Just distr. div. rules\n setRules.sucDivRules = rulesSucDiv; // Jus succ. div. rules\n setRules.firstRulesAgain = oldRules.concat(rulesFirst); // Last rules set without succ. div.\n\n // Division simplification\n\n // Second rule set.\n // There is no aggregate expression with parentesis, but the only variable can be scattered.\n setRules.finalRules = [simplifyCore,\n // simplify.rules[0]\n {\n l: 'n*-n',\n r: '-n^2'\n },\n // Joining multiply with power 1\n {\n l: 'n*n',\n r: 'n^2'\n },\n // Joining multiply with power 2\n simplifyConstant,\n // simplify.rules[14] old 3rd index in oldRules\n {\n l: 'n*-n^n1',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 3\n {\n l: 'n*n^n1',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 4\n {\n l: 'n^n1*-n^n2',\n r: '-n^(n1+n2)'\n },\n // Joining multiply with power 5\n {\n l: 'n^n1*n^n2',\n r: 'n^(n1+n2)'\n },\n // Joining multiply with power 6\n {\n l: 'n^n1*-n',\n r: '-n^(n1+1)'\n },\n // Joining multiply with power 7\n {\n l: 'n^n1*n',\n r: 'n^(n1+1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/-n',\n r: '-n^(n1-1)'\n },\n // Joining multiply with power 8\n {\n l: 'n^n1/n',\n r: 'n^(n1-1)'\n },\n // Joining division with power 1\n {\n l: 'n/-n^n1',\n r: '-n^(1-n1)'\n },\n // Joining division with power 2\n {\n l: 'n/n^n1',\n r: 'n^(1-n1)'\n },\n // Joining division with power 3\n {\n l: 'n^n1/-n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 4\n {\n l: 'n^n1/n^n2',\n r: 'n^(n1-n2)'\n },\n // Joining division with power 5\n {\n l: 'n1+(-n2*n3)',\n r: 'n1-n2*n3'\n },\n // Solving useless parenthesis 1\n {\n l: 'v*(-c)',\n r: '-c*v'\n },\n // Solving useless unary 2\n {\n l: 'n1+-n2',\n r: 'n1-n2'\n },\n // Solving +- together (new!)\n {\n l: 'v*c',\n r: 'c*v'\n },\n // inversion constant with variable\n {\n l: '(n1^n2)^n3',\n r: '(n1^(n2*n3))'\n } // Power to Power\n ];\n return setRules;\n } // End rulesRationalize\n\n // ---------------------------------------------------------------------------------------\n /**\n * Expand recursively a tree node for handling with expressions with exponents\n * (it's not for constants, symbols or functions with exponents)\n * PS: The other parameters are internal for recursion\n *\n * Syntax:\n *\n * expandPower(node)\n *\n * @param {Node} node Current expression node\n * @param {node} parent Parent current node inside the recursion\n * @param (int} Parent number of chid inside the rercursion\n *\n * @return {node} node expression with all powers expanded.\n */\n function expandPower(node, parent, indParent) {\n var tp = node.type;\n var internal = arguments.length > 1; // TRUE in internal calls\n\n if (tp === 'OperatorNode' && node.isBinary()) {\n var does = false;\n var val;\n if (node.op === '^') {\n // First operator: Parenthesis or UnaryMinus\n if ((node.args[0].type === 'ParenthesisNode' || node.args[0].type === 'OperatorNode') && node.args[1].type === 'ConstantNode') {\n // Second operator: Constant\n val = parseFloat(node.args[1].value);\n does = val >= 2 && isInteger(val);\n }\n }\n if (does) {\n // Exponent >= 2\n // Before:\n // operator A --> Subtree\n // parent pow\n // constant\n //\n if (val > 2) {\n // Exponent > 2,\n // AFTER: (exponent > 2)\n // operator A --> Subtree\n // parent *\n // deep clone (operator A --> Subtree\n // pow\n // constant - 1\n //\n var nEsqTopo = node.args[0];\n var nDirTopo = new OperatorNode('^', 'pow', [node.args[0].cloneDeep(), new ConstantNode(val - 1)]);\n node = new OperatorNode('*', 'multiply', [nEsqTopo, nDirTopo]);\n } else {\n // Expo = 2 - no power\n // AFTER: (exponent = 2)\n // operator A --> Subtree\n // parent oper\n // deep clone (operator A --> Subtree)\n //\n node = new OperatorNode('*', 'multiply', [node.args[0], node.args[0].cloneDeep()]);\n }\n if (internal) {\n // Change parent references in internal recursive calls\n if (indParent === 'content') {\n parent.content = node;\n } else {\n parent.args[indParent] = node;\n }\n }\n } // does\n } // binary OperatorNode\n\n if (tp === 'ParenthesisNode') {\n // Recursion\n expandPower(node.content, node, 'content');\n } else if (tp !== 'ConstantNode' && tp !== 'SymbolNode') {\n for (var i = 0; i < node.args.length; i++) {\n expandPower(node.args[i], node, i);\n }\n }\n if (!internal) {\n // return the root node\n return node;\n }\n } // End expandPower\n\n // ---------------------------------------------------------------------------------------\n /**\n * Auxilary function for rationalize\n * Convert near canonical polynomial in one variable in a canonical polynomial\n * with one term for each exponent in decreasing order\n *\n * Syntax:\n *\n * polyToCanonical(node [, coefficients])\n *\n * @param {Node | string} expr The near canonical polynomial expression to convert in a a canonical polynomial expression\n *\n * The string or tree expression needs to be at below syntax, with free spaces:\n * ( (^(-)? | [+-]? )cte (*)? var (^expo)? | cte )+\n * Where 'var' is one variable with any valid name\n * 'cte' are real numeric constants with any value. It can be omitted if equal than 1\n * 'expo' are integers greater than 0. It can be omitted if equal than 1.\n *\n * @param {array} coefficients Optional returns coefficients sorted by increased exponent\n *\n *\n * @return {node} new node tree with one variable polynomial or string error.\n */\n function polyToCanonical(node, coefficients) {\n if (coefficients === undefined) {\n coefficients = [];\n } // coefficients.\n\n coefficients[0] = 0; // index is the exponent\n var o = {};\n o.cte = 1;\n o.oper = '+';\n\n // fire: mark with * or ^ when finds * or ^ down tree, reset to \"\" with + and -.\n // It is used to deduce the exponent: 1 for *, 0 for \"\".\n o.fire = '';\n var maxExpo = 0; // maximum exponent\n var varname = ''; // variable name\n\n recurPol(node, null, o);\n maxExpo = coefficients.length - 1;\n var first = true;\n var no;\n for (var i = maxExpo; i >= 0; i--) {\n if (coefficients[i] === 0) continue;\n var n1 = new ConstantNode(first ? coefficients[i] : Math.abs(coefficients[i]));\n var op = coefficients[i] < 0 ? '-' : '+';\n if (i > 0) {\n // Is not a constant without variable\n var n2 = new SymbolNode(varname);\n if (i > 1) {\n var n3 = new ConstantNode(i);\n n2 = new OperatorNode('^', 'pow', [n2, n3]);\n }\n if (coefficients[i] === -1 && first) {\n n1 = new OperatorNode('-', 'unaryMinus', [n2]);\n } else if (Math.abs(coefficients[i]) === 1) {\n n1 = n2;\n } else {\n n1 = new OperatorNode('*', 'multiply', [n1, n2]);\n }\n }\n if (first) {\n no = n1;\n } else if (op === '+') {\n no = new OperatorNode('+', 'add', [no, n1]);\n } else {\n no = new OperatorNode('-', 'subtract', [no, n1]);\n }\n first = false;\n } // for\n\n if (first) {\n return new ConstantNode(0);\n } else {\n return no;\n }\n\n /**\n * Recursive auxilary function inside polyToCanonical for\n * converting expression in canonical form\n *\n * Syntax:\n *\n * recurPol(node, noPai, obj)\n *\n * @param {Node} node The current subpolynomial expression\n * @param {Node | Null} noPai The current parent node\n * @param {object} obj Object with many internal flags\n *\n * @return {} No return. If error, throws an exception\n */\n function recurPol(node, noPai, o) {\n var tp = node.type;\n if (tp === 'FunctionNode') {\n // ***** FunctionName *****\n // No function call in polynomial expression\n throw new Error('There is an unsolved function call');\n } else if (tp === 'OperatorNode') {\n // ***** OperatorName *****\n if (!'+-*^'.includes(node.op)) throw new Error('Operator ' + node.op + ' invalid');\n if (noPai !== null) {\n // -(unary),^ : children of *,+,-\n if ((node.fn === 'unaryMinus' || node.fn === 'pow') && noPai.fn !== 'add' && noPai.fn !== 'subtract' && noPai.fn !== 'multiply') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+,* : children of +,-\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'multiply') && noPai.fn !== 'add' && noPai.fn !== 'subtract') {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n\n // -,+ : first child\n if ((node.fn === 'subtract' || node.fn === 'add' || node.fn === 'unaryMinus') && o.noFil !== 0) {\n throw new Error('Invalid ' + node.op + ' placing');\n }\n } // Has parent\n\n // Firers: ^,* Old: ^,&,-(unary): firers\n if (node.op === '^' || node.op === '*') {\n o.fire = node.op;\n }\n for (var _i = 0; _i < node.args.length; _i++) {\n // +,-: reset fire\n if (node.fn === 'unaryMinus') o.oper = '-';\n if (node.op === '+' || node.fn === 'subtract') {\n o.fire = '';\n o.cte = 1; // default if there is no constant\n o.oper = _i === 0 ? '+' : node.op;\n }\n o.noFil = _i; // number of son\n recurPol(node.args[_i], node, o);\n } // for in children\n } else if (tp === 'SymbolNode') {\n // ***** SymbolName *****\n if (node.name !== varname && varname !== '') {\n throw new Error('There is more than one variable');\n }\n varname = node.name;\n if (noPai === null) {\n coefficients[1] = 1;\n return;\n }\n\n // ^: Symbol is First child\n if (noPai.op === '^' && o.noFil !== 0) {\n throw new Error('In power the variable should be the first parameter');\n }\n\n // *: Symbol is Second child\n if (noPai.op === '*' && o.noFil !== 1) {\n throw new Error('In multiply the variable should be the second parameter');\n }\n\n // Symbol: firers '',* => it means there is no exponent above, so it's 1 (cte * var)\n if (o.fire === '' || o.fire === '*') {\n if (maxExpo < 1) coefficients[1] = 0;\n coefficients[1] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(1, maxExpo);\n }\n } else if (tp === 'ConstantNode') {\n var valor = parseFloat(node.value);\n if (noPai === null) {\n coefficients[0] = valor;\n return;\n }\n if (noPai.op === '^') {\n // cte: second child of power\n if (o.noFil !== 1) throw new Error('Constant cannot be powered');\n if (!isInteger(valor) || valor <= 0) {\n throw new Error('Non-integer exponent is not allowed');\n }\n for (var _i2 = maxExpo + 1; _i2 < valor; _i2++) coefficients[_i2] = 0;\n if (valor > maxExpo) coefficients[valor] = 0;\n coefficients[valor] += o.cte * (o.oper === '+' ? 1 : -1);\n maxExpo = Math.max(valor, maxExpo);\n return;\n }\n o.cte = valor;\n\n // Cte: firer '' => There is no exponent and no multiplication, so the exponent is 0.\n if (o.fire === '') {\n coefficients[0] += o.cte * (o.oper === '+' ? 1 : -1);\n }\n } else {\n throw new Error('Type ' + tp + ' is not allowed');\n }\n } // End of recurPol\n } // End of polyToCanonical\n});","import { factory } from '../utils/factory.js';\nvar name = 'reviver';\nvar dependencies = ['classes'];\nexport var createReviver = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n classes\n } = _ref;\n /**\n * Instantiate mathjs data types from their JSON representation\n * @param {string} key\n * @param {*} value\n * @returns {*} Returns the revived object\n */\n return function reviver(key, value) {\n var constructor = classes[value && value.mathjs];\n if (constructor && typeof constructor.fromJSON === 'function') {\n return constructor.fromJSON(value);\n }\n return value;\n };\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createMapSlices } from '../../function/matrix/mapSlices.js';\nimport { isBigNumber, isNumber } from '../../utils/is.js';\nvar name = 'mapSlices';\nvar dependencies = ['typed', 'isInteger'];\n\n/**\n * Attach a transform function to math.mapSlices\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mapSlices\n * from one-based to zero based\n */\nexport var createMapSlicesTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n isInteger\n } = _ref;\n var mapSlices = createMapSlices({\n typed,\n isInteger\n });\n\n // @see: comment of concat itself\n return typed('mapSlices', {\n '...any': function any(args) {\n // change dim from one-based to zero-based\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n try {\n return mapSlices.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, _objectSpread({\n isTransformFunction: true\n}, createMapSlices.meta));","import { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createColumn } from '../../function/matrix/column.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'column';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createColumnTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var column = createColumn({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of column itself\n return typed('column', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return column.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { isSymbolNode } from '../../../utils/is.js';\nimport { PartitionedMap } from '../../../utils/map.js';\n\n/**\n * Compile an inline expression like \"x > 0\"\n * @param {Node} expression\n * @param {Object} math\n * @param {Map} scope\n * @return {function} Returns a function with one argument which fills in the\n * undefined variable (like \"x\") and evaluates the expression\n */\nexport function compileInlineExpression(expression, math, scope) {\n // find an undefined symbol\n var symbol = expression.filter(function (node) {\n return isSymbolNode(node) && !(node.name in math) && !scope.has(node.name);\n })[0];\n if (!symbol) {\n throw new Error('No undefined variable found in inline expression \"' + expression + '\"');\n }\n\n // create a test function for this equation\n var name = symbol.name; // variable name\n var argsScope = new Map();\n var subScope = new PartitionedMap(scope, argsScope, new Set([name]));\n var eq = expression.compile();\n return function inlineExpression(x) {\n argsScope.set(name, x);\n return eq.evaluate(subScope);\n };\n}","import { factory } from '../../../utils/factory.js';\nvar name = 'transformCallback';\nvar dependencies = ['typed'];\nexport var createTransformCallback = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Transforms the given callback function based on its type and number of arrays.\n *\n * @param {Function} callback - The callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n return function (callback, numberOfArrays) {\n if (typed.isTypedFunction(callback)) {\n return _transformTypedCallbackFunction(callback, numberOfArrays);\n } else {\n return _transformCallbackFunction(callback, callback.length, numberOfArrays);\n }\n };\n\n /**\n * Transforms the given typed callback function based on the number of arrays.\n *\n * @param {Function} typedFunction - The typed callback function to transform.\n * @param {number} numberOfArrays - The number of arrays to pass to the callback function.\n * @returns {*} - The transformed callback function.\n */\n function _transformTypedCallbackFunction(typedFunction, numberOfArrays) {\n var signatures = Object.fromEntries(Object.entries(typedFunction.signatures).map(_ref2 => {\n var [signature, callbackFunction] = _ref2;\n var numberOfCallbackInputs = signature.split(',').length;\n if (typed.isTypedFunction(callbackFunction)) {\n return [signature, _transformTypedCallbackFunction(callbackFunction, numberOfArrays)];\n } else {\n return [signature, _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays)];\n }\n }));\n if (typeof typedFunction.name === 'string') {\n return typed(typedFunction.name, signatures);\n } else {\n return typed(signatures);\n }\n }\n});\n\n/**\n * Transforms the callback function based on the number of callback inputs and arrays.\n * There are three cases:\n * 1. The callback function has N arguments.\n * 2. The callback function has N+1 arguments.\n * 3. The callback function has 2N+1 arguments.\n *\n * @param {Function} callbackFunction - The callback function to transform.\n * @param {number} numberOfCallbackInputs - The number of callback inputs.\n * @param {number} numberOfArrays - The number of arrays.\n * @returns {Function} The transformed callback function.\n */\nfunction _transformCallbackFunction(callbackFunction, numberOfCallbackInputs, numberOfArrays) {\n if (numberOfCallbackInputs === numberOfArrays) {\n return callbackFunction;\n } else if (numberOfCallbackInputs === numberOfArrays + 1) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n return callbackFunction(...vals, idx);\n };\n } else if (numberOfCallbackInputs > numberOfArrays + 1) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n var vals = args.slice(0, numberOfArrays);\n var idx = _transformDims(args[numberOfArrays]);\n var rest = args.slice(numberOfArrays + 1);\n return callbackFunction(...vals, idx, ...rest);\n };\n } else {\n return callbackFunction;\n }\n}\n\n/**\n * Transforms the dimensions by adding 1 to each dimension.\n *\n * @param {Array} dims - The dimensions to transform.\n * @returns {Array} The transformed dimensions.\n */\nfunction _transformDims(dims) {\n return dims.map(dim => dim + 1);\n}","import { createFilter } from '../../function/matrix/filter.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'filter';\nvar dependencies = ['typed'];\nexport var createFilterTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.filter\n * Adds a property transform containing the transform function.\n *\n * This transform adds support for equations as test function for math.filter,\n * so you can do something like 'filter([3, -2, 5], x > 0)'.\n */\n function filterTransform(args, math, scope) {\n var filter = createFilter({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n if (args.length === 0) {\n return filter();\n }\n var x = args[0];\n if (args.length === 1) {\n return filter(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return filter(x, transformCallback(callback, N));\n }\n filterTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return filterTransform;\n}, {\n isTransformFunction: true\n});","import { createForEach } from '../../function/matrix/forEach.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nimport { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nvar name = 'forEach';\nvar dependencies = ['typed'];\nexport var createForEachTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.forEach\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var forEach = createForEach({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function forEachTransform(args, math, scope) {\n if (args.length === 0) {\n return forEach();\n }\n var x = args[0];\n if (args.length === 1) {\n return forEach(x);\n }\n var N = args.length - 1;\n var callback = args[N];\n if (x) {\n x = _compileAndEvaluate(x, scope);\n }\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return forEach(x, transformCallback(callback, N));\n }\n forEachTransform.rawArgs = true;\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n return forEachTransform;\n}, {\n isTransformFunction: true\n});","import { isArray, isBigInt, isBigNumber, isMatrix, isNumber, isRange } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nvar name = 'index';\nvar dependencies = ['Index', 'getMatrixDataType'];\nexport var createIndexTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n Index,\n getMatrixDataType\n } = _ref;\n /**\n * Attach a transform function to math.index\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n return function indexTransform() {\n var args = [];\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n var arg = arguments[i];\n\n // change from one-based to zero based, convert BigNumber to number and leave Array of Booleans as is\n if (isRange(arg)) {\n arg.start--;\n arg.end -= arg.step > 0 ? 0 : 2;\n } else if (arg && arg.isSet === true) {\n arg = arg.map(function (v) {\n return v - 1;\n });\n } else if (isArray(arg) || isMatrix(arg)) {\n if (getMatrixDataType(arg) !== 'boolean') {\n arg = arg.map(function (v) {\n return v - 1;\n });\n }\n } else if (isNumber(arg) || isBigInt(arg)) {\n arg--;\n } else if (isBigNumber(arg)) {\n arg = arg.toNumber() - 1;\n } else if (typeof arg === 'string') {\n // leave as is\n } else {\n throw new TypeError('Dimension must be an Array, Matrix, number, bigint, string, or Range');\n }\n args[i] = arg;\n }\n var res = new Index();\n Index.apply(res, args);\n return res;\n };\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { isFunctionAssignmentNode, isSymbolNode } from '../../utils/is.js';\nimport { createMap } from '../../function/matrix/map.js';\nimport { compileInlineExpression } from './utils/compileInlineExpression.js';\nimport { createTransformCallback } from './utils/transformCallback.js';\nvar name = 'map';\nvar dependencies = ['typed'];\nexport var createMapTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed\n } = _ref;\n /**\n * Attach a transform function to math.map\n * Adds a property transform containing the transform function.\n *\n * This transform creates a one-based index instead of a zero-based index\n */\n var map = createMap({\n typed\n });\n var transformCallback = createTransformCallback({\n typed\n });\n function mapTransform(args, math, scope) {\n if (args.length === 0) {\n return map();\n }\n if (args.length === 1) {\n return map(args[0]);\n }\n var N = args.length - 1;\n var X = args.slice(0, N);\n var callback = args[N];\n X = X.map(arg => _compileAndEvaluate(arg, scope));\n if (callback) {\n if (isSymbolNode(callback) || isFunctionAssignmentNode(callback)) {\n // a function pointer, like filter([3, -2, 5], myTestFunction)\n callback = _compileAndEvaluate(callback, scope);\n } else {\n // an expression like filter([3, -2, 5], x > 0)\n callback = compileInlineExpression(callback, math, scope);\n }\n }\n return map(...X, transformCallback(callback, N));\n function _compileAndEvaluate(arg, scope) {\n return arg.compile().evaluate(scope);\n }\n }\n mapTransform.rawArgs = true;\n return mapTransform;\n}, {\n isTransformFunction: true\n});","import { isNumber, isBigNumber } from '../../../utils/is.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function dimToZeroBase(dim) {\n if (isNumber(dim)) {\n return dim - 1;\n } else if (isBigNumber(dim)) {\n return dim.minus(1);\n } else {\n return dim;\n }\n}\nexport function isNumberOrBigNumber(n) {\n return isNumber(n) || isBigNumber(n);\n}","import { isCollection } from '../../../utils/is.js';\nimport { dimToZeroBase, isNumberOrBigNumber } from './dimToZeroBase.js';\n/**\n * Change last argument dim from one-based to zero-based.\n */\nexport function lastDimToZeroBase(args) {\n if (args.length === 2 && isCollection(args[0])) {\n args = args.slice();\n var dim = args[1];\n if (isNumberOrBigNumber(dim)) {\n args[1] = dimToZeroBase(dim);\n }\n }\n return args;\n}","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMax } from '../../function/statistics/max.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'max';\nvar dependencies = ['typed', 'config', 'numeric', 'larger', 'isNaN'];\nexport var createMaxTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n larger,\n isNaN: mathIsNaN\n } = _ref;\n var max = createMax({\n typed,\n config,\n numeric,\n larger,\n isNaN: mathIsNaN\n });\n\n /**\n * Attach a transform function to math.max\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function max\n * from one-based to zero based\n */\n return typed('max', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return max.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMean } from '../../function/statistics/mean.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'mean';\nvar dependencies = ['typed', 'add', 'divide'];\nexport var createMeanTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n divide\n } = _ref;\n var mean = createMean({\n typed,\n add,\n divide\n });\n\n /**\n * Attach a transform function to math.mean\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function mean\n * from one-based to zero based\n */\n return typed('mean', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return mean.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createMin } from '../../function/statistics/min.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'min';\nvar dependencies = ['typed', 'config', 'numeric', 'smaller', 'isNaN'];\nexport var createMinTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n numeric,\n smaller,\n isNaN: mathIsNaN\n } = _ref;\n var min = createMin({\n typed,\n config,\n numeric,\n smaller,\n isNaN: mathIsNaN\n });\n\n /**\n * Attach a transform function to math.min\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function min\n * from one-based to zero based\n */\n return typed('min', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createRange } from '../../function/matrix/range.js';\nvar name = 'range';\nvar dependencies = ['typed', 'config', '?matrix', '?bignumber', 'equal', 'smaller', 'smallerEq', 'larger', 'largerEq', 'add', 'isZero', 'isPositive'];\nexport var createRangeTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n matrix,\n bignumber,\n equal,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isZero,\n isPositive\n } = _ref;\n var range = createRange({\n typed,\n config,\n matrix,\n bignumber,\n equal,\n smaller,\n smallerEq,\n larger,\n largerEq,\n add,\n isZero,\n isPositive\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('range', {\n '...any': function any(args) {\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (typeof last !== 'boolean') {\n // append a parameter includeEnd=true\n args.push(true);\n }\n return range.apply(null, args);\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createRow } from '../../function/matrix/row.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { isNumber } from '../../utils/is.js';\nvar name = 'row';\nvar dependencies = ['typed', 'Index', 'matrix', 'range'];\n\n/**\n * Attach a transform function to matrix.column\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `index` parameter of function column\n * from zero-based to one-based\n */\nexport var createRowTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n Index,\n matrix,\n range\n } = _ref;\n var row = createRow({\n typed,\n Index,\n matrix,\n range\n });\n\n // @see: comment of row itself\n return typed('row', {\n '...any': function any(args) {\n // change last argument from zero-based to one-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n try {\n return row.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSubset } from '../../function/matrix/subset.js';\nvar name = 'subset';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createSubsetTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var subset = createSubset({\n typed,\n matrix,\n zeros,\n add\n });\n\n /**\n * Attach a transform function to math.subset\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed('subset', {\n '...any': function any(args) {\n try {\n return subset.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { isBigNumber, isNumber } from '../../utils/is.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { factory } from '../../utils/factory.js';\nimport { createConcat } from '../../function/matrix/concat.js';\nvar name = 'concat';\nvar dependencies = ['typed', 'matrix', 'isInteger'];\nexport var createConcatTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n isInteger\n } = _ref;\n var concat = createConcat({\n typed,\n matrix,\n isInteger\n });\n\n /**\n * Attach a transform function to math.range\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function concat\n * from one-based to zero based\n */\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createDiff } from '../../function/matrix/diff.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'diff';\nvar dependencies = ['typed', 'matrix', 'subtract', 'number', 'bignumber'];\nexport var createDiffTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n subtract,\n number,\n bignumber\n } = _ref;\n var diff = createDiff({\n typed,\n matrix,\n subtract,\n number,\n bignumber\n });\n\n /**\n * Attach a transform function to math.diff\n * Adds a property transform containing the transform function.\n *\n * This transform creates a range which includes the end value\n */\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return diff.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createStd } from '../../function/statistics/std.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'std';\nvar dependencies = ['typed', 'map', 'sqrt', 'variance'];\n\n/**\n * Attach a transform function to math.std\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createStdTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n map,\n sqrt,\n variance\n } = _ref;\n var std = createStd({\n typed,\n map,\n sqrt,\n variance\n });\n return typed('std', {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return std.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createSum } from '../../function/statistics/sum.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'sum';\nvar dependencies = ['typed', 'config', 'add', 'numeric'];\nexport var createSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n config,\n add,\n numeric\n } = _ref;\n var sum = createSum({\n typed,\n config,\n add,\n numeric\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { createQuantileSeq } from '../../function/statistics/quantileSeq.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'quantileSeq';\nvar dependencies = ['typed', 'bignumber', 'add', 'subtract', 'divide', 'multiply', 'partitionSelect', 'compare', 'isInteger', 'smaller', 'smallerEq', 'larger', 'mapSlices'];\n\n/**\n * Attach a transform function to math.quantileSeq\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function std\n * from one-based to zero based\n */\nexport var createQuantileSeqTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger,\n mapSlices\n } = _ref;\n var quantileSeq = createQuantileSeq({\n typed,\n bignumber,\n add,\n subtract,\n divide,\n multiply,\n partitionSelect,\n compare,\n isInteger,\n smaller,\n smallerEq,\n larger,\n mapSlices\n });\n return typed('quantileSeq', {\n 'Array | Matrix, number | BigNumber': quantileSeq,\n 'Array | Matrix, number | BigNumber, number': (arr, prob, dim) => quantileSeq(arr, prob, dimToZeroBase(dim)),\n 'Array | Matrix, number | BigNumber, boolean': quantileSeq,\n 'Array | Matrix, number | BigNumber, boolean, number': (arr, prob, sorted, dim) => quantileSeq(arr, prob, sorted, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix': quantileSeq,\n 'Array | Matrix, Array | Matrix, number': (data, prob, dim) => quantileSeq(data, prob, dimToZeroBase(dim)),\n 'Array | Matrix, Array | Matrix, boolean': quantileSeq,\n 'Array | Matrix, Array | Matrix, boolean, number': (data, prob, sorted, dim) => quantileSeq(data, prob, sorted, dimToZeroBase(dim))\n });\n function dimToZeroBase(dim) {\n // TODO: find a better way, maybe lastDimToZeroBase could apply to more cases.\n return lastDimToZeroBase([[], dim])[1];\n }\n}, {\n isTransformFunction: true\n});","import { isBigNumber, isCollection, isNumber } from '../../utils/is.js';\nimport { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createCumSum } from '../../function/statistics/cumsum.js';\n\n/**\n * Attach a transform function to math.sum\n * Adds a property transform containing the transform function.\n *\n * This transform changed the last `dim` parameter of function sum\n * from one-based to zero based\n */\nvar name = 'cumsum';\nvar dependencies = ['typed', 'add', 'unaryPlus'];\nexport var createCumSumTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n unaryPlus\n } = _ref;\n var cumsum = createCumSum({\n typed,\n add,\n unaryPlus\n });\n return typed(name, {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n if (isNumber(dim)) {\n args[1] = dim - 1;\n } else if (isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n try {\n return cumsum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { factory } from '../../utils/factory.js';\nimport { errorTransform } from './utils/errorTransform.js';\nimport { createVariance } from '../../function/statistics/variance.js';\nimport { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';\nvar name = 'variance';\nvar dependencies = ['typed', 'add', 'subtract', 'multiply', 'divide', 'mapSlices', 'isNaN'];\n\n/**\n * Attach a transform function to math.var\n * Adds a property transform containing the transform function.\n *\n * This transform changed the `dim` parameter of function var\n * from one-based to zero based\n */\nexport var createVarianceTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n add,\n subtract,\n multiply,\n divide,\n mapSlices,\n isNaN: mathIsNaN\n } = _ref;\n var variance = createVariance({\n typed,\n add,\n subtract,\n multiply,\n divide,\n mapSlices,\n isNaN: mathIsNaN\n });\n return typed(name, {\n '...any': function any(args) {\n args = lastDimToZeroBase(args);\n try {\n return variance.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}, {\n isTransformFunction: true\n});","import { createPrint } from '../../function/string/print.js';\nimport { factory } from '../../utils/factory.js';\nimport { printTemplate } from '../../utils/print.js';\nvar name = 'print';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add'];\nexport var createPrintTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n zeros,\n add\n } = _ref;\n var print = createPrint({\n typed,\n matrix,\n zeros,\n add\n });\n return typed(name, {\n 'string, Object | Array': function string_Object__Array(template, values) {\n return print(_convertTemplateToZeroBasedIndex(template), values);\n },\n 'string, Object | Array, number | Object': function string_Object__Array_number__Object(template, values, options) {\n return print(_convertTemplateToZeroBasedIndex(template), values, options);\n }\n });\n function _convertTemplateToZeroBasedIndex(template) {\n return template.replace(printTemplate, x => {\n var parts = x.slice(1).split('.');\n var result = parts.map(function (part) {\n if (!isNaN(part) && part.length > 0) {\n return parseInt(part) - 1;\n } else {\n return part;\n }\n });\n return '$' + result.join('.');\n });\n }\n}, {\n isTransformFunction: true\n});","import { createAnd } from '../../function/logical/and.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'and';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var and = createAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function andTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && !and(condition1, true)) {\n return false;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return and(condition1, condition2);\n }\n andTransform.rawArgs = true;\n return andTransform;\n}, {\n isTransformFunction: true\n});","import { createOr } from '../../function/logical/or.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'or';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var or = createOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function orTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1) && or(condition1, false)) {\n return true;\n }\n var condition2 = args[1].compile().evaluate(scope);\n return or(condition1, condition2);\n }\n orTransform.rawArgs = true;\n return orTransform;\n}, {\n isTransformFunction: true\n});","import { createNullish } from '../../function/logical/nullish.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'nullish';\nvar dependencies = ['typed', 'matrix', 'size', 'flatten', 'deepEqual'];\nexport var createNullishTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n size,\n flatten,\n deepEqual\n } = _ref;\n var nullish = createNullish({\n typed,\n matrix,\n size,\n flatten,\n deepEqual\n });\n function nullishTransform(args, math, scope) {\n var left = args[0].compile().evaluate(scope);\n\n // If left is not a collection and not nullish, short-circuit and return it\n if (!isCollection(left) && left != null && left !== undefined) {\n return left;\n }\n\n // Otherwise evaluate right and apply full nullish semantics (incl. element-wise)\n var right = args[1].compile().evaluate(scope);\n return nullish(left, right);\n }\n nullishTransform.rawArgs = true;\n return nullishTransform;\n}, {\n isTransformFunction: true\n});","import { createBitAnd } from '../../function/bitwise/bitAnd.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitAnd';\nvar dependencies = ['typed', 'matrix', 'zeros', 'add', 'equalScalar', 'not', 'concat'];\nexport var createBitAndTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n } = _ref;\n var bitAnd = createBitAnd({\n typed,\n matrix,\n equalScalar,\n zeros,\n not,\n concat\n });\n function bitAndTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === 0 || condition1 === false) {\n return 0;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitAnd(condition1, condition2);\n }\n bitAndTransform.rawArgs = true;\n return bitAndTransform;\n}, {\n isTransformFunction: true\n});","import { createBitOr } from '../../function/bitwise/bitOr.js';\nimport { factory } from '../../utils/factory.js';\nimport { isCollection } from '../../utils/is.js';\nvar name = 'bitOr';\nvar dependencies = ['typed', 'matrix', 'equalScalar', 'DenseMatrix', 'concat'];\nexport var createBitOrTransform = /* #__PURE__ */factory(name, dependencies, _ref => {\n var {\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n } = _ref;\n var bitOr = createBitOr({\n typed,\n matrix,\n equalScalar,\n DenseMatrix,\n concat\n });\n function bitOrTransform(args, math, scope) {\n var condition1 = args[0].compile().evaluate(scope);\n if (!isCollection(condition1)) {\n if (isNaN(condition1)) {\n return NaN;\n }\n if (condition1 === -1) {\n return -1;\n }\n if (condition1 === true) {\n return 1;\n }\n }\n var condition2 = args[1].compile().evaluate(scope);\n return bitOr(condition1, condition2);\n }\n bitOrTransform.rawArgs = true;\n return bitOrTransform;\n}, {\n isTransformFunction: true\n});","import _extends from \"@babel/runtime/helpers/extends\";\n/**\n * THIS FILE IS AUTO-GENERATED\n * DON'T MAKE CHANGES HERE\n */\nimport { config } from './configReadonly.js';\nimport { createNode, createObjectNode, createOperatorNode, createParenthesisNode, createRelationalNode, createArrayNode, createBlockNode, createConditionalNode, createRangeNode, createReviver, createChainClass, createFunctionAssignmentNode, createChain, createConstantNode, createIndexNode, createAccessorNode, createAssignmentNode, createSymbolNode, createFunctionNode, createParse, createResolve, createSimplifyConstant, createCompile, createEvaluate, createHelpClass, createParserClass, createSimplifyCore, createHelp, createSimplify, createSymbolicEqual, createDerivative, createParser, createLeafCount, createRationalize, createMapTransform, createFilterTransform, createForEachTransform, createMapSlicesTransform, createOrTransform, createAndTransform, createCumSumTransform, createMaxTransform, createNullishTransform, createPrintTransform, createBitAndTransform, createConcatTransform, createDiffTransform, createMinTransform, createSubsetTransform, createBitOrTransform, createSumTransform, createIndexTransform, createRowTransform, createColumnTransform, createMeanTransform, createRangeTransform, createVarianceTransform, createQuantileSeqTransform, createStdTransform } from '../factoriesAny.js';\nimport { BigNumber, Complex, e, _false, fineStructure, Fraction, i, _Infinity, LN10, LOG10E, Matrix, _NaN, _null, phi, Range, ResultSet, SQRT1_2,\n// eslint-disable-line camelcase\nsackurTetrode, tau, _true, version, DenseMatrix, efimovFactor, LN2, pi, replacer, SQRT2, typed, weakMixingAngle, abs, acos, acot, acsc, addScalar, arg, asech, asinh, atan, atanh, bigint, bitNot, boolean, clone, combinations, complex, conj, cos, cot, csc, cube, equalScalar, erf, exp, expm1, filter, flatten, forEach, format, getMatrixDataType, hex, im, isBounded, isNaN, isNumeric, isPrime, LOG2E, lgamma, log10, log2, map, mode, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, size, SparseMatrix, splitUnit, square, string, subtractScalar, tan, toBest, typeOf, acosh, acsch, asec, bignumber, combinationsWithRep, cosh, csch, dot, hasNumericValue, isFinite, isNegative, isZero, matrix, matrixFromFunction, multiply, ones, randomInt, resize, sech, sinh, sparse, sqrt, squeeze, tanh, transpose, xgcd, zeros, acoth, asin, bin, coth, ctranspose, diag, equal, fraction, identity, isInteger, kron, mapSlices, matrixFromColumns, num, reshape, round, unaryMinus, bernoulli, cbrt, concat, deepEqual, dotMultiply, floor, gcd, isPositive, larger, lcm, leftShift, mod, nthRoot, nullish, numeric, prod, rightArithShift, smaller, subtract, to, unaryPlus, xor, add, atan2, bitAnd, bitOr, bitXor, ceil, compare, compareText, composition, count, cross, diff, divideScalar, equalText, FibonacciHeap, fix, hypot, ImmutableDenseMatrix, Index, intersect, invmod, largerEq, log, lsolve, matrixFromRows, min, nthRoots, partitionSelect, qr, rightLogShift, slu, Spa, subset, sum, trace, usolve, zpk2tf, catalan, compareNatural, cumsum, det, dotDivide, index, inv, log1p, lsolveAll, max, or, pinv, pow, setCartesian, setDistinct, setIsSubset, setPowerset, smallerEq, sort, sqrtm, unequal, usolveAll, and, den, distance, dotPow, expm, fft, gamma, ifft, lup, range, row, setDifference, setMultiplicity, setSymDifference, Unit, vacuumImpedance, wienDisplacement, atomicMass, bohrMagneton, boltzmann, column, conductanceQuantum, coulomb, createUnit, deuteronMass, eigs, electronMass, factorial, fermiCoupling, gasConstant, gravity, klitzing, loschmidt, magneticConstant, molarMass, molarPlanckConstant, neutronMass, nuclearMagneton, permutations, planckConstant, planckMass, planckTime, protonMass, quantumOfCirculation, reducedPlanckConstant, secondRadiation, setSize, speedOfLight, stefanBoltzmann, thomsonCrossSection, avogadro, bohrRadius, coulombConstant, divide, elementaryCharge, faraday, freqz, gravitationConstant, inverseConductanceQuantum, lusolve, magneticFluxQuantum, molarMassC12, multinomial, planckCharge, planckTemperature, quantileSeq, rydberg, setIntersect, solveODE, stirlingS2, unit, bellNumbers, electricConstant, firstRadiation, hartreeEnergy, kldivergence, mean, molarVolume, planckLength, setUnion, variance, classicalElectronRadius, corr, median, polynomialRoot, std, zeta, mad, norm, rotationMatrix, rotate, schur, sylvester, lyap } from './pureFunctionsAny.generated.js';\nvar math = {}; // NOT pure!\nvar mathWithTransform = {}; // NOT pure!\nvar classes = {}; // NOT pure!\n\nexport var Node = createNode({\n mathWithTransform\n});\nexport var ObjectNode = createObjectNode({\n Node\n});\nexport var OperatorNode = createOperatorNode({\n Node\n});\nexport var ParenthesisNode = createParenthesisNode({\n Node\n});\nexport var RelationalNode = createRelationalNode({\n Node\n});\nexport var ArrayNode = createArrayNode({\n Node\n});\nexport var BlockNode = createBlockNode({\n Node,\n ResultSet\n});\nexport var ConditionalNode = createConditionalNode({\n Node\n});\nexport var RangeNode = createRangeNode({\n Node\n});\nexport var reviver = createReviver({\n classes\n});\nexport var Chain = createChainClass({\n math,\n typed\n});\nexport var FunctionAssignmentNode = createFunctionAssignmentNode({\n Node,\n typed\n});\nexport var chain = createChain({\n Chain,\n typed\n});\nexport var ConstantNode = createConstantNode({\n Node,\n isBounded\n});\nexport var IndexNode = createIndexNode({\n Node,\n size\n});\nexport var AccessorNode = createAccessorNode({\n Node,\n subset\n});\nexport var AssignmentNode = createAssignmentNode({\n matrix,\n Node,\n subset\n});\nexport var SymbolNode = createSymbolNode({\n Unit,\n Node,\n math\n});\nexport var FunctionNode = createFunctionNode({\n Node,\n SymbolNode,\n math\n});\nexport var parse = createParse({\n AccessorNode,\n ArrayNode,\n AssignmentNode,\n BlockNode,\n ConditionalNode,\n ConstantNode,\n FunctionAssignmentNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n RangeNode,\n RelationalNode,\n SymbolNode,\n config,\n numeric,\n typed\n});\nexport var resolve = createResolve({\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n parse,\n typed\n});\nexport var simplifyConstant = createSimplifyConstant({\n bignumber,\n fraction,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n SymbolNode,\n config,\n isBounded,\n mathWithTransform,\n matrix,\n typed\n});\nexport var compile = createCompile({\n parse,\n typed\n});\nexport var evaluate = createEvaluate({\n parse,\n typed\n});\nexport var Help = createHelpClass({\n evaluate\n});\nexport var Parser = createParserClass({\n evaluate,\n parse\n});\nexport var simplifyCore = createSimplifyCore({\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n add,\n divide,\n equal,\n isZero,\n multiply,\n parse,\n pow,\n subtract,\n typed\n});\nexport var help = createHelp({\n Help,\n mathWithTransform,\n typed\n});\nexport var simplify = createSimplify({\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n equal,\n parse,\n replacer,\n resolve,\n simplifyConstant,\n simplifyCore,\n typed\n});\nexport var symbolicEqual = createSymbolicEqual({\n OperatorNode,\n parse,\n simplify,\n typed\n});\nexport var derivative = createDerivative({\n ConstantNode,\n FunctionNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n config,\n equal,\n isZero,\n numeric,\n parse,\n simplify,\n typed\n});\nexport var parser = createParser({\n Parser,\n typed\n});\nexport var leafCount = createLeafCount({\n parse,\n typed\n});\nexport var rationalize = createRationalize({\n bignumber,\n fraction,\n AccessorNode,\n ArrayNode,\n ConstantNode,\n FunctionNode,\n IndexNode,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n SymbolNode,\n add,\n config,\n divide,\n equal,\n isZero,\n mathWithTransform,\n matrix,\n multiply,\n parse,\n pow,\n simplify,\n simplifyConstant,\n simplifyCore,\n subtract,\n typed\n});\n_extends(math, {\n e,\n false: _false,\n fineStructure,\n i,\n Infinity: _Infinity,\n LN10,\n LOG10E,\n NaN: _NaN,\n null: _null,\n phi,\n SQRT1_2,\n sackurTetrode,\n tau,\n true: _true,\n 'E': e,\n version,\n efimovFactor,\n LN2,\n pi,\n replacer,\n reviver,\n SQRT2,\n typed,\n 'PI': pi,\n weakMixingAngle,\n abs,\n acos,\n acot,\n acsc,\n addScalar,\n arg,\n asech,\n asinh,\n atan,\n atanh,\n bigint,\n bitNot,\n boolean,\n clone,\n combinations,\n complex,\n conj,\n cos,\n cot,\n csc,\n cube,\n equalScalar,\n erf,\n exp,\n expm1,\n filter,\n flatten,\n forEach,\n format,\n getMatrixDataType,\n hex,\n im,\n isBounded,\n isNaN,\n isNumeric,\n isPrime,\n LOG2E,\n lgamma,\n log10,\n log2,\n map,\n mode,\n multiplyScalar,\n not,\n number,\n oct,\n pickRandom,\n print,\n random,\n re,\n sec,\n sign,\n sin,\n size,\n splitUnit,\n square,\n string,\n subtractScalar,\n tan,\n toBest,\n typeOf,\n acosh,\n acsch,\n asec,\n bignumber,\n chain,\n combinationsWithRep,\n cosh,\n csch,\n dot,\n hasNumericValue,\n isFinite,\n isNegative,\n isZero,\n matrix,\n matrixFromFunction,\n multiply,\n ones,\n randomInt,\n resize,\n sech,\n sinh,\n sparse,\n sqrt,\n squeeze,\n tanh,\n transpose,\n xgcd,\n zeros,\n acoth,\n asin,\n bin,\n coth,\n ctranspose,\n diag,\n equal,\n fraction,\n identity,\n isInteger,\n kron,\n mapSlices,\n matrixFromColumns,\n num,\n reshape,\n round,\n unaryMinus,\n bernoulli,\n cbrt,\n concat,\n deepEqual,\n dotMultiply,\n floor,\n gcd,\n isPositive,\n larger,\n lcm,\n leftShift,\n mod,\n nthRoot,\n nullish,\n numeric,\n prod,\n rightArithShift,\n smaller,\n subtract,\n to,\n unaryPlus,\n xor,\n add,\n atan2,\n bitAnd,\n bitOr,\n bitXor,\n ceil,\n compare,\n compareText,\n composition,\n count,\n cross,\n diff,\n divideScalar,\n equalText,\n fix,\n hypot,\n intersect,\n invmod,\n largerEq,\n log,\n lsolve,\n matrixFromRows,\n min,\n nthRoots,\n partitionSelect,\n qr,\n rightLogShift,\n slu,\n subset,\n sum,\n trace,\n usolve,\n zpk2tf,\n catalan,\n compareNatural,\n cumsum,\n det,\n dotDivide,\n index,\n inv,\n log1p,\n lsolveAll,\n max,\n or,\n pinv,\n pow,\n setCartesian,\n setDistinct,\n setIsSubset,\n setPowerset,\n smallerEq,\n sort,\n sqrtm,\n unequal,\n usolveAll,\n and,\n den,\n distance,\n dotPow,\n expm,\n fft,\n gamma,\n ifft,\n lup,\n range,\n row,\n setDifference,\n setMultiplicity,\n setSymDifference,\n vacuumImpedance,\n wienDisplacement,\n atomicMass,\n bohrMagneton,\n boltzmann,\n column,\n conductanceQuantum,\n coulomb,\n createUnit,\n deuteronMass,\n eigs,\n electronMass,\n factorial,\n fermiCoupling,\n gasConstant,\n gravity,\n klitzing,\n loschmidt,\n magneticConstant,\n molarMass,\n molarPlanckConstant,\n neutronMass,\n nuclearMagneton,\n permutations,\n planckConstant,\n planckMass,\n planckTime,\n protonMass,\n quantumOfCirculation,\n reducedPlanckConstant,\n secondRadiation,\n setSize,\n speedOfLight,\n stefanBoltzmann,\n thomsonCrossSection,\n avogadro,\n bohrRadius,\n coulombConstant,\n divide,\n elementaryCharge,\n faraday,\n freqz,\n gravitationConstant,\n inverseConductanceQuantum,\n lusolve,\n magneticFluxQuantum,\n molarMassC12,\n multinomial,\n planckCharge,\n planckTemperature,\n quantileSeq,\n rydberg,\n setIntersect,\n solveODE,\n stirlingS2,\n unit,\n bellNumbers,\n electricConstant,\n firstRadiation,\n hartreeEnergy,\n kldivergence,\n mean,\n molarVolume,\n planckLength,\n setUnion,\n variance,\n classicalElectronRadius,\n corr,\n median,\n parse,\n polynomialRoot,\n resolve,\n simplifyConstant,\n std,\n zeta,\n compile,\n evaluate,\n mad,\n simplifyCore,\n help,\n norm,\n rotationMatrix,\n simplify,\n symbolicEqual,\n derivative,\n parser,\n rotate,\n leafCount,\n rationalize,\n schur,\n sylvester,\n lyap,\n config\n});\n_extends(mathWithTransform, math, {\n map: createMapTransform({\n typed\n }),\n filter: createFilterTransform({\n typed\n }),\n forEach: createForEachTransform({\n typed\n }),\n mapSlices: createMapSlicesTransform({\n isInteger,\n typed\n }),\n or: createOrTransform({\n DenseMatrix,\n concat,\n equalScalar,\n matrix,\n typed\n }),\n and: createAndTransform({\n add,\n concat,\n equalScalar,\n matrix,\n not,\n typed,\n zeros\n }),\n cumsum: createCumSumTransform({\n add,\n typed,\n unaryPlus\n }),\n max: createMaxTransform({\n config,\n isNaN,\n larger,\n numeric,\n typed\n }),\n nullish: createNullishTransform({\n deepEqual,\n flatten,\n matrix,\n size,\n typed\n }),\n print: createPrintTransform({\n add,\n matrix,\n typed,\n zeros\n }),\n bitAnd: createBitAndTransform({\n add,\n concat,\n equalScalar,\n matrix,\n not,\n typed,\n zeros\n }),\n concat: createConcatTransform({\n isInteger,\n matrix,\n typed\n }),\n diff: createDiffTransform({\n bignumber,\n matrix,\n number,\n subtract,\n typed\n }),\n min: createMinTransform({\n config,\n isNaN,\n numeric,\n smaller,\n typed\n }),\n subset: createSubsetTransform({\n add,\n matrix,\n typed,\n zeros\n }),\n bitOr: createBitOrTransform({\n DenseMatrix,\n concat,\n equalScalar,\n matrix,\n typed\n }),\n sum: createSumTransform({\n add,\n config,\n numeric,\n typed\n }),\n index: createIndexTransform({\n Index,\n getMatrixDataType\n }),\n row: createRowTransform({\n Index,\n matrix,\n range,\n typed\n }),\n column: createColumnTransform({\n Index,\n matrix,\n range,\n typed\n }),\n mean: createMeanTransform({\n add,\n divide,\n typed\n }),\n range: createRangeTransform({\n bignumber,\n matrix,\n add,\n config,\n equal,\n isPositive,\n isZero,\n larger,\n largerEq,\n smaller,\n smallerEq,\n typed\n }),\n variance: createVarianceTransform({\n add,\n divide,\n isNaN,\n mapSlices,\n multiply,\n subtract,\n typed\n }),\n quantileSeq: createQuantileSeqTransform({\n add,\n bignumber,\n compare,\n divide,\n isInteger,\n larger,\n mapSlices,\n multiply,\n partitionSelect,\n smaller,\n smallerEq,\n subtract,\n typed\n }),\n std: createStdTransform({\n map,\n sqrt,\n typed,\n variance\n })\n});\n_extends(classes, {\n BigNumber,\n Complex,\n Fraction,\n Matrix,\n Node,\n ObjectNode,\n OperatorNode,\n ParenthesisNode,\n Range,\n RelationalNode,\n ResultSet,\n ArrayNode,\n BlockNode,\n ConditionalNode,\n DenseMatrix,\n RangeNode,\n Chain,\n FunctionAssignmentNode,\n SparseMatrix,\n ConstantNode,\n IndexNode,\n FibonacciHeap,\n ImmutableDenseMatrix,\n Index,\n Spa,\n AccessorNode,\n AssignmentNode,\n Unit,\n SymbolNode,\n FunctionNode,\n Help,\n Parser\n});\nChain.createProxy(math);\nexport { embeddedDocs as docs } from '../expression/embeddedDocs/embeddedDocs.js';"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329],"mappings":";;AACA,IAAW,KAAW,IAAI,IAAI,CAAC,KAAK,CAAC,GCM1B,KAA4B,kBAAQA,QAAMC,CADjC,mBACiCA,IAAc,MAAQ;CACzE,IAAI,EACF,yBACE;CAMJ,SAAS,EAAe,GAAO;EAC7B,KAAK,IAAI,KAAU,CAAC,GAAG,EAAQ,GAC7B,IAAI,EAAM,IAAI,CAAM,GAClB,MAAU,MAAM,yCAAwC,IAAS,0BAAyB;CAGhG;CACA,MAAM,EAAK;EACT,IAAI,OAAO;GACT,OAAO;EACT;EACA,IAAI,SAAS;GACX,OAAO;EACT;EAOA,SAAS,GAAO;GACd,OAAO,KAAK,QAAQ,EAAE,SAAS,CAAK;EACtC;EAUA,UAAU;GACR,IAAI,IAAO,KAAK,SAAS,GAAmB,CAAC,CAAC,GAC1C,IAAO,CAAC,GACR,IAAU;GACd,SAAS,EAAS,GAAO;IACvB,IAAI,IAAI,EAAU,CAAK;IAEvB,OADA,EAAe,CAAC,GACT,EAAK,GAAG,GAAM,CAAO;GAC9B;GACA,OAAO,EACL,YACF;EACF;EAeA,SAAS,GAAM,GAAU;GACvB,MAAU,MAAM,iDAAiD,KAAK,IAAI;EAC5E;EAMA,QAAQ,GAAU;GAEhB,MAAU,MAAM,wCAAwC;EAC1D;EAQA,IAAI,GAAU;GAEZ,MAAU,MAAM,oCAAoC;EACtD;EAQA,QAAQ,GAAM;GACZ,IAAI,CAAC,EAAO,CAAI,GACd,MAAU,UAAU,sCAAsC;GAE5D,OAAO;EACT;EAQA,SAAS,GAAU;GAGjB,EAAS,MAAM,MAAM,IAAI;GAGzB,SAAS,EAAU,GAAM,GAAU;IACjC,EAAK,QAAQ,S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ACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,aAAa,GACf;IACA,UAAU,EACR,OAAO,GACT;GACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,aAAa,GACf;IACA,UAAU,EACR,OAAO,GACT;GACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;GACH,QAAQ;EACV;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAEA;GACE,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,QAAQ,EACN,OAAO,GACT,EACF;EACF;EAKA;EAIA;GACE,GAAG;GACH,UAAU,EACR,KAAK,EACH,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU;IACR,QAAQ,EACN,OAAO,GACT;IACA,UAAU,EACR,aAAa,GACf;GACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;EAIH;GACE,GAAG;GACH,UAAU,EACR,UAAU,EACR,OAAO,GACT,EACF;EACF;EAAG;GACD,GAAG;GAEH,UAAU;IACR,UAAU,EACR,OAAO,GACT;IACA,UAAU,EACR,aAAa,GACf;GACF;EACF;EAEA;GACE,GAAG;GACH,UAAU,EACR,KAAK,EACH,aAAa,GACf,EACF;GACA,eAAe,EACb,KAAK,EACH,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;GACA,eAAe,EACb,UAAU,EACR,aAAa,GACf,EACF;EACF;EAGA;GACE,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GACH,GAAG;EACL;EAAG;GACD,GAAG;GAEH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;EAAG;GACD,GAAG;GACH,GAAG;EACL;EAEA;GACE,GAAG;GAEH,UAAU,EACR,UAAU,EACR,aAAa,GACf,EACF;EACF;E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GAAmB;CAC3C;CACA;AACF,CAAC,GACU,KAAY,GAAgB;CACrC;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;AACF,CAAC,GACU,KAAiB,GAAqB;CAC/C;CACA;CACA;AACF,CAAC,GACU,KAAa,GAAiB;CACvC;CACA;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;CACA;AACF,CAAC,GACU,KAAQ,GAAY;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAU,GAAc;CACjC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAmB,GAAuB;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAU,GAAc;CACjC;CACA;AACF,CAAC,GACU,KAAW,GAAe;CACnC;CACA;AACF,CAAC,GACU,KAAO,GAAgB,EAChC,aACF,CAAC,GACU,KAAS,GAAkB;CACpC;CACA;AACF,CAAC,GACU,KAAe,GAAmB;CAC3C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACU,KAAO,GAAW;CAC3B;CACA;CACA;AACF,CAAC,GACU,KAAW,GAAe;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAyDD,GAAS,IAAM;CACb;CACA,OAAO;CACP;CACA;CACA,UAAU;CACV;CACA;CACA,KAAK;CACL,MAAM;CACN;CACA;CACA;CACA;CACA,MAAM;CACN,GAAK;CACL;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,IAAM;CACN;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,OAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,SAAA;CACA,QAAA;CACA;CACA;CACA;CACA;CACA,OAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,KAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,QAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,WAAA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,eA1WyB,GAAoB;EAC7C;EACA;EACA;EACA;CACF,CAqWE;CACA,YArWsB,GAAiB;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAwVE;CACA,QAxVkB,GAAa;EAC/B;EACA;CACF,CAqVE;CACA;CACA,WAtVqB,GAAgB;EACrC;EACA;CACF,CAmVE;CACA,aAnVuB,GAAkB;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAwTE;CACA;CACA;CACA;CACA;AACF,CAAC,GACD,GAAS,IAAmB,IAAM;CAChC,KAAK,GAAmB,EACtB,SACF,CAAC;CACD,QAAQ,GAAsB,EAC5B,SACF,CAAC;CACD,SAAS,GAAuB,EAC9B,SACF,CAAC;CACD,WAAW,GAAyB;EAClC,WAAA;EACA;CACF,CAAC;CACD,IAAI,GAAkB;EACpB;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA,OAAA;EACA;EACA;EACA;CACF,CAAC;CACD,SAAS,GAAuB;EAC9B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B,WAAA;EACA;EACA;CACF,CAAC;CACD,MAAM,GAAoB;EACxB;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA,OAAA;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB;EACA;EACA;EACA;CACF,CAAC;CACD,QAAQ,GAAsB;EAC5B;EACA;EACA;EACA;CACF,CAAC;CACD,MAAM,GAAoB;EACxB;EACA;EACA;CACF,CAAC;CACD,OAAO,GAAqB;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,UAAU,GAAwB;EAChC;EACA;EACA,OAAA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,aAAa,GAA2B;EACtC;EACA;EACA;EACA;EACA,WAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,KAAK,GAAmB;EACtB,KAAA;EACA;EACA;EACA;CACF,CAAC;AACH,CAAC,GACD,GAAS,IAAS;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GACD,GAAM,YAAY,EAAI"}