{"version":3,"file":"chromatography.umd.min.js","sources":["../node_modules/is-any-array/lib/index.js","../node_modules/ml-spectra-processing/lib/reim/reimAbsolute.js","../node_modules/ml-spectra-processing/lib/x/getOutputArray.js","../node_modules/ml-spectra-processing/lib/x/xAbsolute.js","../node_modules/ml-spectra-processing/lib/x/xMedian.js","../node_modules/ml-spectra-processing/lib/x/xCheck.js","../node_modules/ml-spectra-processing/lib/x/xFindClosestIndex.js","../node_modules/ml-spectra-processing/lib/x/xGetFromToIndex.js","../node_modules/ml-spectra-processing/lib/x/xAbsoluteSum.js","../node_modules/ml-spectra-processing/lib/x/xAdd.js","../node_modules/ml-spectra-processing/lib/x/xMultiply.js","../node_modules/ml-spectra-processing/lib/x/xDotProduct.js","../node_modules/ml-spectra-processing/lib/x/xCrossCorrelation.js","../node_modules/ml-spectra-processing/lib/x/xBinning.js","../node_modules/ml-spectra-processing/lib/x/xBoxPlot.js","../node_modules/ml-spectra-processing/lib/x/xBoxPlotWithOutliers.js","../node_modules/ml-spectra-processing/lib/x/xCheckLengths.js","../node_modules/ml-spectra-processing/lib/x/xCorrelation.js","../node_modules/ml-matrix/matrix.js","../node_modules/ml-matrix/matrix.mjs","../node_modules/ml-spectra-processing/lib/x/xCostMatrix.js","../node_modules/ml-spectra-processing/lib/x/xCumulative.js","../node_modules/ml-spectra-processing/lib/x/xMean.js","../node_modules/ml-spectra-processing/lib/x/xVariance.js","../node_modules/ml-spectra-processing/lib/x/xStandardDeviation.js","../node_modules/ml-spectra-processing/lib/x/xEnsureFloat64.js","../node_modules/ml-spectra-processing/lib/x/xGetTargetIndex.js","../node_modules/fft.js/lib/fft.js","../node_modules/ml-spectra-processing/lib/utils/createArray.js","../node_modules/ml-spectra-processing/lib/utils/createFromToArray.js","../node_modules/ml-xsadd/lib-esm/XSadd.js","../node_modules/ml-spectra-processing/lib/utils/createRandomArray.js","../node_modules/ml-spectra-processing/lib/utils/isPowerOfTwo.js","../node_modules/ml-spectra-processing/lib/utils/nextPowerOfTwo.js","../node_modules/ml-spectra-processing/lib/utils/recursiveResolve.js","../node_modules/ml-spectra-processing/lib/utils/recursiveUntypeArrays.js","../node_modules/ml-spectra-processing/lib/x/xSubtract.js","../node_modules/ml-spectra-processing/lib/utils/calculateAdaptiveWeights.js","../node_modules/ml-spectra-processing/lib/utils/recursiveRemoveEmptyAndNull.js","../node_modules/ml-spectra-processing/lib/x/xHilbertTransform.js","../node_modules/ml-spectra-processing/lib/x/xMaxValue.js","../node_modules/ml-spectra-processing/lib/x/xMinValue.js","../node_modules/ml-spectra-processing/lib/x/xHistogram.js","../node_modules/ml-spectra-processing/lib/x/xIsEquallySpaced.js","../node_modules/ml-spectra-processing/lib/x/xIsMonotonic.js","../node_modules/ml-spectra-processing/lib/x/xMassCenterVectorSimilarity.js","../node_modules/ml-spectra-processing/lib/x/xMedianAbsoluteDeviation.js","../node_modules/ml-spectra-processing/lib/x/xMinMaxValues.js","../node_modules/ml-spectra-processing/lib/x/utils/erfcinv.js","../node_modules/ml-spectra-processing/lib/x/utils/simpleNormInv.js","../node_modules/ml-spectra-processing/lib/x/xNoiseSanPlot.js","../node_modules/ml-spectra-processing/lib/x/xNoiseStandardDeviation.js","../node_modules/ml-spectra-processing/lib/x/xSum.js","../node_modules/ml-spectra-processing/lib/x/xNormed.js","../node_modules/ml-spectra-processing/lib/x/xPadding.js","../node_modules/ml-spectra-processing/lib/x/xRolling.js","../node_modules/ml-spectra-processing/lib/x/xRollingAverage.js","../node_modules/ml-spectra-processing/lib/x/xRotate.js","../node_modules/ml-spectra-processing/lib/x/xSequentialFillFromStep.js","../node_modules/ml-spectra-processing/lib/x/xSortDescending.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCreateEmpty.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCheck.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCholeskySolver.js","../node_modules/ml-spectra-processing/lib/matrix/matrixClone.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCuthillMckee.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCheckRanges.js","../node_modules/ml-spectra-processing/lib/matrix/matrixMinMaxAbsoluteZ.js","../node_modules/ml-spectra-processing/lib/matrix/matrixMinMaxZ.js","../node_modules/ml-spectra-processing/lib/matrix/matrixMaxAbsoluteZ.js","../node_modules/ml-spectra-processing/lib/matrix/matrixToArray.js","../node_modules/ml-spectra-processing/lib/utils/addWeights.js","../node_modules/ml-spectra-processing/lib/x/xWhittakerSmoother.js","../node_modules/ml-spectra-processing/lib/utils/createSystemMatrix.js","../node_modules/ml-spectra-processing/lib/reim/reimPhaseCorrection.js","../node_modules/ml-spectra-processing/lib/reim/reimAutoPhaseCorrection.js","../node_modules/ml-spectra-processing/lib/reim/zeroShift.js","../node_modules/ml-spectra-processing/lib/reim/reimZeroFilling.js","../node_modules/ml-spectra-processing/lib/xy/xyCheck.js","../node_modules/ml-spectra-processing/lib/xy/xyMaxYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyCumulativeDistributionStatistics.js","../node_modules/ml-spectra-processing/lib/zones/zonesNormalize.js","../node_modules/ml-spectra-processing/lib/zones/zonesWithPoints.js","../node_modules/ml-spectra-processing/lib/xy/utils/integral.js","../node_modules/ml-spectra-processing/lib/xy/utils/equallySpacedSmooth.js","../node_modules/ml-spectra-processing/lib/xy/xyEquallySpaced.js","../node_modules/ml-spectra-processing/lib/xy/utils/equallySpacedSlot.js","../node_modules/ml-spectra-processing/lib/xy/xyIntegration.js","../node_modules/ml-spectra-processing/lib/xy/xyInterpolateLinear.js","../node_modules/ml-spectra-processing/lib/xy/xyJoinX.js","../node_modules/ml-spectra-processing/lib/xy/xyReduce.js","../node_modules/ml-spectra-processing/lib/xy/xySortX.js","../node_modules/ml-spectra-processing/lib/xy/xyUniqueX.js","../node_modules/ml-spectra-processing/lib/xyArray/utils/getSlots.js","../node_modules/ml-spectra-processing/lib/xyArray/xyArrayWeightedMerge.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectCheck.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectMaxXPoint.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectMinXPoint.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectSlotX.js","../node_modules/ml-spectra-processing/lib/utils/createStepArray.js","../node_modules/ml-spectra-processing/lib/utils/getCombinations.js","../node_modules/ml-spectra-processing/lib/utils/getCombinationsIterator.js","../node_modules/ml-spectra-processing/lib/utils/getRescaler.js","../node_modules/ml-spectra-processing/lib/matrix/matrixAbsoluteMedian.js","../node_modules/ml-spectra-processing/lib/matrix/matrixApplyNumericalEncoding.js","../node_modules/ml-spectra-processing/lib/matrix/matrixAutoCorrelation.js","../node_modules/ml-spectra-processing/lib/matrix/matrixBoxPlot.js","../node_modules/ml-spectra-processing/lib/matrix/matrixCenterZMean.js","../node_modules/ml-spectra-processing/lib/matrix/matrixColumnsCorrelation.js","../node_modules/ml-spectra-processing/lib/matrix/matrixGetSubMatrix.js","../node_modules/ml-spectra-processing/lib/matrix/matrixHilbertTransform.js","../node_modules/ml-spectra-processing/lib/matrix/matrixHistogram.js","../node_modules/ml-spectra-processing/lib/matrix/matrixMedian.js","../node_modules/ml-spectra-processing/lib/matrix/matrixNoiseStandardDeviation.js","../node_modules/ml-spectra-processing/lib/matrix/matrixNumericalDecoding.js","../node_modules/ml-spectra-processing/lib/matrix/matrixNumericalEncoding.js","../node_modules/ml-spectra-processing/lib/matrix/matrixPQN.js","../node_modules/ml-spectra-processing/lib/matrix/matrixSetSubMatrix.js","../node_modules/ml-spectra-processing/lib/matrix/matrixTranspose.js","../node_modules/ml-spectra-processing/lib/matrix/matrixZPivotRescale.js","../node_modules/ml-spectra-processing/lib/matrix/matrixZRescale.js","../node_modules/ml-spectra-processing/lib/matrix/matrixZRescalePerColumn.js","../node_modules/ml-spectra-processing/lib/reimArray/reimArrayFFT.js","../node_modules/ml-spectra-processing/lib/reim/reimFFT.js","../node_modules/ml-spectra-processing/lib/reimMatrix/reimMatrixFFT.js","../node_modules/ml-spectra-processing/lib/reimMatrix/reimMatrixFFTByColumns.js","../node_modules/ml-spectra-processing/lib/reimMatrix/reimMatrixPhaseCorrection.js","../node_modules/ml-spectra-processing/lib/utils/stringify.js","../node_modules/ml-spectra-processing/lib/x/xAbsoluteMedian.js","../node_modules/ml-spectra-processing/lib/x/xApplyFunctionStr.js","../node_modules/ml-spectra-processing/lib/x/xAutoCorrelation.js","../node_modules/ml-spectra-processing/lib/x/xDistributionStats.js","../node_modules/ml-spectra-processing/lib/x/xDivide.js","../node_modules/ml-spectra-processing/lib/x/xMaxAbsoluteValue.js","../node_modules/ml-spectra-processing/lib/x/xMaxIndex.js","../node_modules/ml-spectra-processing/lib/x/xMeanAbsoluteError.js","../node_modules/ml-spectra-processing/lib/x/xMeanSquaredError.js","../node_modules/ml-spectra-processing/lib/x/xMeanWeighted.js","../node_modules/ml-spectra-processing/lib/x/xMinIndex.js","../node_modules/ml-spectra-processing/lib/x/xMinMaxDelta.js","../node_modules/ml-spectra-processing/lib/x/xMode.js","../node_modules/ml-spectra-processing/lib/x/xNorm.js","../node_modules/ml-spectra-processing/lib/x/xParetoNormalization.js","../node_modules/ml-spectra-processing/lib/x/xRemoveOutliersIQR.js","../node_modules/ml-spectra-processing/lib/x/xRescale.js","../node_modules/ml-spectra-processing/lib/x/xRobustDistributionStats.js","../node_modules/ml-spectra-processing/lib/x/xRollingMax.js","../node_modules/ml-spectra-processing/lib/x/xRollingMedian.js","../node_modules/ml-spectra-processing/lib/x/xRollingMin.js","../node_modules/ml-spectra-processing/lib/x/xSampling.js","../node_modules/ml-spectra-processing/lib/x/xSequentialFillFromTo.js","../node_modules/ml-spectra-processing/lib/x/xSortAscending.js","../node_modules/ml-spectra-processing/lib/x/xUniqueSorted.js","../node_modules/ml-spectra-processing/lib/xreim/xreimSortX.js","../node_modules/ml-spectra-processing/lib/xreim/xreimZeroFilling.js","../node_modules/ml-spectra-processing/lib/xy2/xy2ToXY.js","../node_modules/ml-spectra-processing/lib/xy/xyAlign.js","../node_modules/ml-spectra-processing/lib/xyArray/xyArrayAlign.js","../node_modules/ml-spectra-processing/lib/xyArray/xyArrayAlignToFirst.js","../node_modules/ml-spectra-processing/lib/xyArray/utils/getSlotsToFirst.js","../node_modules/ml-spectra-processing/lib/xyArray/xyArrayMerge.js","../node_modules/ml-spectra-processing/lib/xy/xyCovariance.js","../node_modules/ml-spectra-processing/lib/xy/xyEnsureFloat64.js","../node_modules/ml-spectra-processing/lib/xy/xyEnsureGrowingX.js","../node_modules/ml-spectra-processing/lib/xy/xyExtract.js","../node_modules/ml-spectra-processing/lib/xy/xyFilter.js","../node_modules/ml-spectra-processing/lib/xy/xyFilterMinYValue.js","../node_modules/ml-spectra-processing/lib/xy/xyFilterTopYValues.js","../node_modules/ml-spectra-processing/lib/xy/xyFilterX.js","../node_modules/ml-spectra-processing/lib/xy/xyFilterXPositive.js","../node_modules/ml-spectra-processing/lib/xy/xyFindClosestPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyGetNMaxY.js","../node_modules/ml-spectra-processing/lib/xy/xyGrowingX.js","../node_modules/ml-spectra-processing/lib/xy/xyIntegral.js","../node_modules/ml-spectra-processing/lib/xy/xyMassCenter.js","../node_modules/ml-spectra-processing/lib/xy/xyMassCenterVector.js","../node_modules/ml-spectra-processing/lib/xy/xyMaxClosestYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyMaxMerge.js","../node_modules/ml-spectra-processing/lib/xy/xyMaxY.js","../node_modules/ml-spectra-processing/lib/xy/xyMaximaY.js","../node_modules/ml-spectra-processing/lib/xy/xyMedian.js","../node_modules/ml-spectra-processing/lib/xy/xyMedianY.js","../node_modules/ml-spectra-processing/lib/xy/xyMedianYAtXs.js","../node_modules/ml-spectra-processing/lib/xy/xyMergeByCentroids.js","../node_modules/ml-spectra-processing/lib/xy/xyMinClosestYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyMinYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyMinimaY.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectBestPoints.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectJoinX.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectMaxYPoint.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectMinMaxValues.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectMinYPoint.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectNormedY.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectSortX.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectSumY.js","../node_modules/ml-spectra-processing/lib/xyObject/xyObjectToXY.js","../node_modules/ml-spectra-processing/lib/xy/xyPeakInfo.js","../node_modules/ml-spectra-processing/lib/xy/xyRealMaxYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyRealMinYPoint.js","../node_modules/ml-spectra-processing/lib/xy/xyReduceNonContinuous.js","../node_modules/ml-spectra-processing/lib/xy/xyRolling.js","../node_modules/ml-spectra-processing/lib/xy/xyRollingCircleTransform.js","../node_modules/ml-spectra-processing/lib/xy/xySetYValue.js","../node_modules/ml-spectra-processing/lib/xy/xyToXYArray.js","../node_modules/ml-spectra-processing/lib/xy/xyToXYObject.js","../node_modules/ml-spectra-processing/lib/xy/xyWeightedMerge.js","../node_modules/ml-spectra-processing/lib/zones/zonesToXEquallySpaced.js","../node_modules/ml-array-sum/lib/index.js","../src/Series.js","../src/Series1D.js","../src/Series2D.js","../src/seriesFromArray.js","../src/filter/meanFilter.js","../node_modules/ml-array-mean/lib/index.js","../node_modules/ml-array-max/lib/index.js","../src/filter/percentageFilter.js","../node_modules/atom-sorter/lib/src/index.js","../node_modules/chemical-elements/lib/src/elementsAndIsotopes.js","../node_modules/chemical-elements/lib/src/elements.js","../node_modules/chemical-elements/lib/src/elementsAndIsotopesObject.js","../node_modules/chemical-elements/lib/src/elementsAndStableIsotopes.js","../node_modules/chemical-elements/lib/src/elementsAndStableIsotopesObject.js","../node_modules/chemical-elements/lib/src/elementsObject.js","../node_modules/chemical-elements/lib/src/isotopesObject.js","../node_modules/chemical-elements/lib/src/stableIsotopesObject.js","../node_modules/chemical-elements/lib/src/unsaturationsObject.js","../node_modules/chemical-groups/lib/src/groupsObject.js","../node_modules/chemical-groups/lib/src/groupsToSequence.js","../node_modules/mf-parser/lib/src/Kind.js","../node_modules/mf-parser/lib/src/util/parseCharge.js","../node_modules/mf-parser/lib/src/parse.js","../node_modules/mf-parser/lib/src/util/subSuperscript.js","../node_modules/mf-parser/lib/src/Format.js","../node_modules/mf-parser/lib/src/util/formatCharge.js","../node_modules/mf-parser/lib/src/util/improveLinesForDisplay.js","../node_modules/mf-parser/lib/src/util/toDisplay.js","../node_modules/mf-parser/lib/src/util/isMF.js","../node_modules/mf-parser/lib/src/Style.js","../node_modules/mf-parser/lib/src/util/toHtml.js","../node_modules/mf-parser/lib/src/ensureCase.js","../node_modules/mf-parser/lib/src/util/flatten.js","../node_modules/mf-parser/lib/src/util/getIsotopeRatioInfo.js","../node_modules/mf-parser/lib/src/util/getEA.js","../node_modules/mf-parser/lib/src/util/getElements.js","../node_modules/mf-parser/lib/src/util/getNumberOfIsotopologues.js","../node_modules/mf-parser/lib/src/util/partToAtoms.js","../node_modules/mf-parser/lib/src/util/partToMF.js","../node_modules/mf-parser/lib/src/util/getInfoInternal.js","../node_modules/mf-parser/lib/src/util/getIsotopesInfo.js","../node_modules/mf-parser/lib/src/util/partsToDisplay.js","../node_modules/mf-parser/lib/src/util/partsToMF.js","../node_modules/mf-parser/lib/src/util/toParts.js","../node_modules/mf-parser/lib/src/util/toText.js","../node_modules/mf-parser/lib/src/MFInternal.js","../node_modules/mf-parser/lib/src/MF.js","../node_modules/mf-parser/lib/src/parseToHtml.js","../node_modules/mf-utilities/lib/src/ensureUppercaseSequence.js","../node_modules/mf-utilities/lib/src/getEutrophicationPotential.js","../node_modules/mf-utilities/lib/src/getMsem.js","../node_modules/mf-utilities/lib/src/getMsInfo.js","../node_modules/mf-utilities/lib/src/getRangesForFragment.js","../node_modules/mf-utilities/lib/src/MFRange.js","../node_modules/mf-utilities/lib/src/mfDiff.js","../node_modules/mf-utilities/lib/src/preprocessIonizations.js","../node_modules/mf-utilities/lib/src/preprocessRanges.js","../node_modules/ml-peak-shape-generator/lib-esm/util/constants.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/gaussian/Gaussian.js","../node_modules/ml-peak-shape-generator/lib-esm/util/erfinv.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/lorentzian/Lorentzian.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/lorentzianDispersive/LorentzianDispersive.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/pseudoVoigt/PseudoVoigt.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/generalizedLorentzian/GeneralizedLorentzian.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/2d/gaussian2D/Gaussian2D.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/1d/getShape1D.js","../node_modules/ml-peak-shape-generator/lib-esm/shapes/2d/getShape2D.js","../node_modules/spectrum-generator/lib/BaseSpectrumGenerator.js","../node_modules/spectrum-generator/lib/SpectrumGenerator.js","../node_modules/spectrum-generator/lib/util/addBaseline.js","../node_modules/spectrum-generator/lib/util/addNoise.js","../node_modules/spectrum-generator/lib/Spectrum2DGenerator.js","../node_modules/spectrum-generator/lib/SparseSpectrumGenerator.js","../node_modules/spectrum-generator/lib/generateSparseSpectrum.js","../node_modules/spectrum-generator/lib/generateSpectrum.js","../node_modules/isotopic-distribution/lib/src/utils/closestPointX.js","../node_modules/isotopic-distribution/lib/src/utils/joinX.js","../node_modules/isotopic-distribution/lib/src/utils/multiply.js","../node_modules/isotopic-distribution/lib/src/utils/power.js","../node_modules/isotopic-distribution/lib/src/Distribution.js","../node_modules/isotopic-distribution/lib/src/utils/getDerivedCompositionInfo.js","../node_modules/isotopic-distribution/lib/src/IsotopicDistribution.js","../node_modules/mf-matcher/lib/src/unsaturationMatcher.js","../node_modules/mf-matcher/lib/src/generalMatcher.js","../node_modules/mf-matcher/lib/src/msemMatcher.js","../node_modules/sum-object-keys/lib/index.js","../node_modules/mf-generator/lib/src/generateMFs.js","../node_modules/ml-ngmca/src/util/zeroInsteadOfNegative.js","../node_modules/ml-ngmca/src/stages/checkMatrixS.js","../node_modules/ml-ngmca/src/util/normBy.js","../node_modules/ml-ngmca/src/stages/updateMatrixA.js","../node_modules/ml-ngmca/src/util/normProj.js","../node_modules/ml-ngmca/src/stages/updateMatrixS.js","../node_modules/ml-ngmca/src/util/getMax.js","../node_modules/ml-ngmca/src/stages/normalize.js","../node_modules/median-quickselect/lib/median-quickselect.min.js","../node_modules/ml-ngmca/src/util/getMedians.js","../node_modules/ml-ngmca/src/stages/updateLambda.js","../node_modules/ml-ngmca/src/util/dimMADstd.js","../node_modules/ml-ngmca/src/nGMCA.js","../node_modules/ml-ngmca/src/stages/initialize.js","../node_modules/ml-pca/lib-esm/pca.js","../src/ms/deconvolution.js","../src/util/estimateNbPureComponents.js","../src/ms/merge.js","../node_modules/ml-airpls/lib/utils.js","../node_modules/ml-airpls/lib/index.js","../node_modules/ml-savitzky-golay-generalized/lib-esm/index.js","../node_modules/ml-gsd/lib/algorithms/getMinMaxIntervals.js","../node_modules/ml-gsd/lib/algorithms/tryMatchOneIntervalWithMinData.js","../node_modules/ml-gsd/lib/algorithms/getPeaksFromIntervals.js","../node_modules/ml-gsd/lib/algorithms/xGetCrossZeroPoints.js","../node_modules/ml-gsd/lib/algorithms/firstDerivative.js","../node_modules/ml-gsd/lib/gsd.js","../node_modules/ml-gsd/lib/algorithms/secondDerivative.js","../node_modules/ml-gsd/lib/algorithms/autoAlgorithm.js","../node_modules/ml-gsd/lib/utils/optimizeTop.js","../src/peaks/getPeaks.js","../node_modules/ml-gsd/lib/post/broadenPeaks.js","../src/util/integrate.js","../src/util/baselineCorrection.js","../src/Chromatogram.js","../src/util/filter.js","../src/ms/calculateTic.js","../src/ms/calculateLength.js","../src/ms/calculateBpc.js","../src/ms/calculateEic.js","../src/ms/calculateForMF.js","../src/util/getClosestData.js","../src/ms/applyLockMass.js","../src/util/getMzVsTimesMatrix.js","../src/peaks/appendMass.js","../src/massFilter.js","../src/vectorify.js","../src/ms/cosineSimilarity.js","../src/spectraComparison.js","../node_modules/ml-regression-base/lib-esm/checkArrayLength.js","../node_modules/ml-regression-base/lib-esm/BaseRegression.js","../node_modules/ml-regression-base/lib-esm/maybeToPrecision.js","../node_modules/ml-regression-polynomial/lib/index.js","../src/kovats.js","../node_modules/binary-search/index.js","../src/getKovatsConversionFunction.js","../node_modules/ensure-string/lib/index.js","../node_modules/dynamic-typing/lib/parseString.js","../node_modules/gyromagnetic-ratio/lib-esm/getGyromagneticRatio.js","../node_modules/gyromagnetic-ratio/lib-esm/getGyromagneticNucleus.js","../node_modules/gyromagnetic-ratio/lib-esm/index.js","../node_modules/gyromagnetic-ratio/lib-esm/gyromagneticRatioMHzT.js","../node_modules/ml-array-median/lib/index.js","../node_modules/jcampconverter/dist/jcampconverter.js","../node_modules/xy-parser/lib/index.js","../node_modules/xy-parser/lib/parse.js","../node_modules/iobuffer/lib-esm/text.js","../node_modules/iobuffer/lib-esm/IOBuffer.js","../node_modules/netcdfjs/lib-esm/types.js","../node_modules/netcdfjs/lib-esm/utils.js","../node_modules/netcdfjs/lib-esm/header.js","../node_modules/netcdfjs/lib-esm/toString.js","../node_modules/netcdfjs/lib-esm/parser.js","../node_modules/netcdfjs/lib-esm/data.js","../node_modules/netcdf-gcms/lib/index.js","../node_modules/netcdf-gcms/lib/agilentGCMS.js","../node_modules/netcdf-gcms/lib/finniganGCMS.js","../node_modules/netcdf-gcms/lib/brukerGCMS.js","../node_modules/netcdf-gcms/lib/shimadzuGCMS.js","../node_modules/netcdf-gcms/lib/advionGCMS.js","../node_modules/netcdf-gcms/lib/agilentHPLC.js","../node_modules/netcdf-gcms/lib/aiaTemplate.js","../node_modules/arraybuffer-xml-parser/lib/traversable/defaultOptions.js","../node_modules/arraybuffer-xml-parser/lib/XMLNode.js","../node_modules/arraybuffer-xml-parser/lib/bufferUtils/arrayIndexOf.js","../node_modules/arraybuffer-xml-parser/lib/bufferUtils/arrayTrim.js","../node_modules/arraybuffer-xml-parser/lib/traversable/utils/utf8Decoder.js","../node_modules/arraybuffer-xml-parser/lib/traversable/closingIndexForOpeningTag.js","../node_modules/arraybuffer-xml-parser/lib/traversable/findClosingIndex.js","../node_modules/arraybuffer-xml-parser/lib/util.js","../node_modules/arraybuffer-xml-parser/lib/traversable/parseAttributesString.js","../node_modules/arraybuffer-xml-parser/lib/traversable/utils/removeNameSpaceIfNeeded.js","../node_modules/arraybuffer-xml-parser/lib/traversableToJSON.js","../node_modules/arraybuffer-xml-parser/lib/parse.js","../node_modules/arraybuffer-xml-parser/lib/traversable/getTraversable.js","../node_modules/uint8-base64/lib-esm/decode.js","../node_modules/uint8-base64/lib-esm/base64codes.js","../node_modules/uint8-base64/lib-esm/encodeFast.js","../node_modules/mzdata/src/util/decodeData.js","../node_modules/mzdata/src/util/inflate.js","../node_modules/mzdata/src/mzdata/parseCvParam.js","../node_modules/mzdata/src/mzdata/parseMzData.js","../node_modules/mzdata/src/mzdata/processMetaData.js","../node_modules/mzdata/src/mzdata/processSpectrumList.js","../node_modules/mzdata/src/mzml/parseCvParam.js","../node_modules/mzdata/src/mzml/parseMzML.js","../node_modules/mzdata/src/mzml/processSpectrumList.js","../node_modules/mzdata/src/mzxml/parseMzXML.js","../node_modules/mzdata/src/mzxml/processSpectrumList.js","../node_modules/mzdata/src/index.js","../src/peaks/appendKovats.js","../src/from/jcamp.js","../src/from/netcdf.js","../src/from/text.js","../src/from/xml.js","../src/scaleAlignment.js"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).\n * @param value - Object to check.\n * @returns True if the object is an array or a typed array.\n */\nexport function isAnyArray(value) {\n    const tag = toString.call(value);\n    return tag.endsWith('Array]') && !tag.includes('Big');\n}\n//# sourceMappingURL=index.js.map","/**\n * Calculates reimAbsolute value of a complex spectrum.\n * @param data - complex spectrum\n * @param options\n * @param options.output\n * @returns - reimAbsolute value\n */\nexport function reimAbsolute(data, options = {}) {\n    const length = data.re.length;\n    const { output = new Float64Array(length) } = options;\n    const re = data.re;\n    const im = data.im;\n    for (let i = 0; i < length; i++) {\n        output[i] = Math.hypot(re[i], im[i]);\n    }\n    return output;\n}\n//# sourceMappingURL=reimAbsolute.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * This function\n * @param output - undefined or a new array\n * @param length - length of the output array\n * @returns\n */\nexport function getOutputArray(output, length) {\n    if (output !== undefined) {\n        if (!isAnyArray(output)) {\n            throw new TypeError('output option must be an array if specified');\n        }\n        if (output.length !== length) {\n            throw new TypeError('the output array does not have the correct length');\n        }\n        return output;\n    }\n    else {\n        return new Float64Array(length);\n    }\n}\n//# sourceMappingURL=getOutputArray.js.map","/**\n * This function returns an array with absolute values.\n * @param array - array of data\n * @returns - array with absolute values\n */\nexport function xAbsolute(array) {\n    const tmpArray = array.slice();\n    for (let i = 0; i < tmpArray.length; i++) {\n        if (tmpArray[i] < 0)\n            tmpArray[i] *= -1;\n    }\n    return tmpArray;\n}\n//# sourceMappingURL=xAbsolute.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Calculates the median of an array.\n * @param input - Array containing values\n * @param options\n * @returns - median\n */\nexport function xMedian(input, options = {}) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    const { exact = false } = options || {};\n    const array = input.slice();\n    const middleIndex = calcMiddle(0, array.length - 1);\n    const median = quickSelect(array, middleIndex);\n    if (array.length % 2 === 1 || !exact) {\n        return median;\n    }\n    const medianNext = quickSelect(array, middleIndex + 1);\n    return (median + medianNext) / 2;\n}\nfunction quickSelect(array, middleIndex) {\n    let low = 0;\n    let high = array.length - 1;\n    let middle = 0;\n    let currentLow = 0;\n    let currentHigh = 0;\n    while (true) {\n        if (high <= low) {\n            return array[middleIndex];\n        }\n        if (high === low + 1) {\n            if (array[low] > array[high]) {\n                swap(array, low, high);\n            }\n            return array[middleIndex];\n        }\n        // Find median of low, middle and high items; swap into position low\n        middle = calcMiddle(low, high);\n        if (array[middle] > array[high])\n            swap(array, middle, high);\n        if (array[low] > array[high])\n            swap(array, low, high);\n        if (array[middle] > array[low])\n            swap(array, middle, low);\n        // Swap low item (now in position middle) into position (low+1)\n        swap(array, middle, low + 1);\n        // Nibble from each end towards middle, swapping items when stuck\n        currentLow = low + 1;\n        currentHigh = high;\n        while (true) {\n            do\n                currentLow++;\n            while (array[low] > array[currentLow]);\n            do\n                currentHigh--;\n            while (array[currentHigh] > array[low]);\n            if (currentHigh < currentLow) {\n                break;\n            }\n            swap(array, currentLow, currentHigh);\n        }\n        // Swap middle item (in position low) back into correct position\n        swap(array, low, currentHigh);\n        // Re-set active partition\n        if (currentHigh <= middleIndex) {\n            low = currentLow;\n        }\n        if (currentHigh >= middleIndex) {\n            high = currentHigh - 1;\n        }\n    }\n}\nfunction swap(array, i, j) {\n    const temp = array[j];\n    array[j] = array[i];\n    array[i] = temp;\n}\nfunction calcMiddle(i, j) {\n    return Math.floor((i + j) / 2);\n}\n//# sourceMappingURL=xMedian.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Checks if the input is a non-empty array of numbers.\n * Only checks the first element.\n * @param input - Array to check.\n * @param options - Additional checks.\n */\nexport function xCheck(input, options = {}) {\n    const { minLength } = options;\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    if (typeof input[0] !== 'number') {\n        throw new TypeError('input must contain numbers');\n    }\n    if (minLength && input.length < minLength) {\n        throw new Error(`input must have a length of at least ${minLength}`);\n    }\n}\n//# sourceMappingURL=xCheck.js.map","/**\n * Returns the closest index of a `target`\n * @param array - array of numbers\n * @param target - target\n * @param options\n * @returns - closest index\n */\nexport function xFindClosestIndex(array, target, options = {}) {\n    const { sorted = true } = options;\n    if (sorted) {\n        let low = 0;\n        let high = array.length - 1;\n        let middle = 0;\n        while (high - low > 1) {\n            middle = low + ((high - low) >> 1);\n            if (array[middle] < target) {\n                low = middle;\n            }\n            else if (array[middle] > target) {\n                high = middle;\n            }\n            else {\n                return middle;\n            }\n        }\n        if (low < array.length - 1) {\n            if (Math.abs(target - array[low]) < Math.abs(array[low + 1] - target)) {\n                return low;\n            }\n            else {\n                return low + 1;\n            }\n        }\n        else {\n            return low;\n        }\n    }\n    else {\n        let index = 0;\n        let diff = Number.POSITIVE_INFINITY;\n        for (let i = 0; i < array.length; i++) {\n            const currentDiff = Math.abs(array[i] - target);\n            if (currentDiff < diff) {\n                diff = currentDiff;\n                index = i;\n            }\n        }\n        return index;\n    }\n}\n//# sourceMappingURL=xFindClosestIndex.js.map","import { xFindClosestIndex } from \"./xFindClosestIndex.js\";\n/**\n * Returns an object with {fromIndex, toIndex} for a specific from / to\n * @param x - array of numbers\n * @param options - Options\n */\nexport function xGetFromToIndex(x, options = {}) {\n    let { fromIndex, toIndex } = options;\n    const { from, to } = options;\n    if (fromIndex === undefined) {\n        if (from !== undefined) {\n            fromIndex = xFindClosestIndex(x, from);\n        }\n        else {\n            fromIndex = 0;\n        }\n    }\n    if (toIndex === undefined) {\n        if (to !== undefined) {\n            toIndex = xFindClosestIndex(x, to);\n        }\n        else {\n            toIndex = x.length - 1;\n        }\n    }\n    if (fromIndex < 0)\n        fromIndex = 0;\n    if (toIndex < 0)\n        toIndex = 0;\n    if (fromIndex >= x.length)\n        fromIndex = x.length - 1;\n    if (toIndex >= x.length)\n        toIndex = x.length - 1;\n    if (fromIndex > toIndex)\n        [fromIndex, toIndex] = [toIndex, fromIndex];\n    return { fromIndex, toIndex };\n}\n//# sourceMappingURL=xGetFromToIndex.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\nexport function xAbsoluteSum(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let sum = 0;\n    for (let i = fromIndex; i <= toIndex; i++) {\n        sum += Math.abs(array[i]);\n    }\n    return sum;\n}\n//# sourceMappingURL=xAbsoluteSum.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * This function xAdd the first array by the second array or a constant value to each element of the first array\n * @param array1 - the first array\n * @param array2 - the second array or number\n * @returns the result of the addition\n */\nexport function xAdd(array1, array2) {\n    let isConstant = false;\n    let constant = 0;\n    if (isAnyArray(array2)) {\n        if (array1.length !== array2.length) {\n            throw new Error('size of array1 and array2 must be identical');\n        }\n    }\n    else {\n        isConstant = true;\n        constant = array2;\n    }\n    const array3 = new Float64Array(array1.length);\n    if (isConstant) {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] + constant;\n        }\n    }\n    else {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] + array2[i];\n        }\n    }\n    return array3;\n}\n//# sourceMappingURL=xAdd.js.map","import { isAnyArray } from 'is-any-array';\nimport { getOutputArray } from \"./getOutputArray.js\";\n/**\n * This function xMultiply the first array by the second array or a constant value to each element of the first array\n * @param array1 - first array\n * @param array2 - second array\n * @param options - options\n */\nexport function xMultiply(array1, array2, options = {}) {\n    let isConstant = false;\n    let constant = 0;\n    if (isAnyArray(array2)) {\n        if (array1.length !== array2.length) {\n            throw new Error('size of array1 and array2 must be identical');\n        }\n    }\n    else {\n        isConstant = true;\n        constant = array2;\n    }\n    const array3 = getOutputArray(options.output, array1.length);\n    if (isConstant) {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] * constant;\n        }\n    }\n    else {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] * array2[i];\n        }\n    }\n    return array3;\n}\n//# sourceMappingURL=xMultiply.js.map","import { xMultiply } from \"./xMultiply.js\";\n/**\n * Dot product between two arrays.\n * @param A - First array.\n * @param B - Second array.\n */\nexport function xDotProduct(A, B) {\n    const g = xMultiply(A, B);\n    let result = 0;\n    for (let i = 0; i < A.length; i++) {\n        result += g[i];\n    }\n    return result;\n}\n//# sourceMappingURL=xDotProduct.js.map","import { xDotProduct } from \"./xDotProduct.js\";\n/**\n * Calculates the cross-correlation between 2 arrays\n * @param A - fixed array\n * @param B - sweeping array\n * @param options - Options\n */\nexport function xCrossCorrelation(A, B, options = {}) {\n    const { tau = 1, lag = A.length - 1 } = options;\n    const result = new Float64Array(1 + (2 * lag) / tau);\n    if (A.length === B.length) {\n        const n = B.length;\n        const g = new Float64Array(2 * n);\n        const q = new Float64Array(2 * n);\n        for (let i = 0; i < n; i++) {\n            q[n + i] = B[i];\n        }\n        for (let i = n * 2 - (tau - 1); i > 0; i -= tau) {\n            let k = 0;\n            for (let j = i; j < n * 2; j++) {\n                g[k] = q[j];\n                k++;\n            }\n            const w = [];\n            for (let l = 0; l < n; l++) {\n                w[l] = g[l];\n            }\n            result[(k - (n - lag)) / tau] = xDotProduct(A, w);\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=xCrossCorrelation.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Downsample an array by averaging consecutive non-overlapping points (binning).\n * Either specify a fixed `binSize` or a target `numberOfPoints`.\n * @param array - Input array.\n * @param options - Options.\n * @returns Downsampled array.\n */\nexport function xBinning(array, options = {}) {\n    xCheck(array);\n    const { binSize, numberOfPoints, keepFirstAndLast = true } = options;\n    const { length } = array;\n    if (numberOfPoints !== undefined) {\n        if (binSize !== undefined) {\n            throw new RangeError('binSize and numberOfPoints are mutually exclusive');\n        }\n        if (!Number.isInteger(numberOfPoints) || numberOfPoints <= 0) {\n            throw new RangeError('numberOfPoints must be a positive integer');\n        }\n        if (numberOfPoints > length) {\n            throw new RangeError('numberOfPoints must be <= array.length');\n        }\n        return binByNumberOfPoints(array, numberOfPoints, keepFirstAndLast);\n    }\n    const effectiveBinSize = binSize ?? 10;\n    if (!Number.isInteger(effectiveBinSize) || effectiveBinSize <= 0) {\n        throw new RangeError('binSize must be a positive integer');\n    }\n    if (effectiveBinSize === 1) {\n        return Float64Array.from(array);\n    }\n    if (keepFirstAndLast) {\n        if (length <= 2) {\n            return Float64Array.from(array);\n        }\n        const innerLength = length - 2;\n        const innerBinCount = Math.ceil(innerLength / effectiveBinSize);\n        const output = new Float64Array(innerBinCount + 2);\n        output[0] = array[0];\n        output[output.length - 1] = array[length - 1];\n        for (let i = 0, j = 1; i < innerLength; i += effectiveBinSize, j++) {\n            const start = i + 1;\n            const end = Math.min(start + effectiveBinSize, length - 1);\n            let sum = 0;\n            for (let k = start; k < end; k++) {\n                sum += array[k];\n            }\n            output[j] = sum / (end - start);\n        }\n        return output;\n    }\n    const outputLength = Math.ceil(length / effectiveBinSize);\n    const output = new Float64Array(outputLength);\n    for (let i = 0, j = 0; i < length; i += effectiveBinSize, j++) {\n        const end = Math.min(i + effectiveBinSize, length);\n        let sum = 0;\n        for (let k = i; k < end; k++) {\n            sum += array[k];\n        }\n        output[j] = sum / (end - i);\n    }\n    return output;\n}\nfunction binByNumberOfPoints(array, numberOfPoints, keepFirstAndLast) {\n    const { length } = array;\n    const output = new Float64Array(numberOfPoints);\n    if (keepFirstAndLast) {\n        if (numberOfPoints < 2) {\n            throw new RangeError('numberOfPoints must be >= 2 when keepFirstAndLast is true');\n        }\n        output[0] = array[0];\n        output[numberOfPoints - 1] = array[length - 1];\n        if (numberOfPoints === 2) {\n            return output;\n        }\n        const innerLength = length - 2;\n        const innerBins = numberOfPoints - 2;\n        for (let j = 0; j < innerBins; j++) {\n            const start = 1 + Math.floor((j * innerLength) / innerBins);\n            const end = 1 + Math.floor(((j + 1) * innerLength) / innerBins);\n            let sum = 0;\n            for (let k = start; k < end; k++) {\n                sum += array[k];\n            }\n            output[j + 1] = sum / (end - start);\n        }\n        return output;\n    }\n    for (let j = 0; j < numberOfPoints; j++) {\n        const start = Math.floor((j * length) / numberOfPoints);\n        const end = Math.floor(((j + 1) * length) / numberOfPoints);\n        let sum = 0;\n        for (let k = start; k < end; k++) {\n            sum += array[k];\n        }\n        output[j] = sum / (end - start);\n    }\n    return output;\n}\n//# sourceMappingURL=xBinning.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Calculating the box plot of the array\n * This function will interpolate the values and use the inclusive algorithm\n * @param array - data\n * @param options\n * @returns - q1, median, q3, min, max\n */\nexport function xBoxPlot(array) {\n    xCheck(array);\n    // duplicate the array to avoid modifying the original one\n    // and sort typed array that is much faster than sorting a normal array\n    array = Float64Array.from(array);\n    array.sort();\n    // need to deal with very close points otherwise it yields to incorrect results\n    if (array.at(-1) - array[0] <= Number.EPSILON) {\n        // if one of the 2 numbers is an integer let's take this one\n        const shortTestNumber = String(array[0]).length < String(array.at(-1)).length\n            ? array[0]\n            : array.at(-1);\n        return {\n            min: array[0],\n            q1: shortTestNumber,\n            median: shortTestNumber,\n            q3: shortTestNumber,\n            max: array.at(-1),\n        };\n    }\n    const posQ1 = (array.length - 1) / 4;\n    const posQ3 = (array.length - 1) * (3 / 4);\n    const medianPos = (array.length - 1) / 2;\n    const q1MinProportion = posQ1 % 1;\n    const q3MinProportion = posQ3 % 1;\n    const medianMinProportion = medianPos % 1;\n    return {\n        min: array[0],\n        q1: q1MinProportion === 0\n            ? array[posQ1]\n            : array[posQ1 >> 0] * (1 - q1MinProportion) +\n                array[(posQ1 >> 0) + 1] * q1MinProportion,\n        median: medianMinProportion === 0\n            ? array[medianPos]\n            : array[medianPos >> 0] * (1 - medianMinProportion) +\n                array[(medianPos >> 0) + 1] * medianMinProportion,\n        q3: q3MinProportion === 0\n            ? array[posQ3]\n            : array[posQ3 >> 0] * (1 - q3MinProportion) +\n                array[(posQ3 >> 0) + 1] * q3MinProportion,\n        max: array.at(-1),\n    };\n}\n//# sourceMappingURL=xBoxPlot.js.map","import { xBoxPlot } from \"./xBoxPlot.js\";\n/**\n * Calculating the box plot of the array with outliers\n * Values are outliers if they are below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR\n * @param array - data\n * @returns - q1, median, q3, min, max, outliers\n */\nexport function xBoxPlotWithOutliers(array) {\n    const boxPlot = xBoxPlot(array);\n    if (boxPlot.max - boxPlot.min <= Number.EPSILON) {\n        return {\n            ...boxPlot,\n            lowerWhisker: boxPlot.min,\n            upperWhisker: boxPlot.max,\n            minWhisker: boxPlot.min,\n            maxWhisker: boxPlot.max,\n            iqr: 0,\n            outliers: [],\n        };\n    }\n    const iqr = boxPlot.q3 - boxPlot.q1;\n    const lowerWhisker = boxPlot.q1 - 1.5 * iqr;\n    const upperWhisker = boxPlot.q3 + 1.5 * iqr;\n    const outliers = [];\n    let minWhisker = boxPlot.median;\n    let maxWhisker = boxPlot.median;\n    for (const value of array) {\n        if (value < lowerWhisker || value > upperWhisker) {\n            outliers.push(value);\n        }\n        else {\n            if (value < minWhisker)\n                minWhisker = value;\n            if (value > maxWhisker)\n                maxWhisker = value;\n        }\n    }\n    const info = {\n        ...boxPlot,\n        lowerWhisker,\n        upperWhisker,\n        minWhisker,\n        maxWhisker,\n        iqr,\n        outliers,\n    };\n    return info;\n}\n//# sourceMappingURL=xBoxPlotWithOutliers.js.map","/**\n * Check that two arrays have the same length.\n * @param array1 - First array.\n * @param array2 - Second array.\n */\nexport function xCheckLengths(array1, array2) {\n    if (array1.length !== array2.length) {\n        throw new TypeError('length of array1 and array2 must be identical');\n    }\n}\n//# sourceMappingURL=xCheckLengths.js.map","/**\n * Calculates the correlation between 2 vectors\n * https://en.wikipedia.org/wiki/Correlation_and_dependence\n * @param A - first array\n * @param B - sencond array\n */\nexport function xCorrelation(A, B) {\n    const n = A.length;\n    let sumA = 0;\n    let sumA2 = 0;\n    let sumB = 0;\n    let sumB2 = 0;\n    let sumAB = 0;\n    for (let i = 0; i < n; i++) {\n        const a = A[i];\n        const b = B[i];\n        sumA += a;\n        sumA2 += a ** 2;\n        sumB += b;\n        sumB2 += b ** 2;\n        sumAB += a * b;\n    }\n    return ((n * sumAB - sumA * sumB) /\n        (Math.sqrt(n * sumA2 - sumA ** 2) * Math.sqrt(n * sumB2 - sumB ** 2)));\n}\n//# sourceMappingURL=xCorrelation.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).\n * @param value - Object to check.\n * @returns True if the object is an array or a typed array.\n */\nfunction isAnyArray(value) {\n    const tag = toString.call(value);\n    return tag.endsWith('Array]') && !tag.includes('Big');\n}\n\n/**\n * Computes the maximum of the given values.\n *\n * @param input\n * @param options\n */\nfunction max(input, options = {}) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    const { fromIndex = 0, toIndex = input.length } = options;\n    if (fromIndex < 0 ||\n        fromIndex >= input.length ||\n        !Number.isInteger(fromIndex)) {\n        throw new Error('fromIndex must be a positive integer smaller than length');\n    }\n    if (toIndex <= fromIndex ||\n        toIndex > input.length ||\n        !Number.isInteger(toIndex)) {\n        throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n    }\n    let maxValue = input[fromIndex];\n    for (let i = fromIndex + 1; i < toIndex; i++) {\n        if (input[i] > maxValue)\n            maxValue = input[i];\n    }\n    return maxValue;\n}\n\n/**\n * Computes the minimum of the given values.\n */\nfunction min(input, options = {}) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    const { fromIndex = 0, toIndex = input.length } = options;\n    if (fromIndex < 0 ||\n        fromIndex >= input.length ||\n        !Number.isInteger(fromIndex)) {\n        throw new Error('fromIndex must be a positive integer smaller than length');\n    }\n    if (toIndex <= fromIndex ||\n        toIndex > input.length ||\n        !Number.isInteger(toIndex)) {\n        throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n    }\n    let minValue = input[fromIndex];\n    for (let i = fromIndex + 1; i < toIndex; i++) {\n        if (input[i] < minValue)\n            minValue = input[i];\n    }\n    return minValue;\n}\n\n/**\n * Rescale an array into a range.\n */\nfunction rescale(input, options = {}) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    else if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    let output;\n    if (options.output !== undefined) {\n        if (!isAnyArray(options.output)) {\n            throw new TypeError('output option must be an array if specified');\n        }\n        output = options.output;\n    }\n    else {\n        output = new Array(input.length);\n    }\n    const currentMin = min(input);\n    const currentMax = max(input);\n    if (currentMin === currentMax) {\n        throw new RangeError('minimum and maximum input values are equal. Cannot rescale a constant array');\n    }\n    const { min: minValue = options.autoMinMax ? currentMin : 0, max: maxValue = options.autoMinMax ? currentMax : 1, } = options;\n    if (minValue >= maxValue) {\n        throw new RangeError('min option must be smaller than max option');\n    }\n    const factor = (maxValue - minValue) / (currentMax - currentMin);\n    for (let i = 0; i < input.length; i++) {\n        output[i] = (input[i] - currentMin) * factor + minValue;\n    }\n    return output;\n}\n\nconst indent = ' '.repeat(2);\nconst indentData = ' '.repeat(4);\n\n/**\n * @this {Matrix}\n * @returns {string}\n */\nfunction inspectMatrix() {\n  return inspectMatrixWithOptions(this);\n}\n\nfunction inspectMatrixWithOptions(matrix, options = {}) {\n  const {\n    maxRows = 15,\n    maxColumns = 10,\n    maxNumSize = 8,\n    padMinus = 'auto',\n  } = options;\n  return `${matrix.constructor.name} {\n${indent}[\n${indentData}${inspectData(matrix, maxRows, maxColumns, maxNumSize, padMinus)}\n${indent}]\n${indent}rows: ${matrix.rows}\n${indent}columns: ${matrix.columns}\n}`;\n}\n\nfunction inspectData(matrix, maxRows, maxColumns, maxNumSize, padMinus) {\n  const { rows, columns } = matrix;\n  const maxI = Math.min(rows, maxRows);\n  const maxJ = Math.min(columns, maxColumns);\n  const result = [];\n\n  if (padMinus === 'auto') {\n    padMinus = false;\n    loop: for (let i = 0; i < maxI; i++) {\n      for (let j = 0; j < maxJ; j++) {\n        if (matrix.get(i, j) < 0) {\n          padMinus = true;\n          break loop;\n        }\n      }\n    }\n  }\n\n  for (let i = 0; i < maxI; i++) {\n    let line = [];\n    for (let j = 0; j < maxJ; j++) {\n      line.push(formatNumber(matrix.get(i, j), maxNumSize, padMinus));\n    }\n    result.push(`${line.join(' ')}`);\n  }\n  if (maxJ !== columns) {\n    result[result.length - 1] += ` ... ${columns - maxColumns} more columns`;\n  }\n  if (maxI !== rows) {\n    result.push(`... ${rows - maxRows} more rows`);\n  }\n  return result.join(`\\n${indentData}`);\n}\n\nfunction formatNumber(num, maxNumSize, padMinus) {\n  return (\n    num >= 0 && padMinus\n      ? ` ${formatNumber2(num, maxNumSize - 1)}`\n      : formatNumber2(num, maxNumSize)\n  ).padEnd(maxNumSize);\n}\n\nfunction formatNumber2(num, len) {\n  // small.length numbers should be as is\n  let str = num.toString();\n  if (str.length <= len) return str;\n\n  // (7)'0.00123' is better then (7)'1.23e-2'\n  // (8)'0.000123' is worse then (7)'1.23e-3',\n  let fix = num.toFixed(len);\n  if (fix.length > len) {\n    fix = num.toFixed(Math.max(0, len - (fix.length - len)));\n  }\n  if (\n    fix.length <= len &&\n    !fix.startsWith('0.000') &&\n    !fix.startsWith('-0.000')\n  ) {\n    return fix;\n  }\n\n  // well, if it's still too long the user should've used longer numbers\n  let exp = num.toExponential(len);\n  if (exp.length > len) {\n    exp = num.toExponential(Math.max(0, len - (exp.length - len)));\n  }\n  return exp.slice(0);\n}\n\nfunction installMathOperations(AbstractMatrix, Matrix) {\n  AbstractMatrix.prototype.add = function add(value) {\n    if (typeof value === 'number') return this.addS(value);\n    return this.addM(value);\n  };\n\n  AbstractMatrix.prototype.addS = function addS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) + value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.addM = function addM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) + matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.add = function add(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.add(value);\n  };\n\n  AbstractMatrix.prototype.sub = function sub(value) {\n    if (typeof value === 'number') return this.subS(value);\n    return this.subM(value);\n  };\n\n  AbstractMatrix.prototype.subS = function subS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) - value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.subM = function subM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) - matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.sub = function sub(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.sub(value);\n  };\n  AbstractMatrix.prototype.subtract = AbstractMatrix.prototype.sub;\n  AbstractMatrix.prototype.subtractS = AbstractMatrix.prototype.subS;\n  AbstractMatrix.prototype.subtractM = AbstractMatrix.prototype.subM;\n  AbstractMatrix.subtract = AbstractMatrix.sub;\n\n  AbstractMatrix.prototype.mul = function mul(value) {\n    if (typeof value === 'number') return this.mulS(value);\n    return this.mulM(value);\n  };\n\n  AbstractMatrix.prototype.mulS = function mulS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) * value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.mulM = function mulM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) * matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.mul = function mul(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.mul(value);\n  };\n  AbstractMatrix.prototype.multiply = AbstractMatrix.prototype.mul;\n  AbstractMatrix.prototype.multiplyS = AbstractMatrix.prototype.mulS;\n  AbstractMatrix.prototype.multiplyM = AbstractMatrix.prototype.mulM;\n  AbstractMatrix.multiply = AbstractMatrix.mul;\n\n  AbstractMatrix.prototype.div = function div(value) {\n    if (typeof value === 'number') return this.divS(value);\n    return this.divM(value);\n  };\n\n  AbstractMatrix.prototype.divS = function divS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) / value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.divM = function divM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) / matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.div = function div(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.div(value);\n  };\n  AbstractMatrix.prototype.divide = AbstractMatrix.prototype.div;\n  AbstractMatrix.prototype.divideS = AbstractMatrix.prototype.divS;\n  AbstractMatrix.prototype.divideM = AbstractMatrix.prototype.divM;\n  AbstractMatrix.divide = AbstractMatrix.div;\n\n  AbstractMatrix.prototype.mod = function mod(value) {\n    if (typeof value === 'number') return this.modS(value);\n    return this.modM(value);\n  };\n\n  AbstractMatrix.prototype.modS = function modS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) % value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.modM = function modM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) % matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.mod = function mod(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.mod(value);\n  };\n  AbstractMatrix.prototype.modulus = AbstractMatrix.prototype.mod;\n  AbstractMatrix.prototype.modulusS = AbstractMatrix.prototype.modS;\n  AbstractMatrix.prototype.modulusM = AbstractMatrix.prototype.modM;\n  AbstractMatrix.modulus = AbstractMatrix.mod;\n\n  AbstractMatrix.prototype.and = function and(value) {\n    if (typeof value === 'number') return this.andS(value);\n    return this.andM(value);\n  };\n\n  AbstractMatrix.prototype.andS = function andS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) & value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.andM = function andM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) & matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.and = function and(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.and(value);\n  };\n\n  AbstractMatrix.prototype.or = function or(value) {\n    if (typeof value === 'number') return this.orS(value);\n    return this.orM(value);\n  };\n\n  AbstractMatrix.prototype.orS = function orS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) | value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.orM = function orM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) | matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.or = function or(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.or(value);\n  };\n\n  AbstractMatrix.prototype.xor = function xor(value) {\n    if (typeof value === 'number') return this.xorS(value);\n    return this.xorM(value);\n  };\n\n  AbstractMatrix.prototype.xorS = function xorS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) ^ value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.xorM = function xorM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) ^ matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.xor = function xor(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.xor(value);\n  };\n\n  AbstractMatrix.prototype.leftShift = function leftShift(value) {\n    if (typeof value === 'number') return this.leftShiftS(value);\n    return this.leftShiftM(value);\n  };\n\n  AbstractMatrix.prototype.leftShiftS = function leftShiftS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) << value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.leftShiftM = function leftShiftM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) << matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.leftShift = function leftShift(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.leftShift(value);\n  };\n\n  AbstractMatrix.prototype.signPropagatingRightShift = function signPropagatingRightShift(value) {\n    if (typeof value === 'number') return this.signPropagatingRightShiftS(value);\n    return this.signPropagatingRightShiftM(value);\n  };\n\n  AbstractMatrix.prototype.signPropagatingRightShiftS = function signPropagatingRightShiftS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) >> value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.signPropagatingRightShiftM = function signPropagatingRightShiftM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) >> matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.signPropagatingRightShift = function signPropagatingRightShift(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.signPropagatingRightShift(value);\n  };\n\n  AbstractMatrix.prototype.rightShift = function rightShift(value) {\n    if (typeof value === 'number') return this.rightShiftS(value);\n    return this.rightShiftM(value);\n  };\n\n  AbstractMatrix.prototype.rightShiftS = function rightShiftS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) >>> value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.rightShiftM = function rightShiftM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) >>> matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.rightShift = function rightShift(matrix, value) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.rightShift(value);\n  };\n  AbstractMatrix.prototype.zeroFillRightShift = AbstractMatrix.prototype.rightShift;\n  AbstractMatrix.prototype.zeroFillRightShiftS = AbstractMatrix.prototype.rightShiftS;\n  AbstractMatrix.prototype.zeroFillRightShiftM = AbstractMatrix.prototype.rightShiftM;\n  AbstractMatrix.zeroFillRightShift = AbstractMatrix.rightShift;\n\n  AbstractMatrix.prototype.not = function not() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, ~(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.not = function not(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.not();\n  };\n\n  AbstractMatrix.prototype.abs = function abs() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.abs(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.abs = function abs(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.abs();\n  };\n\n  AbstractMatrix.prototype.acos = function acos() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.acos(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.acos = function acos(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.acos();\n  };\n\n  AbstractMatrix.prototype.acosh = function acosh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.acosh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.acosh = function acosh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.acosh();\n  };\n\n  AbstractMatrix.prototype.asin = function asin() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.asin(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.asin = function asin(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.asin();\n  };\n\n  AbstractMatrix.prototype.asinh = function asinh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.asinh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.asinh = function asinh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.asinh();\n  };\n\n  AbstractMatrix.prototype.atan = function atan() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.atan(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.atan = function atan(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.atan();\n  };\n\n  AbstractMatrix.prototype.atanh = function atanh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.atanh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.atanh = function atanh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.atanh();\n  };\n\n  AbstractMatrix.prototype.cbrt = function cbrt() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.cbrt(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.cbrt = function cbrt(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.cbrt();\n  };\n\n  AbstractMatrix.prototype.ceil = function ceil() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.ceil(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.ceil = function ceil(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.ceil();\n  };\n\n  AbstractMatrix.prototype.clz32 = function clz32() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.clz32(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.clz32 = function clz32(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.clz32();\n  };\n\n  AbstractMatrix.prototype.cos = function cos() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.cos(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.cos = function cos(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.cos();\n  };\n\n  AbstractMatrix.prototype.cosh = function cosh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.cosh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.cosh = function cosh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.cosh();\n  };\n\n  AbstractMatrix.prototype.exp = function exp() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.exp(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.exp = function exp(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.exp();\n  };\n\n  AbstractMatrix.prototype.expm1 = function expm1() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.expm1(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.expm1 = function expm1(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.expm1();\n  };\n\n  AbstractMatrix.prototype.floor = function floor() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.floor(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.floor = function floor(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.floor();\n  };\n\n  AbstractMatrix.prototype.fround = function fround() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.fround(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.fround = function fround(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.fround();\n  };\n\n  AbstractMatrix.prototype.log = function log() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.log(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.log = function log(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.log();\n  };\n\n  AbstractMatrix.prototype.log1p = function log1p() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.log1p(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.log1p = function log1p(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.log1p();\n  };\n\n  AbstractMatrix.prototype.log10 = function log10() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.log10(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.log10 = function log10(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.log10();\n  };\n\n  AbstractMatrix.prototype.log2 = function log2() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.log2(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.log2 = function log2(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.log2();\n  };\n\n  AbstractMatrix.prototype.round = function round() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.round(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.round = function round(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.round();\n  };\n\n  AbstractMatrix.prototype.sign = function sign() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.sign(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.sign = function sign(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.sign();\n  };\n\n  AbstractMatrix.prototype.sin = function sin() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.sin(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.sin = function sin(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.sin();\n  };\n\n  AbstractMatrix.prototype.sinh = function sinh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.sinh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.sinh = function sinh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.sinh();\n  };\n\n  AbstractMatrix.prototype.sqrt = function sqrt() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.sqrt(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.sqrt = function sqrt(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.sqrt();\n  };\n\n  AbstractMatrix.prototype.tan = function tan() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.tan(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.tan = function tan(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.tan();\n  };\n\n  AbstractMatrix.prototype.tanh = function tanh() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.tanh(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.tanh = function tanh(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.tanh();\n  };\n\n  AbstractMatrix.prototype.trunc = function trunc() {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, Math.trunc(this.get(i, j)));\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.trunc = function trunc(matrix) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.trunc();\n  };\n\n  AbstractMatrix.pow = function pow(matrix, arg0) {\n    const newMatrix = new Matrix(matrix);\n    return newMatrix.pow(arg0);\n  };\n\n  AbstractMatrix.prototype.pow = function pow(value) {\n    if (typeof value === 'number') return this.powS(value);\n    return this.powM(value);\n  };\n\n  AbstractMatrix.prototype.powS = function powS(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) ** value);\n      }\n    }\n    return this;\n  };\n\n  AbstractMatrix.prototype.powM = function powM(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (this.rows !== matrix.rows ||\n      this.columns !== matrix.columns) {\n      throw new RangeError('Matrices dimensions must be equal');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) ** matrix.get(i, j));\n      }\n    }\n    return this;\n  };\n}\n\n/**\n * @private\n * Check that a row index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkRowIndex(matrix, index, outer) {\n  let max = outer ? matrix.rows : matrix.rows - 1;\n  if (index < 0 || index > max) {\n    throw new RangeError('Row index out of range');\n  }\n}\n\n/**\n * @private\n * Check that a column index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkColumnIndex(matrix, index, outer) {\n  let max = outer ? matrix.columns : matrix.columns - 1;\n  if (index < 0 || index > max) {\n    throw new RangeError('Column index out of range');\n  }\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkRowVector(matrix, vector) {\n  if (vector.to1DArray) {\n    vector = vector.to1DArray();\n  }\n  if (vector.length !== matrix.columns) {\n    throw new RangeError(\n      'vector size must be the same as the number of columns',\n    );\n  }\n  return vector;\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkColumnVector(matrix, vector) {\n  if (vector.to1DArray) {\n    vector = vector.to1DArray();\n  }\n  if (vector.length !== matrix.rows) {\n    throw new RangeError('vector size must be the same as the number of rows');\n  }\n  return vector;\n}\n\nfunction checkRowIndices(matrix, rowIndices) {\n  if (!isAnyArray(rowIndices)) {\n    throw new TypeError('row indices must be an array');\n  }\n\n  for (let i = 0; i < rowIndices.length; i++) {\n    if (rowIndices[i] < 0 || rowIndices[i] >= matrix.rows) {\n      throw new RangeError('row indices are out of range');\n    }\n  }\n}\n\nfunction checkColumnIndices(matrix, columnIndices) {\n  if (!isAnyArray(columnIndices)) {\n    throw new TypeError('column indices must be an array');\n  }\n\n  for (let i = 0; i < columnIndices.length; i++) {\n    if (columnIndices[i] < 0 || columnIndices[i] >= matrix.columns) {\n      throw new RangeError('column indices are out of range');\n    }\n  }\n}\n\nfunction checkRange(matrix, startRow, endRow, startColumn, endColumn) {\n  if (arguments.length !== 5) {\n    throw new RangeError('expected 4 arguments');\n  }\n  checkNumber('startRow', startRow);\n  checkNumber('endRow', endRow);\n  checkNumber('startColumn', startColumn);\n  checkNumber('endColumn', endColumn);\n  if (\n    startRow > endRow ||\n    startColumn > endColumn ||\n    startRow < 0 ||\n    startRow >= matrix.rows ||\n    endRow < 0 ||\n    endRow >= matrix.rows ||\n    startColumn < 0 ||\n    startColumn >= matrix.columns ||\n    endColumn < 0 ||\n    endColumn >= matrix.columns\n  ) {\n    throw new RangeError('Submatrix indices are out of range');\n  }\n}\n\nfunction newArray(length, value = 0) {\n  let array = [];\n  for (let i = 0; i < length; i++) {\n    array.push(value);\n  }\n  return array;\n}\n\nfunction checkNumber(name, value) {\n  if (typeof value !== 'number') {\n    throw new TypeError(`${name} must be a number`);\n  }\n}\n\nfunction checkNonEmpty(matrix) {\n  if (matrix.isEmpty()) {\n    throw new Error('Empty matrix has no elements to index');\n  }\n}\n\nfunction sumByRow(matrix) {\n  let sum = newArray(matrix.rows);\n  for (let i = 0; i < matrix.rows; ++i) {\n    for (let j = 0; j < matrix.columns; ++j) {\n      sum[i] += matrix.get(i, j);\n    }\n  }\n  return sum;\n}\n\nfunction sumByColumn(matrix) {\n  let sum = newArray(matrix.columns);\n  for (let i = 0; i < matrix.rows; ++i) {\n    for (let j = 0; j < matrix.columns; ++j) {\n      sum[j] += matrix.get(i, j);\n    }\n  }\n  return sum;\n}\n\nfunction sumAll(matrix) {\n  let v = 0;\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      v += matrix.get(i, j);\n    }\n  }\n  return v;\n}\n\nfunction productByRow(matrix) {\n  let sum = newArray(matrix.rows, 1);\n  for (let i = 0; i < matrix.rows; ++i) {\n    for (let j = 0; j < matrix.columns; ++j) {\n      sum[i] *= matrix.get(i, j);\n    }\n  }\n  return sum;\n}\n\nfunction productByColumn(matrix) {\n  let sum = newArray(matrix.columns, 1);\n  for (let i = 0; i < matrix.rows; ++i) {\n    for (let j = 0; j < matrix.columns; ++j) {\n      sum[j] *= matrix.get(i, j);\n    }\n  }\n  return sum;\n}\n\nfunction productAll(matrix) {\n  let v = 1;\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      v *= matrix.get(i, j);\n    }\n  }\n  return v;\n}\n\nfunction varianceByRow(matrix, unbiased, mean) {\n  const rows = matrix.rows;\n  const cols = matrix.columns;\n  const variance = [];\n\n  for (let i = 0; i < rows; i++) {\n    let sum1 = 0;\n    let sum2 = 0;\n    let x = 0;\n    for (let j = 0; j < cols; j++) {\n      x = matrix.get(i, j) - mean[i];\n      sum1 += x;\n      sum2 += x * x;\n    }\n    if (unbiased) {\n      variance.push((sum2 - (sum1 * sum1) / cols) / (cols - 1));\n    } else {\n      variance.push((sum2 - (sum1 * sum1) / cols) / cols);\n    }\n  }\n  return variance;\n}\n\nfunction varianceByColumn(matrix, unbiased, mean) {\n  const rows = matrix.rows;\n  const cols = matrix.columns;\n  const variance = [];\n\n  for (let j = 0; j < cols; j++) {\n    let sum1 = 0;\n    let sum2 = 0;\n    let x = 0;\n    for (let i = 0; i < rows; i++) {\n      x = matrix.get(i, j) - mean[j];\n      sum1 += x;\n      sum2 += x * x;\n    }\n    if (unbiased) {\n      variance.push((sum2 - (sum1 * sum1) / rows) / (rows - 1));\n    } else {\n      variance.push((sum2 - (sum1 * sum1) / rows) / rows);\n    }\n  }\n  return variance;\n}\n\nfunction varianceAll(matrix, unbiased, mean) {\n  const rows = matrix.rows;\n  const cols = matrix.columns;\n  const size = rows * cols;\n\n  let sum1 = 0;\n  let sum2 = 0;\n  let x = 0;\n  for (let i = 0; i < rows; i++) {\n    for (let j = 0; j < cols; j++) {\n      x = matrix.get(i, j) - mean;\n      sum1 += x;\n      sum2 += x * x;\n    }\n  }\n  if (unbiased) {\n    return (sum2 - (sum1 * sum1) / size) / (size - 1);\n  } else {\n    return (sum2 - (sum1 * sum1) / size) / size;\n  }\n}\n\nfunction centerByRow(matrix, mean) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) - mean[i]);\n    }\n  }\n}\n\nfunction centerByColumn(matrix, mean) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) - mean[j]);\n    }\n  }\n}\n\nfunction centerAll(matrix, mean) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) - mean);\n    }\n  }\n}\n\nfunction getScaleByRow(matrix) {\n  const scale = [];\n  for (let i = 0; i < matrix.rows; i++) {\n    let sum = 0;\n    for (let j = 0; j < matrix.columns; j++) {\n      sum += matrix.get(i, j) ** 2 / (matrix.columns - 1);\n    }\n    scale.push(Math.sqrt(sum));\n  }\n  return scale;\n}\n\nfunction scaleByRow(matrix, scale) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) / scale[i]);\n    }\n  }\n}\n\nfunction getScaleByColumn(matrix) {\n  const scale = [];\n  for (let j = 0; j < matrix.columns; j++) {\n    let sum = 0;\n    for (let i = 0; i < matrix.rows; i++) {\n      sum += matrix.get(i, j) ** 2 / (matrix.rows - 1);\n    }\n    scale.push(Math.sqrt(sum));\n  }\n  return scale;\n}\n\nfunction scaleByColumn(matrix, scale) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) / scale[j]);\n    }\n  }\n}\n\nfunction getScaleAll(matrix) {\n  const divider = matrix.size - 1;\n  let sum = 0;\n  for (let j = 0; j < matrix.columns; j++) {\n    for (let i = 0; i < matrix.rows; i++) {\n      sum += matrix.get(i, j) ** 2 / divider;\n    }\n  }\n  return Math.sqrt(sum);\n}\n\nfunction scaleAll(matrix, scale) {\n  for (let i = 0; i < matrix.rows; i++) {\n    for (let j = 0; j < matrix.columns; j++) {\n      matrix.set(i, j, matrix.get(i, j) / scale);\n    }\n  }\n}\n\nclass AbstractMatrix {\n  static from1DArray(newRows, newColumns, newData) {\n    let length = newRows * newColumns;\n    if (length !== newData.length) {\n      throw new RangeError('data length does not match given dimensions');\n    }\n    let newMatrix = new Matrix(newRows, newColumns);\n    for (let row = 0; row < newRows; row++) {\n      for (let column = 0; column < newColumns; column++) {\n        newMatrix.set(row, column, newData[row * newColumns + column]);\n      }\n    }\n    return newMatrix;\n  }\n\n  static rowVector(newData) {\n    let vector = new Matrix(1, newData.length);\n    for (let i = 0; i < newData.length; i++) {\n      vector.set(0, i, newData[i]);\n    }\n    return vector;\n  }\n\n  static columnVector(newData) {\n    let vector = new Matrix(newData.length, 1);\n    for (let i = 0; i < newData.length; i++) {\n      vector.set(i, 0, newData[i]);\n    }\n    return vector;\n  }\n\n  static zeros(rows, columns) {\n    return new Matrix(rows, columns);\n  }\n\n  static ones(rows, columns) {\n    return new Matrix(rows, columns).fill(1);\n  }\n\n  static rand(rows, columns, options = {}) {\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { random = Math.random } = options;\n    let matrix = new Matrix(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        matrix.set(i, j, random());\n      }\n    }\n    return matrix;\n  }\n\n  static randInt(rows, columns, options = {}) {\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { min = 0, max = 1000, random = Math.random } = options;\n    if (!Number.isInteger(min)) throw new TypeError('min must be an integer');\n    if (!Number.isInteger(max)) throw new TypeError('max must be an integer');\n    if (min >= max) throw new RangeError('min must be smaller than max');\n    let interval = max - min;\n    let matrix = new Matrix(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        let value = min + Math.round(random() * interval);\n        matrix.set(i, j, value);\n      }\n    }\n    return matrix;\n  }\n\n  static eye(rows, columns, value) {\n    if (columns === undefined) columns = rows;\n    if (value === undefined) value = 1;\n    let min = Math.min(rows, columns);\n    let matrix = this.zeros(rows, columns);\n    for (let i = 0; i < min; i++) {\n      matrix.set(i, i, value);\n    }\n    return matrix;\n  }\n\n  static diag(data, rows, columns) {\n    let l = data.length;\n    if (rows === undefined) rows = l;\n    if (columns === undefined) columns = rows;\n    let min = Math.min(l, rows, columns);\n    let matrix = this.zeros(rows, columns);\n    for (let i = 0; i < min; i++) {\n      matrix.set(i, i, data[i]);\n    }\n    return matrix;\n  }\n\n  static min(matrix1, matrix2) {\n    matrix1 = this.checkMatrix(matrix1);\n    matrix2 = this.checkMatrix(matrix2);\n    let rows = matrix1.rows;\n    let columns = matrix1.columns;\n    let result = new Matrix(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        result.set(i, j, Math.min(matrix1.get(i, j), matrix2.get(i, j)));\n      }\n    }\n    return result;\n  }\n\n  static max(matrix1, matrix2) {\n    matrix1 = this.checkMatrix(matrix1);\n    matrix2 = this.checkMatrix(matrix2);\n    let rows = matrix1.rows;\n    let columns = matrix1.columns;\n    let result = new this(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        result.set(i, j, Math.max(matrix1.get(i, j), matrix2.get(i, j)));\n      }\n    }\n    return result;\n  }\n\n  static checkMatrix(value) {\n    return AbstractMatrix.isMatrix(value) ? value : new Matrix(value);\n  }\n\n  static isMatrix(value) {\n    return value != null && value.klass === 'Matrix';\n  }\n\n  get size() {\n    return this.rows * this.columns;\n  }\n\n  apply(callback) {\n    if (typeof callback !== 'function') {\n      throw new TypeError('callback must be a function');\n    }\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        callback.call(this, i, j);\n      }\n    }\n    return this;\n  }\n\n  to1DArray() {\n    let array = [];\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        array.push(this.get(i, j));\n      }\n    }\n    return array;\n  }\n\n  to2DArray() {\n    let copy = [];\n    for (let i = 0; i < this.rows; i++) {\n      copy.push([]);\n      for (let j = 0; j < this.columns; j++) {\n        copy[i].push(this.get(i, j));\n      }\n    }\n    return copy;\n  }\n\n  toJSON() {\n    return this.to2DArray();\n  }\n\n  isRowVector() {\n    return this.rows === 1;\n  }\n\n  isColumnVector() {\n    return this.columns === 1;\n  }\n\n  isVector() {\n    return this.rows === 1 || this.columns === 1;\n  }\n\n  isSquare() {\n    return this.rows === this.columns;\n  }\n\n  isEmpty() {\n    return this.rows === 0 || this.columns === 0;\n  }\n\n  isSymmetric() {\n    if (this.isSquare()) {\n      for (let i = 0; i < this.rows; i++) {\n        for (let j = 0; j <= i; j++) {\n          if (this.get(i, j) !== this.get(j, i)) {\n            return false;\n          }\n        }\n      }\n      return true;\n    }\n    return false;\n  }\n\n  isDistance() {\n    if (!this.isSymmetric()) return false;\n\n    for (let i = 0; i < this.rows; i++) {\n      if (this.get(i, i) !== 0) return false;\n    }\n\n    return true;\n  }\n\n  isEchelonForm() {\n    let i = 0;\n    let j = 0;\n    let previousColumn = -1;\n    let isEchelonForm = true;\n    let checked = false;\n    while (i < this.rows && isEchelonForm) {\n      j = 0;\n      checked = false;\n      while (j < this.columns && checked === false) {\n        if (this.get(i, j) === 0) {\n          j++;\n        } else if (this.get(i, j) === 1 && j > previousColumn) {\n          checked = true;\n          previousColumn = j;\n        } else {\n          isEchelonForm = false;\n          checked = true;\n        }\n      }\n      i++;\n    }\n    return isEchelonForm;\n  }\n\n  isReducedEchelonForm() {\n    let i = 0;\n    let j = 0;\n    let previousColumn = -1;\n    let isReducedEchelonForm = true;\n    let checked = false;\n    while (i < this.rows && isReducedEchelonForm) {\n      j = 0;\n      checked = false;\n      while (j < this.columns && checked === false) {\n        if (this.get(i, j) === 0) {\n          j++;\n        } else if (this.get(i, j) === 1 && j > previousColumn) {\n          checked = true;\n          previousColumn = j;\n        } else {\n          isReducedEchelonForm = false;\n          checked = true;\n        }\n      }\n      for (let k = j + 1; k < this.rows; k++) {\n        if (this.get(i, k) !== 0) {\n          isReducedEchelonForm = false;\n        }\n      }\n      i++;\n    }\n    return isReducedEchelonForm;\n  }\n\n  echelonForm() {\n    let result = this.clone();\n    let h = 0;\n    let k = 0;\n    while (h < result.rows && k < result.columns) {\n      let iMax = h;\n      for (let i = h; i < result.rows; i++) {\n        if (result.get(i, k) > result.get(iMax, k)) {\n          iMax = i;\n        }\n      }\n      if (result.get(iMax, k) === 0) {\n        k++;\n      } else {\n        result.swapRows(h, iMax);\n        let tmp = result.get(h, k);\n        for (let j = k; j < result.columns; j++) {\n          result.set(h, j, result.get(h, j) / tmp);\n        }\n        for (let i = h + 1; i < result.rows; i++) {\n          let factor = result.get(i, k) / result.get(h, k);\n          result.set(i, k, 0);\n          for (let j = k + 1; j < result.columns; j++) {\n            result.set(i, j, result.get(i, j) - result.get(h, j) * factor);\n          }\n        }\n        h++;\n        k++;\n      }\n    }\n    return result;\n  }\n\n  reducedEchelonForm() {\n    let result = this.echelonForm();\n    let m = result.columns;\n    let n = result.rows;\n    let h = n - 1;\n    while (h >= 0) {\n      if (result.maxRow(h) === 0) {\n        h--;\n      } else {\n        let p = 0;\n        let pivot = false;\n        while (p < n && pivot === false) {\n          if (result.get(h, p) === 1) {\n            pivot = true;\n          } else {\n            p++;\n          }\n        }\n        for (let i = 0; i < h; i++) {\n          let factor = result.get(i, p);\n          for (let j = p; j < m; j++) {\n            let tmp = result.get(i, j) - factor * result.get(h, j);\n            result.set(i, j, tmp);\n          }\n        }\n        h--;\n      }\n    }\n    return result;\n  }\n\n  set() {\n    throw new Error('set method is unimplemented');\n  }\n\n  get() {\n    throw new Error('get method is unimplemented');\n  }\n\n  repeat(options = {}) {\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { rows = 1, columns = 1 } = options;\n    if (!Number.isInteger(rows) || rows <= 0) {\n      throw new TypeError('rows must be a positive integer');\n    }\n    if (!Number.isInteger(columns) || columns <= 0) {\n      throw new TypeError('columns must be a positive integer');\n    }\n    let matrix = new Matrix(this.rows * rows, this.columns * columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        matrix.setSubMatrix(this, this.rows * i, this.columns * j);\n      }\n    }\n    return matrix;\n  }\n\n  fill(value) {\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, value);\n      }\n    }\n    return this;\n  }\n\n  neg() {\n    return this.mulS(-1);\n  }\n\n  getRow(index) {\n    checkRowIndex(this, index);\n    let row = [];\n    for (let i = 0; i < this.columns; i++) {\n      row.push(this.get(index, i));\n    }\n    return row;\n  }\n\n  getRowVector(index) {\n    return Matrix.rowVector(this.getRow(index));\n  }\n\n  setRow(index, array) {\n    checkRowIndex(this, index);\n    array = checkRowVector(this, array);\n    for (let i = 0; i < this.columns; i++) {\n      this.set(index, i, array[i]);\n    }\n    return this;\n  }\n\n  swapRows(row1, row2) {\n    checkRowIndex(this, row1);\n    checkRowIndex(this, row2);\n    for (let i = 0; i < this.columns; i++) {\n      let temp = this.get(row1, i);\n      this.set(row1, i, this.get(row2, i));\n      this.set(row2, i, temp);\n    }\n    return this;\n  }\n\n  getColumn(index) {\n    checkColumnIndex(this, index);\n    let column = [];\n    for (let i = 0; i < this.rows; i++) {\n      column.push(this.get(i, index));\n    }\n    return column;\n  }\n\n  getColumnVector(index) {\n    return Matrix.columnVector(this.getColumn(index));\n  }\n\n  setColumn(index, array) {\n    checkColumnIndex(this, index);\n    array = checkColumnVector(this, array);\n    for (let i = 0; i < this.rows; i++) {\n      this.set(i, index, array[i]);\n    }\n    return this;\n  }\n\n  swapColumns(column1, column2) {\n    checkColumnIndex(this, column1);\n    checkColumnIndex(this, column2);\n    for (let i = 0; i < this.rows; i++) {\n      let temp = this.get(i, column1);\n      this.set(i, column1, this.get(i, column2));\n      this.set(i, column2, temp);\n    }\n    return this;\n  }\n\n  addRowVector(vector) {\n    vector = checkRowVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) + vector[j]);\n      }\n    }\n    return this;\n  }\n\n  subRowVector(vector) {\n    vector = checkRowVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) - vector[j]);\n      }\n    }\n    return this;\n  }\n\n  mulRowVector(vector) {\n    vector = checkRowVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) * vector[j]);\n      }\n    }\n    return this;\n  }\n\n  divRowVector(vector) {\n    vector = checkRowVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) / vector[j]);\n      }\n    }\n    return this;\n  }\n\n  addColumnVector(vector) {\n    vector = checkColumnVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) + vector[i]);\n      }\n    }\n    return this;\n  }\n\n  subColumnVector(vector) {\n    vector = checkColumnVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) - vector[i]);\n      }\n    }\n    return this;\n  }\n\n  mulColumnVector(vector) {\n    vector = checkColumnVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) * vector[i]);\n      }\n    }\n    return this;\n  }\n\n  divColumnVector(vector) {\n    vector = checkColumnVector(this, vector);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        this.set(i, j, this.get(i, j) / vector[i]);\n      }\n    }\n    return this;\n  }\n\n  mulRow(index, value) {\n    checkRowIndex(this, index);\n    for (let i = 0; i < this.columns; i++) {\n      this.set(index, i, this.get(index, i) * value);\n    }\n    return this;\n  }\n\n  mulColumn(index, value) {\n    checkColumnIndex(this, index);\n    for (let i = 0; i < this.rows; i++) {\n      this.set(i, index, this.get(i, index) * value);\n    }\n    return this;\n  }\n\n  max(by) {\n    if (this.isEmpty()) {\n      return NaN;\n    }\n    switch (by) {\n      case 'row': {\n        const max = new Array(this.rows).fill(Number.NEGATIVE_INFINITY);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) > max[row]) {\n              max[row] = this.get(row, column);\n            }\n          }\n        }\n        return max;\n      }\n      case 'column': {\n        const max = new Array(this.columns).fill(Number.NEGATIVE_INFINITY);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) > max[column]) {\n              max[column] = this.get(row, column);\n            }\n          }\n        }\n        return max;\n      }\n      case undefined: {\n        let max = this.get(0, 0);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) > max) {\n              max = this.get(row, column);\n            }\n          }\n        }\n        return max;\n      }\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  maxIndex() {\n    checkNonEmpty(this);\n    let v = this.get(0, 0);\n    let idx = [0, 0];\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        if (this.get(i, j) > v) {\n          v = this.get(i, j);\n          idx[0] = i;\n          idx[1] = j;\n        }\n      }\n    }\n    return idx;\n  }\n\n  min(by) {\n    if (this.isEmpty()) {\n      return NaN;\n    }\n\n    switch (by) {\n      case 'row': {\n        const min = new Array(this.rows).fill(Number.POSITIVE_INFINITY);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) < min[row]) {\n              min[row] = this.get(row, column);\n            }\n          }\n        }\n        return min;\n      }\n      case 'column': {\n        const min = new Array(this.columns).fill(Number.POSITIVE_INFINITY);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) < min[column]) {\n              min[column] = this.get(row, column);\n            }\n          }\n        }\n        return min;\n      }\n      case undefined: {\n        let min = this.get(0, 0);\n        for (let row = 0; row < this.rows; row++) {\n          for (let column = 0; column < this.columns; column++) {\n            if (this.get(row, column) < min) {\n              min = this.get(row, column);\n            }\n          }\n        }\n        return min;\n      }\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  minIndex() {\n    checkNonEmpty(this);\n    let v = this.get(0, 0);\n    let idx = [0, 0];\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        if (this.get(i, j) < v) {\n          v = this.get(i, j);\n          idx[0] = i;\n          idx[1] = j;\n        }\n      }\n    }\n    return idx;\n  }\n\n  maxRow(row) {\n    checkRowIndex(this, row);\n    if (this.isEmpty()) {\n      return NaN;\n    }\n    let v = this.get(row, 0);\n    for (let i = 1; i < this.columns; i++) {\n      if (this.get(row, i) > v) {\n        v = this.get(row, i);\n      }\n    }\n    return v;\n  }\n\n  maxRowIndex(row) {\n    checkRowIndex(this, row);\n    checkNonEmpty(this);\n    let v = this.get(row, 0);\n    let idx = [row, 0];\n    for (let i = 1; i < this.columns; i++) {\n      if (this.get(row, i) > v) {\n        v = this.get(row, i);\n        idx[1] = i;\n      }\n    }\n    return idx;\n  }\n\n  minRow(row) {\n    checkRowIndex(this, row);\n    if (this.isEmpty()) {\n      return NaN;\n    }\n    let v = this.get(row, 0);\n    for (let i = 1; i < this.columns; i++) {\n      if (this.get(row, i) < v) {\n        v = this.get(row, i);\n      }\n    }\n    return v;\n  }\n\n  minRowIndex(row) {\n    checkRowIndex(this, row);\n    checkNonEmpty(this);\n    let v = this.get(row, 0);\n    let idx = [row, 0];\n    for (let i = 1; i < this.columns; i++) {\n      if (this.get(row, i) < v) {\n        v = this.get(row, i);\n        idx[1] = i;\n      }\n    }\n    return idx;\n  }\n\n  maxColumn(column) {\n    checkColumnIndex(this, column);\n    if (this.isEmpty()) {\n      return NaN;\n    }\n    let v = this.get(0, column);\n    for (let i = 1; i < this.rows; i++) {\n      if (this.get(i, column) > v) {\n        v = this.get(i, column);\n      }\n    }\n    return v;\n  }\n\n  maxColumnIndex(column) {\n    checkColumnIndex(this, column);\n    checkNonEmpty(this);\n    let v = this.get(0, column);\n    let idx = [0, column];\n    for (let i = 1; i < this.rows; i++) {\n      if (this.get(i, column) > v) {\n        v = this.get(i, column);\n        idx[0] = i;\n      }\n    }\n    return idx;\n  }\n\n  minColumn(column) {\n    checkColumnIndex(this, column);\n    if (this.isEmpty()) {\n      return NaN;\n    }\n    let v = this.get(0, column);\n    for (let i = 1; i < this.rows; i++) {\n      if (this.get(i, column) < v) {\n        v = this.get(i, column);\n      }\n    }\n    return v;\n  }\n\n  minColumnIndex(column) {\n    checkColumnIndex(this, column);\n    checkNonEmpty(this);\n    let v = this.get(0, column);\n    let idx = [0, column];\n    for (let i = 1; i < this.rows; i++) {\n      if (this.get(i, column) < v) {\n        v = this.get(i, column);\n        idx[0] = i;\n      }\n    }\n    return idx;\n  }\n\n  diag() {\n    let min = Math.min(this.rows, this.columns);\n    let diag = [];\n    for (let i = 0; i < min; i++) {\n      diag.push(this.get(i, i));\n    }\n    return diag;\n  }\n\n  norm(type = 'frobenius') {\n    switch (type) {\n      case 'max':\n        return this.max();\n      case 'frobenius':\n        return Math.sqrt(this.dot(this));\n      default:\n        throw new RangeError(`unknown norm type: ${type}`);\n    }\n  }\n\n  cumulativeSum() {\n    let sum = 0;\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        sum += this.get(i, j);\n        this.set(i, j, sum);\n      }\n    }\n    return this;\n  }\n\n  dot(vector2) {\n    if (AbstractMatrix.isMatrix(vector2)) vector2 = vector2.to1DArray();\n    let vector1 = this.to1DArray();\n    if (vector1.length !== vector2.length) {\n      throw new RangeError('vectors do not have the same size');\n    }\n    let dot = 0;\n    for (let i = 0; i < vector1.length; i++) {\n      dot += vector1[i] * vector2[i];\n    }\n    return dot;\n  }\n\n  mmul(other) {\n    other = Matrix.checkMatrix(other);\n\n    let m = this.rows;\n    let n = this.columns;\n    let p = other.columns;\n\n    let result = new Matrix(m, p);\n\n    let Bcolj = new Float64Array(n);\n    for (let j = 0; j < p; j++) {\n      for (let k = 0; k < n; k++) {\n        Bcolj[k] = other.get(k, j);\n      }\n\n      for (let i = 0; i < m; i++) {\n        let s = 0;\n        for (let k = 0; k < n; k++) {\n          s += this.get(i, k) * Bcolj[k];\n        }\n\n        result.set(i, j, s);\n      }\n    }\n    return result;\n  }\n\n  mpow(scalar) {\n    if (!this.isSquare()) {\n      throw new RangeError('Matrix must be square');\n    }\n    if (!Number.isInteger(scalar) || scalar < 0) {\n      throw new RangeError('Exponent must be a non-negative integer');\n    }\n    // Russian Peasant exponentiation, i.e. exponentiation by squaring\n    let result = Matrix.eye(this.rows);\n    let bb = this;\n    // Note: Don't bit shift. In JS, that would truncate at 32 bits\n    for (let e = scalar; e >= 1; e /= 2) {\n      if ((e & 1) !== 0) {\n        result = result.mmul(bb);\n      }\n      bb = bb.mmul(bb);\n    }\n    return result;\n  }\n\n  strassen2x2(other) {\n    other = Matrix.checkMatrix(other);\n    let result = new Matrix(2, 2);\n    const a11 = this.get(0, 0);\n    const b11 = other.get(0, 0);\n    const a12 = this.get(0, 1);\n    const b12 = other.get(0, 1);\n    const a21 = this.get(1, 0);\n    const b21 = other.get(1, 0);\n    const a22 = this.get(1, 1);\n    const b22 = other.get(1, 1);\n\n    // Compute intermediate values.\n    const m1 = (a11 + a22) * (b11 + b22);\n    const m2 = (a21 + a22) * b11;\n    const m3 = a11 * (b12 - b22);\n    const m4 = a22 * (b21 - b11);\n    const m5 = (a11 + a12) * b22;\n    const m6 = (a21 - a11) * (b11 + b12);\n    const m7 = (a12 - a22) * (b21 + b22);\n\n    // Combine intermediate values into the output.\n    const c00 = m1 + m4 - m5 + m7;\n    const c01 = m3 + m5;\n    const c10 = m2 + m4;\n    const c11 = m1 - m2 + m3 + m6;\n\n    result.set(0, 0, c00);\n    result.set(0, 1, c01);\n    result.set(1, 0, c10);\n    result.set(1, 1, c11);\n    return result;\n  }\n\n  strassen3x3(other) {\n    other = Matrix.checkMatrix(other);\n    let result = new Matrix(3, 3);\n\n    const a00 = this.get(0, 0);\n    const a01 = this.get(0, 1);\n    const a02 = this.get(0, 2);\n    const a10 = this.get(1, 0);\n    const a11 = this.get(1, 1);\n    const a12 = this.get(1, 2);\n    const a20 = this.get(2, 0);\n    const a21 = this.get(2, 1);\n    const a22 = this.get(2, 2);\n\n    const b00 = other.get(0, 0);\n    const b01 = other.get(0, 1);\n    const b02 = other.get(0, 2);\n    const b10 = other.get(1, 0);\n    const b11 = other.get(1, 1);\n    const b12 = other.get(1, 2);\n    const b20 = other.get(2, 0);\n    const b21 = other.get(2, 1);\n    const b22 = other.get(2, 2);\n\n    const m1 = (a00 + a01 + a02 - a10 - a11 - a21 - a22) * b11;\n    const m2 = (a00 - a10) * (-b01 + b11);\n    const m3 = a11 * (-b00 + b01 + b10 - b11 - b12 - b20 + b22);\n    const m4 = (-a00 + a10 + a11) * (b00 - b01 + b11);\n    const m5 = (a10 + a11) * (-b00 + b01);\n    const m6 = a00 * b00;\n    const m7 = (-a00 + a20 + a21) * (b00 - b02 + b12);\n    const m8 = (-a00 + a20) * (b02 - b12);\n    const m9 = (a20 + a21) * (-b00 + b02);\n    const m10 = (a00 + a01 + a02 - a11 - a12 - a20 - a21) * b12;\n    const m11 = a21 * (-b00 + b02 + b10 - b11 - b12 - b20 + b21);\n    const m12 = (-a02 + a21 + a22) * (b11 + b20 - b21);\n    const m13 = (a02 - a22) * (b11 - b21);\n    const m14 = a02 * b20;\n    const m15 = (a21 + a22) * (-b20 + b21);\n    const m16 = (-a02 + a11 + a12) * (b12 + b20 - b22);\n    const m17 = (a02 - a12) * (b12 - b22);\n    const m18 = (a11 + a12) * (-b20 + b22);\n    const m19 = a01 * b10;\n    const m20 = a12 * b21;\n    const m21 = a10 * b02;\n    const m22 = a20 * b01;\n    const m23 = a22 * b22;\n\n    const c00 = m6 + m14 + m19;\n    const c01 = m1 + m4 + m5 + m6 + m12 + m14 + m15;\n    const c02 = m6 + m7 + m9 + m10 + m14 + m16 + m18;\n    const c10 = m2 + m3 + m4 + m6 + m14 + m16 + m17;\n    const c11 = m2 + m4 + m5 + m6 + m20;\n    const c12 = m14 + m16 + m17 + m18 + m21;\n    const c20 = m6 + m7 + m8 + m11 + m12 + m13 + m14;\n    const c21 = m12 + m13 + m14 + m15 + m22;\n    const c22 = m6 + m7 + m8 + m9 + m23;\n\n    result.set(0, 0, c00);\n    result.set(0, 1, c01);\n    result.set(0, 2, c02);\n    result.set(1, 0, c10);\n    result.set(1, 1, c11);\n    result.set(1, 2, c12);\n    result.set(2, 0, c20);\n    result.set(2, 1, c21);\n    result.set(2, 2, c22);\n    return result;\n  }\n\n  mmulStrassen(y) {\n    y = Matrix.checkMatrix(y);\n    let x = this.clone();\n    let r1 = x.rows;\n    let c1 = x.columns;\n    let r2 = y.rows;\n    let c2 = y.columns;\n    if (c1 !== r2) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        `Multiplying ${r1} x ${c1} and ${r2} x ${c2} matrix: dimensions do not match.`,\n      );\n    }\n\n    // Put a matrix into the top left of a matrix of zeros.\n    // `rows` and `cols` are the dimensions of the output matrix.\n    function embed(mat, rows, cols) {\n      let r = mat.rows;\n      let c = mat.columns;\n      if (r === rows && c === cols) {\n        return mat;\n      } else {\n        let resultat = AbstractMatrix.zeros(rows, cols);\n        resultat = resultat.setSubMatrix(mat, 0, 0);\n        return resultat;\n      }\n    }\n\n    // Make sure both matrices are the same size.\n    // This is exclusively for simplicity:\n    // this algorithm can be implemented with matrices of different sizes.\n\n    let r = Math.max(r1, r2);\n    let c = Math.max(c1, c2);\n    x = embed(x, r, c);\n    y = embed(y, r, c);\n\n    // Our recursive multiplication function.\n    function blockMult(a, b, rows, cols) {\n      // For small matrices, resort to naive multiplication.\n      if (rows <= 512 || cols <= 512) {\n        return a.mmul(b); // a is equivalent to this\n      }\n\n      // Apply dynamic padding.\n      if (rows % 2 === 1 && cols % 2 === 1) {\n        a = embed(a, rows + 1, cols + 1);\n        b = embed(b, rows + 1, cols + 1);\n      } else if (rows % 2 === 1) {\n        a = embed(a, rows + 1, cols);\n        b = embed(b, rows + 1, cols);\n      } else if (cols % 2 === 1) {\n        a = embed(a, rows, cols + 1);\n        b = embed(b, rows, cols + 1);\n      }\n\n      let halfRows = parseInt(a.rows / 2, 10);\n      let halfCols = parseInt(a.columns / 2, 10);\n      // Subdivide input matrices.\n      let a11 = a.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n      let b11 = b.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n\n      let a12 = a.subMatrix(0, halfRows - 1, halfCols, a.columns - 1);\n      let b12 = b.subMatrix(0, halfRows - 1, halfCols, b.columns - 1);\n\n      let a21 = a.subMatrix(halfRows, a.rows - 1, 0, halfCols - 1);\n      let b21 = b.subMatrix(halfRows, b.rows - 1, 0, halfCols - 1);\n\n      let a22 = a.subMatrix(halfRows, a.rows - 1, halfCols, a.columns - 1);\n      let b22 = b.subMatrix(halfRows, b.rows - 1, halfCols, b.columns - 1);\n\n      // Compute intermediate values.\n      let m1 = blockMult(\n        AbstractMatrix.add(a11, a22),\n        AbstractMatrix.add(b11, b22),\n        halfRows,\n        halfCols,\n      );\n      let m2 = blockMult(AbstractMatrix.add(a21, a22), b11, halfRows, halfCols);\n      let m3 = blockMult(a11, AbstractMatrix.sub(b12, b22), halfRows, halfCols);\n      let m4 = blockMult(a22, AbstractMatrix.sub(b21, b11), halfRows, halfCols);\n      let m5 = blockMult(AbstractMatrix.add(a11, a12), b22, halfRows, halfCols);\n      let m6 = blockMult(\n        AbstractMatrix.sub(a21, a11),\n        AbstractMatrix.add(b11, b12),\n        halfRows,\n        halfCols,\n      );\n      let m7 = blockMult(\n        AbstractMatrix.sub(a12, a22),\n        AbstractMatrix.add(b21, b22),\n        halfRows,\n        halfCols,\n      );\n\n      // Combine intermediate values into the output.\n      let c11 = AbstractMatrix.add(m1, m4);\n      c11.sub(m5);\n      c11.add(m7);\n      let c12 = AbstractMatrix.add(m3, m5);\n      let c21 = AbstractMatrix.add(m2, m4);\n      let c22 = AbstractMatrix.sub(m1, m2);\n      c22.add(m3);\n      c22.add(m6);\n\n      // Crop output to the desired size (undo dynamic padding).\n      let result = AbstractMatrix.zeros(2 * c11.rows, 2 * c11.columns);\n      result = result.setSubMatrix(c11, 0, 0);\n      result = result.setSubMatrix(c12, c11.rows, 0);\n      result = result.setSubMatrix(c21, 0, c11.columns);\n      result = result.setSubMatrix(c22, c11.rows, c11.columns);\n      return result.subMatrix(0, rows - 1, 0, cols - 1);\n    }\n\n    return blockMult(x, y, r, c);\n  }\n\n  scaleRows(options = {}) {\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { min = 0, max = 1 } = options;\n    if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n    if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n    if (min >= max) throw new RangeError('min must be smaller than max');\n    let newMatrix = new Matrix(this.rows, this.columns);\n    for (let i = 0; i < this.rows; i++) {\n      const row = this.getRow(i);\n      if (row.length > 0) {\n        rescale(row, { min, max, output: row });\n      }\n      newMatrix.setRow(i, row);\n    }\n    return newMatrix;\n  }\n\n  scaleColumns(options = {}) {\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { min = 0, max = 1 } = options;\n    if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n    if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n    if (min >= max) throw new RangeError('min must be smaller than max');\n    let newMatrix = new Matrix(this.rows, this.columns);\n    for (let i = 0; i < this.columns; i++) {\n      const column = this.getColumn(i);\n      if (column.length) {\n        rescale(column, {\n          min,\n          max,\n          output: column,\n        });\n      }\n      newMatrix.setColumn(i, column);\n    }\n    return newMatrix;\n  }\n\n  flipRows() {\n    const middle = Math.ceil(this.columns / 2);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < middle; j++) {\n        let first = this.get(i, j);\n        let last = this.get(i, this.columns - 1 - j);\n        this.set(i, j, last);\n        this.set(i, this.columns - 1 - j, first);\n      }\n    }\n    return this;\n  }\n\n  flipColumns() {\n    const middle = Math.ceil(this.rows / 2);\n    for (let j = 0; j < this.columns; j++) {\n      for (let i = 0; i < middle; i++) {\n        let first = this.get(i, j);\n        let last = this.get(this.rows - 1 - i, j);\n        this.set(i, j, last);\n        this.set(this.rows - 1 - i, j, first);\n      }\n    }\n    return this;\n  }\n\n  kroneckerProduct(other) {\n    other = Matrix.checkMatrix(other);\n\n    let m = this.rows;\n    let n = this.columns;\n    let p = other.rows;\n    let q = other.columns;\n\n    let result = new Matrix(m * p, n * q);\n    for (let i = 0; i < m; i++) {\n      for (let j = 0; j < n; j++) {\n        for (let k = 0; k < p; k++) {\n          for (let l = 0; l < q; l++) {\n            result.set(p * i + k, q * j + l, this.get(i, j) * other.get(k, l));\n          }\n        }\n      }\n    }\n    return result;\n  }\n\n  kroneckerSum(other) {\n    other = Matrix.checkMatrix(other);\n    if (!this.isSquare() || !other.isSquare()) {\n      throw new Error('Kronecker Sum needs two Square Matrices');\n    }\n    let m = this.rows;\n    let n = other.rows;\n    let AxI = this.kroneckerProduct(Matrix.eye(n, n));\n    let IxB = Matrix.eye(m, m).kroneckerProduct(other);\n    return AxI.add(IxB);\n  }\n\n  transpose() {\n    let result = new Matrix(this.columns, this.rows);\n    for (let i = 0; i < this.rows; i++) {\n      for (let j = 0; j < this.columns; j++) {\n        result.set(j, i, this.get(i, j));\n      }\n    }\n    return result;\n  }\n\n  sortRows(compareFunction = compareNumbers) {\n    for (let i = 0; i < this.rows; i++) {\n      this.setRow(i, this.getRow(i).sort(compareFunction));\n    }\n    return this;\n  }\n\n  sortColumns(compareFunction = compareNumbers) {\n    for (let i = 0; i < this.columns; i++) {\n      this.setColumn(i, this.getColumn(i).sort(compareFunction));\n    }\n    return this;\n  }\n\n  subMatrix(startRow, endRow, startColumn, endColumn) {\n    checkRange(this, startRow, endRow, startColumn, endColumn);\n    let newMatrix = new Matrix(\n      endRow - startRow + 1,\n      endColumn - startColumn + 1,\n    );\n    for (let i = startRow; i <= endRow; i++) {\n      for (let j = startColumn; j <= endColumn; j++) {\n        newMatrix.set(i - startRow, j - startColumn, this.get(i, j));\n      }\n    }\n    return newMatrix;\n  }\n\n  subMatrixRow(indices, startColumn, endColumn) {\n    if (startColumn === undefined) startColumn = 0;\n    if (endColumn === undefined) endColumn = this.columns - 1;\n    if (\n      startColumn > endColumn ||\n      startColumn < 0 ||\n      startColumn >= this.columns ||\n      endColumn < 0 ||\n      endColumn >= this.columns\n    ) {\n      throw new RangeError('Argument out of range');\n    }\n\n    let newMatrix = new Matrix(indices.length, endColumn - startColumn + 1);\n    for (let i = 0; i < indices.length; i++) {\n      for (let j = startColumn; j <= endColumn; j++) {\n        if (indices[i] < 0 || indices[i] >= this.rows) {\n          throw new RangeError(`Row index out of range: ${indices[i]}`);\n        }\n        newMatrix.set(i, j - startColumn, this.get(indices[i], j));\n      }\n    }\n    return newMatrix;\n  }\n\n  subMatrixColumn(indices, startRow, endRow) {\n    if (startRow === undefined) startRow = 0;\n    if (endRow === undefined) endRow = this.rows - 1;\n    if (\n      startRow > endRow ||\n      startRow < 0 ||\n      startRow >= this.rows ||\n      endRow < 0 ||\n      endRow >= this.rows\n    ) {\n      throw new RangeError('Argument out of range');\n    }\n\n    let newMatrix = new Matrix(endRow - startRow + 1, indices.length);\n    for (let i = 0; i < indices.length; i++) {\n      for (let j = startRow; j <= endRow; j++) {\n        if (indices[i] < 0 || indices[i] >= this.columns) {\n          throw new RangeError(`Column index out of range: ${indices[i]}`);\n        }\n        newMatrix.set(j - startRow, i, this.get(j, indices[i]));\n      }\n    }\n    return newMatrix;\n  }\n\n  setSubMatrix(matrix, startRow, startColumn) {\n    matrix = Matrix.checkMatrix(matrix);\n    if (matrix.isEmpty()) {\n      return this;\n    }\n    let endRow = startRow + matrix.rows - 1;\n    let endColumn = startColumn + matrix.columns - 1;\n    checkRange(this, startRow, endRow, startColumn, endColumn);\n    for (let i = 0; i < matrix.rows; i++) {\n      for (let j = 0; j < matrix.columns; j++) {\n        this.set(startRow + i, startColumn + j, matrix.get(i, j));\n      }\n    }\n    return this;\n  }\n\n  selection(rowIndices, columnIndices) {\n    checkRowIndices(this, rowIndices);\n    checkColumnIndices(this, columnIndices);\n    let newMatrix = new Matrix(rowIndices.length, columnIndices.length);\n    for (let i = 0; i < rowIndices.length; i++) {\n      let rowIndex = rowIndices[i];\n      for (let j = 0; j < columnIndices.length; j++) {\n        let columnIndex = columnIndices[j];\n        newMatrix.set(i, j, this.get(rowIndex, columnIndex));\n      }\n    }\n    return newMatrix;\n  }\n\n  trace() {\n    let min = Math.min(this.rows, this.columns);\n    let trace = 0;\n    for (let i = 0; i < min; i++) {\n      trace += this.get(i, i);\n    }\n    return trace;\n  }\n\n  clone() {\n    return this.constructor.copy(this, new Matrix(this.rows, this.columns));\n  }\n\n  /**\n   * @template {AbstractMatrix} M\n   * @param {AbstractMatrix} from\n   * @param {M} to\n   * @return {M}\n   */\n  static copy(from, to) {\n    for (const [row, column, value] of from.entries()) {\n      to.set(row, column, value);\n    }\n\n    return to;\n  }\n\n  sum(by) {\n    switch (by) {\n      case 'row':\n        return sumByRow(this);\n      case 'column':\n        return sumByColumn(this);\n      case undefined:\n        return sumAll(this);\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  product(by) {\n    switch (by) {\n      case 'row':\n        return productByRow(this);\n      case 'column':\n        return productByColumn(this);\n      case undefined:\n        return productAll(this);\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  mean(by) {\n    const sum = this.sum(by);\n    switch (by) {\n      case 'row': {\n        for (let i = 0; i < this.rows; i++) {\n          sum[i] /= this.columns;\n        }\n        return sum;\n      }\n      case 'column': {\n        for (let i = 0; i < this.columns; i++) {\n          sum[i] /= this.rows;\n        }\n        return sum;\n      }\n      case undefined:\n        return sum / this.size;\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  variance(by, options = {}) {\n    if (typeof by === 'object') {\n      options = by;\n      by = undefined;\n    }\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { unbiased = true, mean = this.mean(by) } = options;\n    if (typeof unbiased !== 'boolean') {\n      throw new TypeError('unbiased must be a boolean');\n    }\n    switch (by) {\n      case 'row': {\n        if (!isAnyArray(mean)) {\n          throw new TypeError('mean must be an array');\n        }\n        return varianceByRow(this, unbiased, mean);\n      }\n      case 'column': {\n        if (!isAnyArray(mean)) {\n          throw new TypeError('mean must be an array');\n        }\n        return varianceByColumn(this, unbiased, mean);\n      }\n      case undefined: {\n        if (typeof mean !== 'number') {\n          throw new TypeError('mean must be a number');\n        }\n        return varianceAll(this, unbiased, mean);\n      }\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  standardDeviation(by, options) {\n    if (typeof by === 'object') {\n      options = by;\n      by = undefined;\n    }\n    const variance = this.variance(by, options);\n    if (by === undefined) {\n      return Math.sqrt(variance);\n    } else {\n      for (let i = 0; i < variance.length; i++) {\n        variance[i] = Math.sqrt(variance[i]);\n      }\n      return variance;\n    }\n  }\n\n  center(by, options = {}) {\n    if (typeof by === 'object') {\n      options = by;\n      by = undefined;\n    }\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    const { center = this.mean(by) } = options;\n    switch (by) {\n      case 'row': {\n        if (!isAnyArray(center)) {\n          throw new TypeError('center must be an array');\n        }\n        centerByRow(this, center);\n        return this;\n      }\n      case 'column': {\n        if (!isAnyArray(center)) {\n          throw new TypeError('center must be an array');\n        }\n        centerByColumn(this, center);\n        return this;\n      }\n      case undefined: {\n        if (typeof center !== 'number') {\n          throw new TypeError('center must be a number');\n        }\n        centerAll(this, center);\n        return this;\n      }\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  scale(by, options = {}) {\n    if (typeof by === 'object') {\n      options = by;\n      by = undefined;\n    }\n    if (typeof options !== 'object') {\n      throw new TypeError('options must be an object');\n    }\n    let scale = options.scale;\n    switch (by) {\n      case 'row': {\n        if (scale === undefined) {\n          scale = getScaleByRow(this);\n        } else if (!isAnyArray(scale)) {\n          throw new TypeError('scale must be an array');\n        }\n        scaleByRow(this, scale);\n        return this;\n      }\n      case 'column': {\n        if (scale === undefined) {\n          scale = getScaleByColumn(this);\n        } else if (!isAnyArray(scale)) {\n          throw new TypeError('scale must be an array');\n        }\n        scaleByColumn(this, scale);\n        return this;\n      }\n      case undefined: {\n        if (scale === undefined) {\n          scale = getScaleAll(this);\n        } else if (typeof scale !== 'number') {\n          throw new TypeError('scale must be a number');\n        }\n        scaleAll(this, scale);\n        return this;\n      }\n      default:\n        throw new Error(`invalid option: ${by}`);\n    }\n  }\n\n  toString(options) {\n    return inspectMatrixWithOptions(this, options);\n  }\n\n  [Symbol.iterator]() {\n    return this.entries();\n  }\n\n  /**\n   * iterator from left to right, from top to bottom\n   * yield [row, column, value]\n   * @returns {Generator<[number, number, number], void, void>}\n   */\n  *entries() {\n    for (let row = 0; row < this.rows; row++) {\n      for (let col = 0; col < this.columns; col++) {\n        yield [row, col, this.get(row, col)];\n      }\n    }\n  }\n\n  /**\n   * iterator from left to right, from top to bottom\n   * yield value\n   * @returns {Generator<number, void, void>}\n   */\n  *values() {\n    for (let row = 0; row < this.rows; row++) {\n      for (let col = 0; col < this.columns; col++) {\n        yield this.get(row, col);\n      }\n    }\n  }\n}\n\nAbstractMatrix.prototype.klass = 'Matrix';\nif (typeof Symbol !== 'undefined') {\n  AbstractMatrix.prototype[Symbol.for('nodejs.util.inspect.custom')] =\n    inspectMatrix;\n}\n\nfunction compareNumbers(a, b) {\n  return a - b;\n}\n\nfunction isArrayOfNumbers(array) {\n  return array.every((element) => {\n    return typeof element === 'number';\n  });\n}\n\n// Synonyms\nAbstractMatrix.random = AbstractMatrix.rand;\nAbstractMatrix.randomInt = AbstractMatrix.randInt;\nAbstractMatrix.diagonal = AbstractMatrix.diag;\nAbstractMatrix.prototype.diagonal = AbstractMatrix.prototype.diag;\nAbstractMatrix.identity = AbstractMatrix.eye;\nAbstractMatrix.prototype.negate = AbstractMatrix.prototype.neg;\nAbstractMatrix.prototype.tensorProduct =\n  AbstractMatrix.prototype.kroneckerProduct;\n\nclass Matrix extends AbstractMatrix {\n  /**\n   * @type {Float64Array[]}\n   */\n  data;\n\n  /**\n   * Init an empty matrix\n   * @param {number} nRows\n   * @param {number} nColumns\n   */\n  #initData(nRows, nColumns) {\n    this.data = [];\n\n    if (Number.isInteger(nColumns) && nColumns >= 0) {\n      for (let i = 0; i < nRows; i++) {\n        this.data.push(new Float64Array(nColumns));\n      }\n    } else {\n      throw new TypeError('nColumns must be a positive integer');\n    }\n\n    this.rows = nRows;\n    this.columns = nColumns;\n  }\n\n  constructor(nRows, nColumns) {\n    super();\n    if (Matrix.isMatrix(nRows)) {\n      this.#initData(nRows.rows, nRows.columns);\n      Matrix.copy(nRows, this);\n    } else if (Number.isInteger(nRows) && nRows >= 0) {\n      this.#initData(nRows, nColumns);\n    } else if (isAnyArray(nRows)) {\n      // Copy the values from the 2D array\n      const arrayData = nRows;\n      nRows = arrayData.length;\n      nColumns = nRows ? arrayData[0].length : 0;\n      if (typeof nColumns !== 'number') {\n        throw new TypeError(\n          'Data must be a 2D array with at least one element',\n        );\n      }\n      this.data = [];\n\n      for (let i = 0; i < nRows; i++) {\n        if (arrayData[i].length !== nColumns) {\n          throw new RangeError('Inconsistent array dimensions');\n        }\n        if (!isArrayOfNumbers(arrayData[i])) {\n          throw new TypeError('Input data contains non-numeric values');\n        }\n        this.data.push(Float64Array.from(arrayData[i]));\n      }\n\n      this.rows = nRows;\n      this.columns = nColumns;\n    } else {\n      throw new TypeError(\n        'First argument must be a positive number or an array',\n      );\n    }\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.data[rowIndex][columnIndex] = value;\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.data[rowIndex][columnIndex];\n  }\n\n  removeRow(index) {\n    checkRowIndex(this, index);\n    this.data.splice(index, 1);\n    this.rows -= 1;\n    return this;\n  }\n\n  addRow(index, array) {\n    if (array === undefined) {\n      array = index;\n      index = this.rows;\n    }\n    checkRowIndex(this, index, true);\n    array = Float64Array.from(checkRowVector(this, array));\n    this.data.splice(index, 0, array);\n    this.rows += 1;\n    return this;\n  }\n\n  removeColumn(index) {\n    checkColumnIndex(this, index);\n    for (let i = 0; i < this.rows; i++) {\n      const newRow = new Float64Array(this.columns - 1);\n      for (let j = 0; j < index; j++) {\n        newRow[j] = this.data[i][j];\n      }\n      for (let j = index + 1; j < this.columns; j++) {\n        newRow[j - 1] = this.data[i][j];\n      }\n      this.data[i] = newRow;\n    }\n    this.columns -= 1;\n    return this;\n  }\n\n  addColumn(index, array) {\n    if (typeof array === 'undefined') {\n      array = index;\n      index = this.columns;\n    }\n    checkColumnIndex(this, index, true);\n    array = checkColumnVector(this, array);\n    for (let i = 0; i < this.rows; i++) {\n      const newRow = new Float64Array(this.columns + 1);\n      let j = 0;\n      for (; j < index; j++) {\n        newRow[j] = this.data[i][j];\n      }\n      newRow[j++] = array[i];\n      for (; j < this.columns + 1; j++) {\n        newRow[j] = this.data[i][j - 1];\n      }\n      this.data[i] = newRow;\n    }\n    this.columns += 1;\n    return this;\n  }\n}\n\ninstallMathOperations(AbstractMatrix, Matrix);\n\n/**\n * @typedef {0 | 1 | number | boolean} Mask\n */\n\nclass SymmetricMatrix extends AbstractMatrix {\n  /** @type {Matrix} */\n  #matrix;\n\n  get size() {\n    return this.#matrix.size;\n  }\n\n  get rows() {\n    return this.#matrix.rows;\n  }\n\n  get columns() {\n    return this.#matrix.columns;\n  }\n\n  get diagonalSize() {\n    return this.rows;\n  }\n\n  /**\n   * not the same as matrix.isSymmetric()\n   * Here is to check if it's instanceof SymmetricMatrix without bundling issues\n   *\n   * @param value\n   * @returns {boolean}\n   */\n  static isSymmetricMatrix(value) {\n    return Matrix.isMatrix(value) && value.klassType === 'SymmetricMatrix';\n  }\n\n  /**\n   * @param diagonalSize\n   * @return {SymmetricMatrix}\n   */\n  static zeros(diagonalSize) {\n    return new this(diagonalSize);\n  }\n\n  /**\n   * @param diagonalSize\n   * @return {SymmetricMatrix}\n   */\n  static ones(diagonalSize) {\n    return new this(diagonalSize).fill(1);\n  }\n\n  /**\n   * @param {number | AbstractMatrix | ArrayLike<ArrayLike<number>>} diagonalSize\n   * @return {this}\n   */\n  constructor(diagonalSize) {\n    super();\n\n    if (Matrix.isMatrix(diagonalSize)) {\n      if (!diagonalSize.isSymmetric()) {\n        throw new TypeError('not symmetric data');\n      }\n\n      this.#matrix = Matrix.copy(\n        diagonalSize,\n        new Matrix(diagonalSize.rows, diagonalSize.rows),\n      );\n    } else if (Number.isInteger(diagonalSize) && diagonalSize >= 0) {\n      this.#matrix = new Matrix(diagonalSize, diagonalSize);\n    } else {\n      this.#matrix = new Matrix(diagonalSize);\n\n      if (!this.isSymmetric()) {\n        throw new TypeError('not symmetric data');\n      }\n    }\n  }\n\n  clone() {\n    const matrix = new SymmetricMatrix(this.diagonalSize);\n\n    for (const [row, col, value] of this.upperRightEntries()) {\n      matrix.set(row, col, value);\n    }\n\n    return matrix;\n  }\n\n  toMatrix() {\n    return new Matrix(this);\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.#matrix.get(rowIndex, columnIndex);\n  }\n  set(rowIndex, columnIndex, value) {\n    // symmetric set\n    this.#matrix.set(rowIndex, columnIndex, value);\n    this.#matrix.set(columnIndex, rowIndex, value);\n\n    return this;\n  }\n\n  removeCross(index) {\n    // symmetric remove side\n    this.#matrix.removeRow(index);\n    this.#matrix.removeColumn(index);\n\n    return this;\n  }\n\n  addCross(index, array) {\n    if (array === undefined) {\n      array = index;\n      index = this.diagonalSize;\n    }\n\n    const row = array.slice();\n    row.splice(index, 1);\n\n    this.#matrix.addRow(index, row);\n    this.#matrix.addColumn(index, array);\n\n    return this;\n  }\n\n  /**\n   * @param {Mask[]} mask\n   */\n  applyMask(mask) {\n    if (mask.length !== this.diagonalSize) {\n      throw new RangeError('Mask size do not match with matrix size');\n    }\n\n    // prepare sides to remove from matrix from mask\n    /** @type {number[]} */\n    const sidesToRemove = [];\n    for (const [index, passthroughs] of mask.entries()) {\n      if (passthroughs) continue;\n      sidesToRemove.push(index);\n    }\n    // to remove from highest to lowest for no mutation shifting\n    sidesToRemove.reverse();\n\n    // remove sides\n    for (const sideIndex of sidesToRemove) {\n      this.removeCross(sideIndex);\n    }\n\n    return this;\n  }\n\n  /**\n   * Compact format upper-right corner of matrix\n   * iterate from left to right, from top to bottom.\n   *\n   * ```\n   *   A B C D\n   * A 1 2 3 4\n   * B 2 5 6 7\n   * C 3 6 8 9\n   * D 4 7 9 10\n   * ```\n   *\n   * will return compact 1D array `[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]`\n   *\n   * length is S(i=0, n=sideSize) => 10 for a 4 sideSized matrix\n   *\n   * @returns {number[]}\n   */\n  toCompact() {\n    const { diagonalSize } = this;\n\n    /** @type {number[]} */\n    const compact = new Array((diagonalSize * (diagonalSize + 1)) / 2);\n    for (let col = 0, row = 0, index = 0; index < compact.length; index++) {\n      compact[index] = this.get(row, col);\n\n      if (++col >= diagonalSize) col = ++row;\n    }\n\n    return compact;\n  }\n\n  /**\n   * @param {number[]} compact\n   * @return {SymmetricMatrix}\n   */\n  static fromCompact(compact) {\n    const compactSize = compact.length;\n    // compactSize = (sideSize * (sideSize + 1)) / 2\n    // https://mathsolver.microsoft.com/fr/solve-problem/y%20%3D%20%20x%20%60cdot%20%20%20%60frac%7B%20%20%60left(%20x%2B1%20%20%60right)%20%20%20%20%7D%7B%202%20%20%7D\n    // sideSize = (Sqrt(8 × compactSize + 1) - 1) / 2\n    const diagonalSize = (Math.sqrt(8 * compactSize + 1) - 1) / 2;\n\n    if (!Number.isInteger(diagonalSize)) {\n      throw new TypeError(\n        `This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(\n          compact,\n        )}`,\n      );\n    }\n\n    const matrix = new SymmetricMatrix(diagonalSize);\n    for (let col = 0, row = 0, index = 0; index < compactSize; index++) {\n      matrix.set(col, row, compact[index]);\n      if (++col >= diagonalSize) col = ++row;\n    }\n\n    return matrix;\n  }\n\n  /**\n   * half iterator upper-right-corner from left to right, from top to bottom\n   * yield [row, column, value]\n   *\n   * @returns {Generator<[number, number, number], void, void>}\n   */\n  *upperRightEntries() {\n    for (let row = 0, col = 0; row < this.diagonalSize; void 0) {\n      const value = this.get(row, col);\n\n      yield [row, col, value];\n\n      // at the end of row, move cursor to next row at diagonal position\n      if (++col >= this.diagonalSize) col = ++row;\n    }\n  }\n\n  /**\n   * half iterator upper-right-corner from left to right, from top to bottom\n   * yield value\n   *\n   * @returns {Generator<[number, number, number], void, void>}\n   */\n  *upperRightValues() {\n    for (let row = 0, col = 0; row < this.diagonalSize; void 0) {\n      const value = this.get(row, col);\n\n      yield value;\n\n      // at the end of row, move cursor to next row at diagonal position\n      if (++col >= this.diagonalSize) col = ++row;\n    }\n  }\n}\nSymmetricMatrix.prototype.klassType = 'SymmetricMatrix';\n\nclass DistanceMatrix extends SymmetricMatrix {\n  /**\n   * not the same as matrix.isSymmetric()\n   * Here is to check if it's instanceof SymmetricMatrix without bundling issues\n   *\n   * @param value\n   * @returns {boolean}\n   */\n  static isDistanceMatrix(value) {\n    return (\n      SymmetricMatrix.isSymmetricMatrix(value) &&\n      value.klassSubType === 'DistanceMatrix'\n    );\n  }\n\n  constructor(sideSize) {\n    super(sideSize);\n\n    if (!this.isDistance()) {\n      throw new TypeError('Provided arguments do no produce a distance matrix');\n    }\n  }\n\n  set(rowIndex, columnIndex, value) {\n    // distance matrix diagonal is 0\n    if (rowIndex === columnIndex) value = 0;\n\n    return super.set(rowIndex, columnIndex, value);\n  }\n\n  addCross(index, array) {\n    if (array === undefined) {\n      array = index;\n      index = this.diagonalSize;\n    }\n\n    // ensure distance\n    array = array.slice();\n    array[index] = 0;\n\n    return super.addCross(index, array);\n  }\n\n  toSymmetricMatrix() {\n    return new SymmetricMatrix(this);\n  }\n\n  clone() {\n    const matrix = new DistanceMatrix(this.diagonalSize);\n\n    for (const [row, col, value] of this.upperRightEntries()) {\n      if (row === col) continue;\n      matrix.set(row, col, value);\n    }\n\n    return matrix;\n  }\n\n  /**\n   * Compact format upper-right corner of matrix\n   * no diagonal (only zeros)\n   * iterable from left to right, from top to bottom.\n   *\n   * ```\n   *   A B C D\n   * A 0 1 2 3\n   * B 1 0 4 5\n   * C 2 4 0 6\n   * D 3 5 6 0\n   * ```\n   *\n   * will return compact 1D array `[1, 2, 3, 4, 5, 6]`\n   *\n   * length is S(i=0, n=sideSize-1) => 6 for a 4 side sized matrix\n   *\n   * @returns {number[]}\n   */\n  toCompact() {\n    const { diagonalSize } = this;\n    const compactLength = ((diagonalSize - 1) * diagonalSize) / 2;\n\n    /** @type {number[]} */\n    const compact = new Array(compactLength);\n    for (let col = 1, row = 0, index = 0; index < compact.length; index++) {\n      compact[index] = this.get(row, col);\n\n      if (++col >= diagonalSize) col = ++row + 1;\n    }\n\n    return compact;\n  }\n\n  /**\n   * @param {number[]} compact\n   */\n  static fromCompact(compact) {\n    const compactSize = compact.length;\n\n    if (compactSize === 0) {\n      return new this(0);\n    }\n\n    // compactSize in Natural integer range ]0;∞]\n    // compactSize = (sideSize * (sideSize - 1)) / 2\n    // sideSize = (Sqrt(8 × compactSize + 1) + 1) / 2\n    const diagonalSize = (Math.sqrt(8 * compactSize + 1) + 1) / 2;\n\n    if (!Number.isInteger(diagonalSize)) {\n      throw new TypeError(\n        `This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(\n          compact,\n        )}`,\n      );\n    }\n\n    const matrix = new this(diagonalSize);\n    for (let col = 1, row = 0, index = 0; index < compactSize; index++) {\n      matrix.set(col, row, compact[index]);\n      if (++col >= diagonalSize) col = ++row + 1;\n    }\n\n    return matrix;\n  }\n}\nDistanceMatrix.prototype.klassSubType = 'DistanceMatrix';\n\nclass BaseView extends AbstractMatrix {\n  constructor(matrix, rows, columns) {\n    super();\n    this.matrix = matrix;\n    this.rows = rows;\n    this.columns = columns;\n  }\n}\n\nclass MatrixColumnView extends BaseView {\n  constructor(matrix, column) {\n    checkColumnIndex(matrix, column);\n    super(matrix, matrix.rows, 1);\n    this.column = column;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(rowIndex, this.column, value);\n    return this;\n  }\n\n  get(rowIndex) {\n    return this.matrix.get(rowIndex, this.column);\n  }\n}\n\nclass MatrixColumnSelectionView extends BaseView {\n  constructor(matrix, columnIndices) {\n    checkColumnIndices(matrix, columnIndices);\n    super(matrix, matrix.rows, columnIndices.length);\n    this.columnIndices = columnIndices;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(rowIndex, this.columnIndices[columnIndex], value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(rowIndex, this.columnIndices[columnIndex]);\n  }\n}\n\nclass MatrixFlipColumnView extends BaseView {\n  constructor(matrix) {\n    super(matrix, matrix.rows, matrix.columns);\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(rowIndex, this.columns - columnIndex - 1, value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(rowIndex, this.columns - columnIndex - 1);\n  }\n}\n\nclass MatrixFlipRowView extends BaseView {\n  constructor(matrix) {\n    super(matrix, matrix.rows, matrix.columns);\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(this.rows - rowIndex - 1, columnIndex, value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(this.rows - rowIndex - 1, columnIndex);\n  }\n}\n\nclass MatrixRowView extends BaseView {\n  constructor(matrix, row) {\n    checkRowIndex(matrix, row);\n    super(matrix, 1, matrix.columns);\n    this.row = row;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(this.row, columnIndex, value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(this.row, columnIndex);\n  }\n}\n\nclass MatrixRowSelectionView extends BaseView {\n  constructor(matrix, rowIndices) {\n    checkRowIndices(matrix, rowIndices);\n    super(matrix, rowIndices.length, matrix.columns);\n    this.rowIndices = rowIndices;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(this.rowIndices[rowIndex], columnIndex, value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(this.rowIndices[rowIndex], columnIndex);\n  }\n}\n\nclass MatrixSelectionView extends BaseView {\n  constructor(matrix, rowIndices, columnIndices) {\n    checkRowIndices(matrix, rowIndices);\n    checkColumnIndices(matrix, columnIndices);\n    super(matrix, rowIndices.length, columnIndices.length);\n    this.rowIndices = rowIndices;\n    this.columnIndices = columnIndices;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(\n      this.rowIndices[rowIndex],\n      this.columnIndices[columnIndex],\n      value,\n    );\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(\n      this.rowIndices[rowIndex],\n      this.columnIndices[columnIndex],\n    );\n  }\n}\n\nclass MatrixSubView extends BaseView {\n  constructor(matrix, startRow, endRow, startColumn, endColumn) {\n    checkRange(matrix, startRow, endRow, startColumn, endColumn);\n    super(matrix, endRow - startRow + 1, endColumn - startColumn + 1);\n    this.startRow = startRow;\n    this.startColumn = startColumn;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(\n      this.startRow + rowIndex,\n      this.startColumn + columnIndex,\n      value,\n    );\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(\n      this.startRow + rowIndex,\n      this.startColumn + columnIndex,\n    );\n  }\n}\n\nclass MatrixTransposeView extends BaseView {\n  constructor(matrix) {\n    super(matrix, matrix.columns, matrix.rows);\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.matrix.set(columnIndex, rowIndex, value);\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.matrix.get(columnIndex, rowIndex);\n  }\n}\n\nclass WrapperMatrix1D extends AbstractMatrix {\n  constructor(data, options = {}) {\n    const { rows = 1 } = options;\n\n    if (data.length % rows !== 0) {\n      throw new Error('the data length is not divisible by the number of rows');\n    }\n    super();\n    this.rows = rows;\n    this.columns = data.length / rows;\n    this.data = data;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    let index = this._calculateIndex(rowIndex, columnIndex);\n    this.data[index] = value;\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    let index = this._calculateIndex(rowIndex, columnIndex);\n    return this.data[index];\n  }\n\n  _calculateIndex(row, column) {\n    return row * this.columns + column;\n  }\n}\n\nclass WrapperMatrix2D extends AbstractMatrix {\n  constructor(data) {\n    super();\n    this.data = data;\n    this.rows = data.length;\n    this.columns = data[0].length;\n  }\n\n  set(rowIndex, columnIndex, value) {\n    this.data[rowIndex][columnIndex] = value;\n    return this;\n  }\n\n  get(rowIndex, columnIndex) {\n    return this.data[rowIndex][columnIndex];\n  }\n}\n\nfunction wrap(array, options) {\n  if (isAnyArray(array)) {\n    if (array[0] && isAnyArray(array[0])) {\n      return new WrapperMatrix2D(array);\n    } else {\n      return new WrapperMatrix1D(array, options);\n    }\n  } else {\n    throw new Error('the argument is not an array');\n  }\n}\n\nclass LuDecomposition {\n  constructor(matrix) {\n    matrix = WrapperMatrix2D.checkMatrix(matrix);\n\n    let lu = matrix.clone();\n    let rows = lu.rows;\n    let columns = lu.columns;\n    let pivotVector = new Float64Array(rows);\n    let pivotSign = 1;\n    let i, j, k, p, s, t, v;\n    let LUcolj, kmax;\n\n    for (i = 0; i < rows; i++) {\n      pivotVector[i] = i;\n    }\n\n    LUcolj = new Float64Array(rows);\n\n    for (j = 0; j < columns; j++) {\n      for (i = 0; i < rows; i++) {\n        LUcolj[i] = lu.get(i, j);\n      }\n\n      for (i = 0; i < rows; i++) {\n        kmax = Math.min(i, j);\n        s = 0;\n        for (k = 0; k < kmax; k++) {\n          s += lu.get(i, k) * LUcolj[k];\n        }\n        LUcolj[i] -= s;\n        lu.set(i, j, LUcolj[i]);\n      }\n\n      p = j;\n      for (i = j + 1; i < rows; i++) {\n        if (Math.abs(LUcolj[i]) > Math.abs(LUcolj[p])) {\n          p = i;\n        }\n      }\n\n      if (p !== j) {\n        for (k = 0; k < columns; k++) {\n          t = lu.get(p, k);\n          lu.set(p, k, lu.get(j, k));\n          lu.set(j, k, t);\n        }\n\n        v = pivotVector[p];\n        pivotVector[p] = pivotVector[j];\n        pivotVector[j] = v;\n\n        pivotSign = -pivotSign;\n      }\n\n      if (j < rows && lu.get(j, j) !== 0) {\n        for (i = j + 1; i < rows; i++) {\n          lu.set(i, j, lu.get(i, j) / lu.get(j, j));\n        }\n      }\n    }\n\n    this.LU = lu;\n    this.pivotVector = pivotVector;\n    this.pivotSign = pivotSign;\n  }\n\n  isSingular() {\n    let data = this.LU;\n    let col = data.columns;\n    for (let j = 0; j < col; j++) {\n      if (data.get(j, j) === 0) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  solve(value) {\n    value = Matrix.checkMatrix(value);\n\n    let lu = this.LU;\n    let rows = lu.rows;\n\n    if (rows !== value.rows) {\n      throw new Error('Invalid matrix dimensions');\n    }\n    if (this.isSingular()) {\n      throw new Error('LU matrix is singular');\n    }\n\n    let count = value.columns;\n    let X = value.subMatrixRow(this.pivotVector, 0, count - 1);\n    let columns = lu.columns;\n    let i, j, k;\n\n    for (k = 0; k < columns; k++) {\n      for (i = k + 1; i < columns; i++) {\n        for (j = 0; j < count; j++) {\n          X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n        }\n      }\n    }\n    for (k = columns - 1; k >= 0; k--) {\n      for (j = 0; j < count; j++) {\n        X.set(k, j, X.get(k, j) / lu.get(k, k));\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < count; j++) {\n          X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n        }\n      }\n    }\n    return X;\n  }\n\n  get determinant() {\n    let data = this.LU;\n    if (!data.isSquare()) {\n      throw new Error('Matrix must be square');\n    }\n    let determinant = this.pivotSign;\n    let col = data.columns;\n    for (let j = 0; j < col; j++) {\n      determinant *= data.get(j, j);\n    }\n    return determinant;\n  }\n\n  get lowerTriangularMatrix() {\n    let data = this.LU;\n    let rows = data.rows;\n    let columns = data.columns;\n    let X = new Matrix(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        if (i > j) {\n          X.set(i, j, data.get(i, j));\n        } else if (i === j) {\n          X.set(i, j, 1);\n        } else {\n          X.set(i, j, 0);\n        }\n      }\n    }\n    return X;\n  }\n\n  get upperTriangularMatrix() {\n    let data = this.LU;\n    let rows = data.rows;\n    let columns = data.columns;\n    let X = new Matrix(rows, columns);\n    for (let i = 0; i < rows; i++) {\n      for (let j = 0; j < columns; j++) {\n        if (i <= j) {\n          X.set(i, j, data.get(i, j));\n        } else {\n          X.set(i, j, 0);\n        }\n      }\n    }\n    return X;\n  }\n\n  get pivotPermutationVector() {\n    return Array.from(this.pivotVector);\n  }\n}\n\nfunction hypotenuse(a, b) {\n  let r = 0;\n  if (Math.abs(a) > Math.abs(b)) {\n    r = b / a;\n    return Math.abs(a) * Math.sqrt(1 + r * r);\n  }\n  if (b !== 0) {\n    r = a / b;\n    return Math.abs(b) * Math.sqrt(1 + r * r);\n  }\n  return 0;\n}\n\nclass QrDecomposition {\n  constructor(value) {\n    value = WrapperMatrix2D.checkMatrix(value);\n\n    let qr = value.clone();\n    let m = value.rows;\n    let n = value.columns;\n    let rdiag = new Float64Array(n);\n    let i, j, k, s;\n\n    for (k = 0; k < n; k++) {\n      let nrm = 0;\n      for (i = k; i < m; i++) {\n        nrm = hypotenuse(nrm, qr.get(i, k));\n      }\n      if (nrm !== 0) {\n        if (qr.get(k, k) < 0) {\n          nrm = -nrm;\n        }\n        for (i = k; i < m; i++) {\n          qr.set(i, k, qr.get(i, k) / nrm);\n        }\n        qr.set(k, k, qr.get(k, k) + 1);\n        for (j = k + 1; j < n; j++) {\n          s = 0;\n          for (i = k; i < m; i++) {\n            s += qr.get(i, k) * qr.get(i, j);\n          }\n          s = -s / qr.get(k, k);\n          for (i = k; i < m; i++) {\n            qr.set(i, j, qr.get(i, j) + s * qr.get(i, k));\n          }\n        }\n      }\n      rdiag[k] = -nrm;\n    }\n\n    this.QR = qr;\n    this.Rdiag = rdiag;\n  }\n\n  solve(value) {\n    value = Matrix.checkMatrix(value);\n\n    let qr = this.QR;\n    let m = qr.rows;\n\n    if (value.rows !== m) {\n      throw new Error('Matrix row dimensions must agree');\n    }\n    if (!this.isFullRank()) {\n      throw new Error('Matrix is rank deficient');\n    }\n\n    let count = value.columns;\n    let X = value.clone();\n    let n = qr.columns;\n    let i, j, k, s;\n\n    for (k = 0; k < n; k++) {\n      for (j = 0; j < count; j++) {\n        s = 0;\n        for (i = k; i < m; i++) {\n          s += qr.get(i, k) * X.get(i, j);\n        }\n        s = -s / qr.get(k, k);\n        for (i = k; i < m; i++) {\n          X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n        }\n      }\n    }\n    for (k = n - 1; k >= 0; k--) {\n      for (j = 0; j < count; j++) {\n        X.set(k, j, X.get(k, j) / this.Rdiag[k]);\n      }\n      for (i = 0; i < k; i++) {\n        for (j = 0; j < count; j++) {\n          X.set(i, j, X.get(i, j) - X.get(k, j) * qr.get(i, k));\n        }\n      }\n    }\n\n    return X.subMatrix(0, n - 1, 0, count - 1);\n  }\n\n  isFullRank() {\n    let columns = this.QR.columns;\n    for (let i = 0; i < columns; i++) {\n      if (this.Rdiag[i] === 0) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  get upperTriangularMatrix() {\n    let qr = this.QR;\n    let n = qr.columns;\n    let X = new Matrix(n, n);\n    let i, j;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        if (i < j) {\n          X.set(i, j, qr.get(i, j));\n        } else if (i === j) {\n          X.set(i, j, this.Rdiag[i]);\n        } else {\n          X.set(i, j, 0);\n        }\n      }\n    }\n    return X;\n  }\n\n  get orthogonalMatrix() {\n    let qr = this.QR;\n    let rows = qr.rows;\n    let columns = qr.columns;\n    let X = new Matrix(rows, columns);\n    let i, j, k, s;\n\n    for (k = columns - 1; k >= 0; k--) {\n      for (i = 0; i < rows; i++) {\n        X.set(i, k, 0);\n      }\n      X.set(k, k, 1);\n      for (j = k; j < columns; j++) {\n        if (qr.get(k, k) !== 0) {\n          s = 0;\n          for (i = k; i < rows; i++) {\n            s += qr.get(i, k) * X.get(i, j);\n          }\n\n          s = -s / qr.get(k, k);\n\n          for (i = k; i < rows; i++) {\n            X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n          }\n        }\n      }\n    }\n    return X;\n  }\n}\n\nclass SingularValueDecomposition {\n  constructor(value, options = {}) {\n    value = WrapperMatrix2D.checkMatrix(value);\n\n    if (value.isEmpty()) {\n      throw new Error('Matrix must be non-empty');\n    }\n\n    let m = value.rows;\n    let n = value.columns;\n\n    const {\n      computeLeftSingularVectors = true,\n      computeRightSingularVectors = true,\n      autoTranspose = false,\n    } = options;\n\n    let wantu = Boolean(computeLeftSingularVectors);\n    let wantv = Boolean(computeRightSingularVectors);\n\n    let swapped = false;\n    let a;\n    if (m < n) {\n      if (!autoTranspose) {\n        a = value.clone();\n        // eslint-disable-next-line no-console\n        console.warn(\n          'Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose',\n        );\n      } else {\n        a = value.transpose();\n        m = a.rows;\n        n = a.columns;\n        swapped = true;\n        let aux = wantu;\n        wantu = wantv;\n        wantv = aux;\n      }\n    } else {\n      a = value.clone();\n    }\n\n    let nu = Math.min(m, n);\n    let ni = Math.min(m + 1, n);\n    let s = new Float64Array(ni);\n    let U = new Matrix(m, nu);\n    let V = new Matrix(n, n);\n\n    let e = new Float64Array(n);\n    let work = new Float64Array(m);\n\n    let si = new Float64Array(ni);\n    for (let i = 0; i < ni; i++) si[i] = i;\n\n    let nct = Math.min(m - 1, n);\n    let nrt = Math.max(0, Math.min(n - 2, m));\n    let mrc = Math.max(nct, nrt);\n\n    for (let k = 0; k < mrc; k++) {\n      if (k < nct) {\n        s[k] = 0;\n        for (let i = k; i < m; i++) {\n          s[k] = hypotenuse(s[k], a.get(i, k));\n        }\n        if (s[k] !== 0) {\n          if (a.get(k, k) < 0) {\n            s[k] = -s[k];\n          }\n          for (let i = k; i < m; i++) {\n            a.set(i, k, a.get(i, k) / s[k]);\n          }\n          a.set(k, k, a.get(k, k) + 1);\n        }\n        s[k] = -s[k];\n      }\n\n      for (let j = k + 1; j < n; j++) {\n        if (k < nct && s[k] !== 0) {\n          let t = 0;\n          for (let i = k; i < m; i++) {\n            t += a.get(i, k) * a.get(i, j);\n          }\n          t = -t / a.get(k, k);\n          for (let i = k; i < m; i++) {\n            a.set(i, j, a.get(i, j) + t * a.get(i, k));\n          }\n        }\n        e[j] = a.get(k, j);\n      }\n\n      if (wantu && k < nct) {\n        for (let i = k; i < m; i++) {\n          U.set(i, k, a.get(i, k));\n        }\n      }\n\n      if (k < nrt) {\n        e[k] = 0;\n        for (let i = k + 1; i < n; i++) {\n          e[k] = hypotenuse(e[k], e[i]);\n        }\n        if (e[k] !== 0) {\n          if (e[k + 1] < 0) {\n            e[k] = 0 - e[k];\n          }\n          for (let i = k + 1; i < n; i++) {\n            e[i] /= e[k];\n          }\n          e[k + 1] += 1;\n        }\n        e[k] = -e[k];\n        if (k + 1 < m && e[k] !== 0) {\n          for (let i = k + 1; i < m; i++) {\n            work[i] = 0;\n          }\n          for (let i = k + 1; i < m; i++) {\n            for (let j = k + 1; j < n; j++) {\n              work[i] += e[j] * a.get(i, j);\n            }\n          }\n          for (let j = k + 1; j < n; j++) {\n            let t = -e[j] / e[k + 1];\n            for (let i = k + 1; i < m; i++) {\n              a.set(i, j, a.get(i, j) + t * work[i]);\n            }\n          }\n        }\n        if (wantv) {\n          for (let i = k + 1; i < n; i++) {\n            V.set(i, k, e[i]);\n          }\n        }\n      }\n    }\n\n    let p = Math.min(n, m + 1);\n    if (nct < n) {\n      s[nct] = a.get(nct, nct);\n    }\n    if (m < p) {\n      s[p - 1] = 0;\n    }\n    if (nrt + 1 < p) {\n      e[nrt] = a.get(nrt, p - 1);\n    }\n    e[p - 1] = 0;\n\n    if (wantu) {\n      for (let j = nct; j < nu; j++) {\n        for (let i = 0; i < m; i++) {\n          U.set(i, j, 0);\n        }\n        U.set(j, j, 1);\n      }\n      for (let k = nct - 1; k >= 0; k--) {\n        if (s[k] !== 0) {\n          for (let j = k + 1; j < nu; j++) {\n            let t = 0;\n            for (let i = k; i < m; i++) {\n              t += U.get(i, k) * U.get(i, j);\n            }\n            t = -t / U.get(k, k);\n            for (let i = k; i < m; i++) {\n              U.set(i, j, U.get(i, j) + t * U.get(i, k));\n            }\n          }\n          for (let i = k; i < m; i++) {\n            U.set(i, k, -U.get(i, k));\n          }\n          U.set(k, k, 1 + U.get(k, k));\n          for (let i = 0; i < k - 1; i++) {\n            U.set(i, k, 0);\n          }\n        } else {\n          for (let i = 0; i < m; i++) {\n            U.set(i, k, 0);\n          }\n          U.set(k, k, 1);\n        }\n      }\n    }\n\n    if (wantv) {\n      for (let k = n - 1; k >= 0; k--) {\n        if (k < nrt && e[k] !== 0) {\n          for (let j = k + 1; j < n; j++) {\n            let t = 0;\n            for (let i = k + 1; i < n; i++) {\n              t += V.get(i, k) * V.get(i, j);\n            }\n            t = -t / V.get(k + 1, k);\n            for (let i = k + 1; i < n; i++) {\n              V.set(i, j, V.get(i, j) + t * V.get(i, k));\n            }\n          }\n        }\n        for (let i = 0; i < n; i++) {\n          V.set(i, k, 0);\n        }\n        V.set(k, k, 1);\n      }\n    }\n\n    let pp = p - 1;\n    let eps = Number.EPSILON;\n    while (p > 0) {\n      let k, kase;\n      for (k = p - 2; k >= -1; k--) {\n        if (k === -1) {\n          break;\n        }\n        const alpha =\n          Number.MIN_VALUE + eps * Math.abs(s[k] + Math.abs(s[k + 1]));\n        if (Math.abs(e[k]) <= alpha || Number.isNaN(e[k])) {\n          e[k] = 0;\n          break;\n        }\n      }\n      if (k === p - 2) {\n        kase = 4;\n      } else {\n        let ks;\n        for (ks = p - 1; ks >= k; ks--) {\n          if (ks === k) {\n            break;\n          }\n          let t =\n            (ks !== p ? Math.abs(e[ks]) : 0) +\n            (ks !== k + 1 ? Math.abs(e[ks - 1]) : 0);\n          if (Math.abs(s[ks]) <= eps * t) {\n            s[ks] = 0;\n            break;\n          }\n        }\n        if (ks === k) {\n          kase = 3;\n        } else if (ks === p - 1) {\n          kase = 1;\n        } else {\n          kase = 2;\n          k = ks;\n        }\n      }\n\n      k++;\n\n      switch (kase) {\n        case 1: {\n          let f = e[p - 2];\n          e[p - 2] = 0;\n          for (let j = p - 2; j >= k; j--) {\n            let t = hypotenuse(s[j], f);\n            let cs = s[j] / t;\n            let sn = f / t;\n            s[j] = t;\n            if (j !== k) {\n              f = -sn * e[j - 1];\n              e[j - 1] = cs * e[j - 1];\n            }\n            if (wantv) {\n              for (let i = 0; i < n; i++) {\n                t = cs * V.get(i, j) + sn * V.get(i, p - 1);\n                V.set(i, p - 1, -sn * V.get(i, j) + cs * V.get(i, p - 1));\n                V.set(i, j, t);\n              }\n            }\n          }\n          break;\n        }\n        case 2: {\n          let f = e[k - 1];\n          e[k - 1] = 0;\n          for (let j = k; j < p; j++) {\n            let t = hypotenuse(s[j], f);\n            let cs = s[j] / t;\n            let sn = f / t;\n            s[j] = t;\n            f = -sn * e[j];\n            e[j] = cs * e[j];\n            if (wantu) {\n              for (let i = 0; i < m; i++) {\n                t = cs * U.get(i, j) + sn * U.get(i, k - 1);\n                U.set(i, k - 1, -sn * U.get(i, j) + cs * U.get(i, k - 1));\n                U.set(i, j, t);\n              }\n            }\n          }\n          break;\n        }\n        case 3: {\n          const scale = Math.max(\n            Math.abs(s[p - 1]),\n            Math.abs(s[p - 2]),\n            Math.abs(e[p - 2]),\n            Math.abs(s[k]),\n            Math.abs(e[k]),\n          );\n          const sp = s[p - 1] / scale;\n          const spm1 = s[p - 2] / scale;\n          const epm1 = e[p - 2] / scale;\n          const sk = s[k] / scale;\n          const ek = e[k] / scale;\n          const b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;\n          const c = sp * epm1 * (sp * epm1);\n          let shift = 0;\n          if (b !== 0 || c !== 0) {\n            if (b < 0) {\n              shift = 0 - Math.sqrt(b * b + c);\n            } else {\n              shift = Math.sqrt(b * b + c);\n            }\n            shift = c / (b + shift);\n          }\n          let f = (sk + sp) * (sk - sp) + shift;\n          let g = sk * ek;\n          for (let j = k; j < p - 1; j++) {\n            let t = hypotenuse(f, g);\n            if (t === 0) t = Number.MIN_VALUE;\n            let cs = f / t;\n            let sn = g / t;\n            if (j !== k) {\n              e[j - 1] = t;\n            }\n            f = cs * s[j] + sn * e[j];\n            e[j] = cs * e[j] - sn * s[j];\n            g = sn * s[j + 1];\n            s[j + 1] = cs * s[j + 1];\n            if (wantv) {\n              for (let i = 0; i < n; i++) {\n                t = cs * V.get(i, j) + sn * V.get(i, j + 1);\n                V.set(i, j + 1, -sn * V.get(i, j) + cs * V.get(i, j + 1));\n                V.set(i, j, t);\n              }\n            }\n            t = hypotenuse(f, g);\n            if (t === 0) t = Number.MIN_VALUE;\n            cs = f / t;\n            sn = g / t;\n            s[j] = t;\n            f = cs * e[j] + sn * s[j + 1];\n            s[j + 1] = -sn * e[j] + cs * s[j + 1];\n            g = sn * e[j + 1];\n            e[j + 1] = cs * e[j + 1];\n            if (wantu && j < m - 1) {\n              for (let i = 0; i < m; i++) {\n                t = cs * U.get(i, j) + sn * U.get(i, j + 1);\n                U.set(i, j + 1, -sn * U.get(i, j) + cs * U.get(i, j + 1));\n                U.set(i, j, t);\n              }\n            }\n          }\n          e[p - 2] = f;\n          break;\n        }\n        case 4: {\n          if (s[k] <= 0) {\n            s[k] = s[k] < 0 ? -s[k] : 0;\n            if (wantv) {\n              for (let i = 0; i <= pp; i++) {\n                V.set(i, k, -V.get(i, k));\n              }\n            }\n          }\n          while (k < pp) {\n            if (s[k] >= s[k + 1]) {\n              break;\n            }\n            let t = s[k];\n            s[k] = s[k + 1];\n            s[k + 1] = t;\n            if (wantv && k < n - 1) {\n              for (let i = 0; i < n; i++) {\n                t = V.get(i, k + 1);\n                V.set(i, k + 1, V.get(i, k));\n                V.set(i, k, t);\n              }\n            }\n            if (wantu && k < m - 1) {\n              for (let i = 0; i < m; i++) {\n                t = U.get(i, k + 1);\n                U.set(i, k + 1, U.get(i, k));\n                U.set(i, k, t);\n              }\n            }\n            k++;\n          }\n          p--;\n          break;\n        }\n        // no default\n      }\n    }\n\n    if (swapped) {\n      let tmp = V;\n      V = U;\n      U = tmp;\n    }\n\n    this.m = m;\n    this.n = n;\n    this.s = s;\n    this.U = U;\n    this.V = V;\n  }\n\n  solve(value) {\n    let Y = value;\n    let e = this.threshold;\n    let scols = this.s.length;\n    let Ls = Matrix.zeros(scols, scols);\n\n    for (let i = 0; i < scols; i++) {\n      if (Math.abs(this.s[i]) <= e) {\n        Ls.set(i, i, 0);\n      } else {\n        Ls.set(i, i, 1 / this.s[i]);\n      }\n    }\n\n    let U = this.U;\n    let V = this.rightSingularVectors;\n\n    let VL = V.mmul(Ls);\n    let vrows = V.rows;\n    let urows = U.rows;\n    let VLU = Matrix.zeros(vrows, urows);\n\n    for (let i = 0; i < vrows; i++) {\n      for (let j = 0; j < urows; j++) {\n        let sum = 0;\n        for (let k = 0; k < scols; k++) {\n          sum += VL.get(i, k) * U.get(j, k);\n        }\n        VLU.set(i, j, sum);\n      }\n    }\n\n    return VLU.mmul(Y);\n  }\n\n  solveForDiagonal(value) {\n    return this.solve(Matrix.diag(value));\n  }\n\n  inverse() {\n    let V = this.V;\n    let e = this.threshold;\n    let vrows = V.rows;\n    let vcols = V.columns;\n    let X = new Matrix(vrows, this.s.length);\n\n    for (let i = 0; i < vrows; i++) {\n      for (let j = 0; j < vcols; j++) {\n        if (Math.abs(this.s[j]) > e) {\n          X.set(i, j, V.get(i, j) / this.s[j]);\n        }\n      }\n    }\n\n    let U = this.U;\n\n    let urows = U.rows;\n    let ucols = U.columns;\n    let Y = new Matrix(vrows, urows);\n\n    for (let i = 0; i < vrows; i++) {\n      for (let j = 0; j < urows; j++) {\n        let sum = 0;\n        for (let k = 0; k < ucols; k++) {\n          sum += X.get(i, k) * U.get(j, k);\n        }\n        Y.set(i, j, sum);\n      }\n    }\n\n    return Y;\n  }\n\n  get condition() {\n    return this.s[0] / this.s[Math.min(this.m, this.n) - 1];\n  }\n\n  get norm2() {\n    return this.s[0];\n  }\n\n  get rank() {\n    let tol = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON;\n    let r = 0;\n    let s = this.s;\n    for (let i = 0, ii = s.length; i < ii; i++) {\n      if (s[i] > tol) {\n        r++;\n      }\n    }\n    return r;\n  }\n\n  get diagonal() {\n    return Array.from(this.s);\n  }\n\n  get threshold() {\n    return (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0];\n  }\n\n  get leftSingularVectors() {\n    return this.U;\n  }\n\n  get rightSingularVectors() {\n    return this.V;\n  }\n\n  get diagonalMatrix() {\n    return Matrix.diag(this.s);\n  }\n}\n\nfunction inverse(matrix, useSVD = false) {\n  matrix = WrapperMatrix2D.checkMatrix(matrix);\n  if (useSVD) {\n    return new SingularValueDecomposition(matrix).inverse();\n  } else {\n    return solve(matrix, Matrix.eye(matrix.rows));\n  }\n}\n\nfunction solve(leftHandSide, rightHandSide, useSVD = false) {\n  leftHandSide = WrapperMatrix2D.checkMatrix(leftHandSide);\n  rightHandSide = WrapperMatrix2D.checkMatrix(rightHandSide);\n  if (useSVD) {\n    return new SingularValueDecomposition(leftHandSide).solve(rightHandSide);\n  } else {\n    return leftHandSide.isSquare()\n      ? new LuDecomposition(leftHandSide).solve(rightHandSide)\n      : new QrDecomposition(leftHandSide).solve(rightHandSide);\n  }\n}\n\nfunction determinant(matrix) {\n  matrix = Matrix.checkMatrix(matrix);\n  if (matrix.isSquare()) {\n    if (matrix.columns === 0) {\n      return 1;\n    }\n\n    let a, b, c, d;\n    if (matrix.columns === 2) {\n      // 2 x 2 matrix\n      a = matrix.get(0, 0);\n      b = matrix.get(0, 1);\n      c = matrix.get(1, 0);\n      d = matrix.get(1, 1);\n\n      return a * d - b * c;\n    } else if (matrix.columns === 3) {\n      // 3 x 3 matrix\n      let subMatrix0, subMatrix1, subMatrix2;\n      subMatrix0 = new MatrixSelectionView(matrix, [1, 2], [1, 2]);\n      subMatrix1 = new MatrixSelectionView(matrix, [1, 2], [0, 2]);\n      subMatrix2 = new MatrixSelectionView(matrix, [1, 2], [0, 1]);\n      a = matrix.get(0, 0);\n      b = matrix.get(0, 1);\n      c = matrix.get(0, 2);\n\n      return (\n        a * determinant(subMatrix0) -\n        b * determinant(subMatrix1) +\n        c * determinant(subMatrix2)\n      );\n    } else {\n      // general purpose determinant using the LU decomposition\n      return new LuDecomposition(matrix).determinant;\n    }\n  } else {\n    throw Error('determinant can only be calculated for a square matrix');\n  }\n}\n\nfunction xrange(n, exception) {\n  let range = [];\n  for (let i = 0; i < n; i++) {\n    if (i !== exception) {\n      range.push(i);\n    }\n  }\n  return range;\n}\n\nfunction dependenciesOneRow(\n  error,\n  matrix,\n  index,\n  thresholdValue = 10e-10,\n  thresholdError = 10e-10,\n) {\n  if (error > thresholdError) {\n    return new Array(matrix.rows + 1).fill(0);\n  } else {\n    let returnArray = matrix.addRow(index, [0]);\n    for (let i = 0; i < returnArray.rows; i++) {\n      if (Math.abs(returnArray.get(i, 0)) < thresholdValue) {\n        returnArray.set(i, 0, 0);\n      }\n    }\n    return returnArray.to1DArray();\n  }\n}\n\nfunction linearDependencies(matrix, options = {}) {\n  const { thresholdValue = 10e-10, thresholdError = 10e-10 } = options;\n  matrix = Matrix.checkMatrix(matrix);\n\n  let n = matrix.rows;\n  let results = new Matrix(n, n);\n\n  for (let i = 0; i < n; i++) {\n    let b = Matrix.columnVector(matrix.getRow(i));\n    let Abis = matrix.subMatrixRow(xrange(n, i)).transpose();\n    let svd = new SingularValueDecomposition(Abis);\n    let x = svd.solve(b);\n    let error = Matrix.sub(b, Abis.mmul(x)).abs().max();\n    results.setRow(\n      i,\n      dependenciesOneRow(error, x, i, thresholdValue, thresholdError),\n    );\n  }\n  return results;\n}\n\nfunction pseudoInverse(matrix, threshold = Number.EPSILON) {\n  matrix = Matrix.checkMatrix(matrix);\n  if (matrix.isEmpty()) {\n    // with a zero dimension, the pseudo-inverse is the transpose, since all 0xn and nx0 matrices are singular\n    // (0xn)*(nx0)*(0xn) = 0xn\n    // (nx0)*(0xn)*(nx0) = nx0\n    return matrix.transpose();\n  }\n  let svdSolution = new SingularValueDecomposition(matrix, { autoTranspose: true });\n\n  let U = svdSolution.leftSingularVectors;\n  let V = svdSolution.rightSingularVectors;\n  let s = svdSolution.diagonal;\n\n  for (let i = 0; i < s.length; i++) {\n    if (Math.abs(s[i]) > threshold) {\n      s[i] = 1.0 / s[i];\n    } else {\n      s[i] = 0.0;\n    }\n  }\n\n  return V.mmul(Matrix.diag(s).mmul(U.transpose()));\n}\n\nfunction covariance(xMatrix, yMatrix = xMatrix, options = {}) {\n  xMatrix = new Matrix(xMatrix);\n  let yIsSame = false;\n  if (\n    typeof yMatrix === 'object' &&\n    !Matrix.isMatrix(yMatrix) &&\n    !isAnyArray(yMatrix)\n  ) {\n    options = yMatrix;\n    yMatrix = xMatrix;\n    yIsSame = true;\n  } else {\n    yMatrix = new Matrix(yMatrix);\n  }\n  if (xMatrix.rows !== yMatrix.rows) {\n    throw new TypeError('Both matrices must have the same number of rows');\n  }\n  const { center = true } = options;\n  if (center) {\n    xMatrix = xMatrix.center('column');\n    if (!yIsSame) {\n      yMatrix = yMatrix.center('column');\n    }\n  }\n  const cov = xMatrix.transpose().mmul(yMatrix);\n  for (let i = 0; i < cov.rows; i++) {\n    for (let j = 0; j < cov.columns; j++) {\n      cov.set(i, j, cov.get(i, j) * (1 / (xMatrix.rows - 1)));\n    }\n  }\n  return cov;\n}\n\nfunction correlation(xMatrix, yMatrix = xMatrix, options = {}) {\n  xMatrix = new Matrix(xMatrix);\n  let yIsSame = false;\n  if (\n    typeof yMatrix === 'object' &&\n    !Matrix.isMatrix(yMatrix) &&\n    !isAnyArray(yMatrix)\n  ) {\n    options = yMatrix;\n    yMatrix = xMatrix;\n    yIsSame = true;\n  } else {\n    yMatrix = new Matrix(yMatrix);\n  }\n  if (xMatrix.rows !== yMatrix.rows) {\n    throw new TypeError('Both matrices must have the same number of rows');\n  }\n\n  const { center = true, scale = true } = options;\n  if (center) {\n    xMatrix.center('column');\n    if (!yIsSame) {\n      yMatrix.center('column');\n    }\n  }\n  if (scale) {\n    xMatrix.scale('column');\n    if (!yIsSame) {\n      yMatrix.scale('column');\n    }\n  }\n\n  const sdx = xMatrix.standardDeviation('column', { unbiased: true });\n  const sdy = yIsSame\n    ? sdx\n    : yMatrix.standardDeviation('column', { unbiased: true });\n\n  const corr = xMatrix.transpose().mmul(yMatrix);\n  for (let i = 0; i < corr.rows; i++) {\n    for (let j = 0; j < corr.columns; j++) {\n      corr.set(\n        i,\n        j,\n        corr.get(i, j) * (1 / (sdx[i] * sdy[j])) * (1 / (xMatrix.rows - 1)),\n      );\n    }\n  }\n  return corr;\n}\n\nclass EigenvalueDecomposition {\n  constructor(matrix, options = {}) {\n    const { assumeSymmetric = false } = options;\n\n    matrix = WrapperMatrix2D.checkMatrix(matrix);\n    if (!matrix.isSquare()) {\n      throw new Error('Matrix is not a square matrix');\n    }\n\n    if (matrix.isEmpty()) {\n      throw new Error('Matrix must be non-empty');\n    }\n\n    let n = matrix.columns;\n    let V = new Matrix(n, n);\n    let d = new Float64Array(n);\n    let e = new Float64Array(n);\n    let value = matrix;\n    let i, j;\n\n    let isSymmetric = false;\n    if (assumeSymmetric) {\n      isSymmetric = true;\n    } else {\n      isSymmetric = matrix.isSymmetric();\n    }\n\n    if (isSymmetric) {\n      for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n          V.set(i, j, value.get(i, j));\n        }\n      }\n      tred2(n, e, d, V);\n      tql2(n, e, d, V);\n    } else {\n      let H = new Matrix(n, n);\n      let ort = new Float64Array(n);\n      for (j = 0; j < n; j++) {\n        for (i = 0; i < n; i++) {\n          H.set(i, j, value.get(i, j));\n        }\n      }\n      orthes(n, H, ort, V);\n      hqr2(n, e, d, V, H);\n    }\n\n    this.n = n;\n    this.e = e;\n    this.d = d;\n    this.V = V;\n  }\n\n  get realEigenvalues() {\n    return Array.from(this.d);\n  }\n\n  get imaginaryEigenvalues() {\n    return Array.from(this.e);\n  }\n\n  get eigenvectorMatrix() {\n    return this.V;\n  }\n\n  get diagonalMatrix() {\n    let n = this.n;\n    let e = this.e;\n    let d = this.d;\n    let X = new Matrix(n, n);\n    let i, j;\n    for (i = 0; i < n; i++) {\n      for (j = 0; j < n; j++) {\n        X.set(i, j, 0);\n      }\n      X.set(i, i, d[i]);\n      if (e[i] > 0) {\n        X.set(i, i + 1, e[i]);\n      } else if (e[i] < 0) {\n        X.set(i, i - 1, e[i]);\n      }\n    }\n    return X;\n  }\n}\n\nfunction tred2(n, e, d, V) {\n  let f, g, h, i, j, k, hh, scale;\n\n  for (j = 0; j < n; j++) {\n    d[j] = V.get(n - 1, j);\n  }\n\n  for (i = n - 1; i > 0; i--) {\n    scale = 0;\n    h = 0;\n    for (k = 0; k < i; k++) {\n      scale = scale + Math.abs(d[k]);\n    }\n\n    if (scale === 0) {\n      e[i] = d[i - 1];\n      for (j = 0; j < i; j++) {\n        d[j] = V.get(i - 1, j);\n        V.set(i, j, 0);\n        V.set(j, i, 0);\n      }\n    } else {\n      for (k = 0; k < i; k++) {\n        d[k] /= scale;\n        h += d[k] * d[k];\n      }\n\n      f = d[i - 1];\n      g = Math.sqrt(h);\n      if (f > 0) {\n        g = -g;\n      }\n\n      e[i] = scale * g;\n      h = h - f * g;\n      d[i - 1] = f - g;\n      for (j = 0; j < i; j++) {\n        e[j] = 0;\n      }\n\n      for (j = 0; j < i; j++) {\n        f = d[j];\n        V.set(j, i, f);\n        g = e[j] + V.get(j, j) * f;\n        for (k = j + 1; k <= i - 1; k++) {\n          g += V.get(k, j) * d[k];\n          e[k] += V.get(k, j) * f;\n        }\n        e[j] = g;\n      }\n\n      f = 0;\n      for (j = 0; j < i; j++) {\n        e[j] /= h;\n        f += e[j] * d[j];\n      }\n\n      hh = f / (h + h);\n      for (j = 0; j < i; j++) {\n        e[j] -= hh * d[j];\n      }\n\n      for (j = 0; j < i; j++) {\n        f = d[j];\n        g = e[j];\n        for (k = j; k <= i - 1; k++) {\n          V.set(k, j, V.get(k, j) - (f * e[k] + g * d[k]));\n        }\n        d[j] = V.get(i - 1, j);\n        V.set(i, j, 0);\n      }\n    }\n    d[i] = h;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    V.set(n - 1, i, V.get(i, i));\n    V.set(i, i, 1);\n    h = d[i + 1];\n    if (h !== 0) {\n      for (k = 0; k <= i; k++) {\n        d[k] = V.get(k, i + 1) / h;\n      }\n\n      for (j = 0; j <= i; j++) {\n        g = 0;\n        for (k = 0; k <= i; k++) {\n          g += V.get(k, i + 1) * V.get(k, j);\n        }\n        for (k = 0; k <= i; k++) {\n          V.set(k, j, V.get(k, j) - g * d[k]);\n        }\n      }\n    }\n\n    for (k = 0; k <= i; k++) {\n      V.set(k, i + 1, 0);\n    }\n  }\n\n  for (j = 0; j < n; j++) {\n    d[j] = V.get(n - 1, j);\n    V.set(n - 1, j, 0);\n  }\n\n  V.set(n - 1, n - 1, 1);\n  e[0] = 0;\n}\n\nfunction tql2(n, e, d, V) {\n  let g, h, i, j, k, l, m, p, r, dl1, c, c2, c3, el1, s, s2;\n\n  for (i = 1; i < n; i++) {\n    e[i - 1] = e[i];\n  }\n\n  e[n - 1] = 0;\n\n  let f = 0;\n  let tst1 = 0;\n  let eps = Number.EPSILON;\n\n  for (l = 0; l < n; l++) {\n    tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l]));\n    m = l;\n    while (m < n) {\n      if (Math.abs(e[m]) <= eps * tst1) {\n        break;\n      }\n      m++;\n    }\n\n    if (m > l) {\n      do {\n\n        g = d[l];\n        p = (d[l + 1] - g) / (2 * e[l]);\n        r = hypotenuse(p, 1);\n        if (p < 0) {\n          r = -r;\n        }\n\n        d[l] = e[l] / (p + r);\n        d[l + 1] = e[l] * (p + r);\n        dl1 = d[l + 1];\n        h = g - d[l];\n        for (i = l + 2; i < n; i++) {\n          d[i] -= h;\n        }\n\n        f = f + h;\n\n        p = d[m];\n        c = 1;\n        c2 = c;\n        c3 = c;\n        el1 = e[l + 1];\n        s = 0;\n        s2 = 0;\n        for (i = m - 1; i >= l; i--) {\n          c3 = c2;\n          c2 = c;\n          s2 = s;\n          g = c * e[i];\n          h = c * p;\n          r = hypotenuse(p, e[i]);\n          e[i + 1] = s * r;\n          s = e[i] / r;\n          c = p / r;\n          p = c * d[i] - s * g;\n          d[i + 1] = h + s * (c * g + s * d[i]);\n\n          for (k = 0; k < n; k++) {\n            h = V.get(k, i + 1);\n            V.set(k, i + 1, s * V.get(k, i) + c * h);\n            V.set(k, i, c * V.get(k, i) - s * h);\n          }\n        }\n\n        p = (-s * s2 * c3 * el1 * e[l]) / dl1;\n        e[l] = s * p;\n        d[l] = c * p;\n      } while (Math.abs(e[l]) > eps * tst1);\n    }\n    d[l] = d[l] + f;\n    e[l] = 0;\n  }\n\n  for (i = 0; i < n - 1; i++) {\n    k = i;\n    p = d[i];\n    for (j = i + 1; j < n; j++) {\n      if (d[j] < p) {\n        k = j;\n        p = d[j];\n      }\n    }\n\n    if (k !== i) {\n      d[k] = d[i];\n      d[i] = p;\n      for (j = 0; j < n; j++) {\n        p = V.get(j, i);\n        V.set(j, i, V.get(j, k));\n        V.set(j, k, p);\n      }\n    }\n  }\n}\n\nfunction orthes(n, H, ort, V) {\n  let low = 0;\n  let high = n - 1;\n  let f, g, h, i, j, m;\n  let scale;\n\n  for (m = low + 1; m <= high - 1; m++) {\n    scale = 0;\n    for (i = m; i <= high; i++) {\n      scale = scale + Math.abs(H.get(i, m - 1));\n    }\n\n    if (scale !== 0) {\n      h = 0;\n      for (i = high; i >= m; i--) {\n        ort[i] = H.get(i, m - 1) / scale;\n        h += ort[i] * ort[i];\n      }\n\n      g = Math.sqrt(h);\n      if (ort[m] > 0) {\n        g = -g;\n      }\n\n      h = h - ort[m] * g;\n      ort[m] = ort[m] - g;\n\n      for (j = m; j < n; j++) {\n        f = 0;\n        for (i = high; i >= m; i--) {\n          f += ort[i] * H.get(i, j);\n        }\n\n        f = f / h;\n        for (i = m; i <= high; i++) {\n          H.set(i, j, H.get(i, j) - f * ort[i]);\n        }\n      }\n\n      for (i = 0; i <= high; i++) {\n        f = 0;\n        for (j = high; j >= m; j--) {\n          f += ort[j] * H.get(i, j);\n        }\n\n        f = f / h;\n        for (j = m; j <= high; j++) {\n          H.set(i, j, H.get(i, j) - f * ort[j]);\n        }\n      }\n\n      ort[m] = scale * ort[m];\n      H.set(m, m - 1, scale * g);\n    }\n  }\n\n  for (i = 0; i < n; i++) {\n    for (j = 0; j < n; j++) {\n      V.set(i, j, i === j ? 1 : 0);\n    }\n  }\n\n  for (m = high - 1; m >= low + 1; m--) {\n    if (H.get(m, m - 1) !== 0) {\n      for (i = m + 1; i <= high; i++) {\n        ort[i] = H.get(i, m - 1);\n      }\n\n      for (j = m; j <= high; j++) {\n        g = 0;\n        for (i = m; i <= high; i++) {\n          g += ort[i] * V.get(i, j);\n        }\n\n        g = g / ort[m] / H.get(m, m - 1);\n        for (i = m; i <= high; i++) {\n          V.set(i, j, V.get(i, j) + g * ort[i]);\n        }\n      }\n    }\n  }\n}\n\nfunction hqr2(nn, e, d, V, H) {\n  let n = nn - 1;\n  let low = 0;\n  let high = nn - 1;\n  let eps = Number.EPSILON;\n  let exshift = 0;\n  let norm = 0;\n  let p = 0;\n  let q = 0;\n  let r = 0;\n  let s = 0;\n  let z = 0;\n  let iter = 0;\n  let i, j, k, l, m, t, w, x, y;\n  let ra, sa, vr, vi;\n  let notlast, cdivres;\n\n  for (i = 0; i < nn; i++) {\n    if (i < low || i > high) {\n      d[i] = H.get(i, i);\n      e[i] = 0;\n    }\n\n    for (j = Math.max(i - 1, 0); j < nn; j++) {\n      norm = norm + Math.abs(H.get(i, j));\n    }\n  }\n\n  while (n >= low) {\n    l = n;\n    while (l > low) {\n      s = Math.abs(H.get(l - 1, l - 1)) + Math.abs(H.get(l, l));\n      if (s === 0) {\n        s = norm;\n      }\n      if (Math.abs(H.get(l, l - 1)) < eps * s) {\n        break;\n      }\n      l--;\n    }\n\n    if (l === n) {\n      H.set(n, n, H.get(n, n) + exshift);\n      d[n] = H.get(n, n);\n      e[n] = 0;\n      n--;\n      iter = 0;\n    } else if (l === n - 1) {\n      w = H.get(n, n - 1) * H.get(n - 1, n);\n      p = (H.get(n - 1, n - 1) - H.get(n, n)) / 2;\n      q = p * p + w;\n      z = Math.sqrt(Math.abs(q));\n      H.set(n, n, H.get(n, n) + exshift);\n      H.set(n - 1, n - 1, H.get(n - 1, n - 1) + exshift);\n      x = H.get(n, n);\n\n      if (q >= 0) {\n        z = p >= 0 ? p + z : p - z;\n        d[n - 1] = x + z;\n        d[n] = d[n - 1];\n        if (z !== 0) {\n          d[n] = x - w / z;\n        }\n        e[n - 1] = 0;\n        e[n] = 0;\n        x = H.get(n, n - 1);\n        s = Math.abs(x) + Math.abs(z);\n        p = x / s;\n        q = z / s;\n        r = Math.sqrt(p * p + q * q);\n        p = p / r;\n        q = q / r;\n\n        for (j = n - 1; j < nn; j++) {\n          z = H.get(n - 1, j);\n          H.set(n - 1, j, q * z + p * H.get(n, j));\n          H.set(n, j, q * H.get(n, j) - p * z);\n        }\n\n        for (i = 0; i <= n; i++) {\n          z = H.get(i, n - 1);\n          H.set(i, n - 1, q * z + p * H.get(i, n));\n          H.set(i, n, q * H.get(i, n) - p * z);\n        }\n\n        for (i = low; i <= high; i++) {\n          z = V.get(i, n - 1);\n          V.set(i, n - 1, q * z + p * V.get(i, n));\n          V.set(i, n, q * V.get(i, n) - p * z);\n        }\n      } else {\n        d[n - 1] = x + p;\n        d[n] = x + p;\n        e[n - 1] = z;\n        e[n] = -z;\n      }\n\n      n = n - 2;\n      iter = 0;\n    } else {\n      x = H.get(n, n);\n      y = 0;\n      w = 0;\n      if (l < n) {\n        y = H.get(n - 1, n - 1);\n        w = H.get(n, n - 1) * H.get(n - 1, n);\n      }\n\n      if (iter === 10) {\n        exshift += x;\n        for (i = low; i <= n; i++) {\n          H.set(i, i, H.get(i, i) - x);\n        }\n        s = Math.abs(H.get(n, n - 1)) + Math.abs(H.get(n - 1, n - 2));\n        // eslint-disable-next-line no-multi-assign\n        x = y = 0.75 * s;\n        w = -0.4375 * s * s;\n      }\n\n      if (iter === 30) {\n        s = (y - x) / 2;\n        s = s * s + w;\n        if (s > 0) {\n          s = Math.sqrt(s);\n          if (y < x) {\n            s = -s;\n          }\n          s = x - w / ((y - x) / 2 + s);\n          for (i = low; i <= n; i++) {\n            H.set(i, i, H.get(i, i) - s);\n          }\n          exshift += s;\n          // eslint-disable-next-line no-multi-assign\n          x = y = w = 0.964;\n        }\n      }\n\n      iter = iter + 1;\n\n      m = n - 2;\n      while (m >= l) {\n        z = H.get(m, m);\n        r = x - z;\n        s = y - z;\n        p = (r * s - w) / H.get(m + 1, m) + H.get(m, m + 1);\n        q = H.get(m + 1, m + 1) - z - r - s;\n        r = H.get(m + 2, m + 1);\n        s = Math.abs(p) + Math.abs(q) + Math.abs(r);\n        p = p / s;\n        q = q / s;\n        r = r / s;\n        if (m === l) {\n          break;\n        }\n        if (\n          Math.abs(H.get(m, m - 1)) * (Math.abs(q) + Math.abs(r)) <\n          eps *\n            (Math.abs(p) *\n              (Math.abs(H.get(m - 1, m - 1)) +\n                Math.abs(z) +\n                Math.abs(H.get(m + 1, m + 1))))\n        ) {\n          break;\n        }\n        m--;\n      }\n\n      for (i = m + 2; i <= n; i++) {\n        H.set(i, i - 2, 0);\n        if (i > m + 2) {\n          H.set(i, i - 3, 0);\n        }\n      }\n\n      for (k = m; k <= n - 1; k++) {\n        notlast = k !== n - 1;\n        if (k !== m) {\n          p = H.get(k, k - 1);\n          q = H.get(k + 1, k - 1);\n          r = notlast ? H.get(k + 2, k - 1) : 0;\n          x = Math.abs(p) + Math.abs(q) + Math.abs(r);\n          if (x !== 0) {\n            p = p / x;\n            q = q / x;\n            r = r / x;\n          }\n        }\n\n        if (x === 0) {\n          break;\n        }\n\n        s = Math.sqrt(p * p + q * q + r * r);\n        if (p < 0) {\n          s = -s;\n        }\n\n        if (s !== 0) {\n          if (k !== m) {\n            H.set(k, k - 1, -s * x);\n          } else if (l !== m) {\n            H.set(k, k - 1, -H.get(k, k - 1));\n          }\n\n          p = p + s;\n          x = p / s;\n          y = q / s;\n          z = r / s;\n          q = q / p;\n          r = r / p;\n\n          for (j = k; j < nn; j++) {\n            p = H.get(k, j) + q * H.get(k + 1, j);\n            if (notlast) {\n              p = p + r * H.get(k + 2, j);\n              H.set(k + 2, j, H.get(k + 2, j) - p * z);\n            }\n\n            H.set(k, j, H.get(k, j) - p * x);\n            H.set(k + 1, j, H.get(k + 1, j) - p * y);\n          }\n\n          for (i = 0; i <= Math.min(n, k + 3); i++) {\n            p = x * H.get(i, k) + y * H.get(i, k + 1);\n            if (notlast) {\n              p = p + z * H.get(i, k + 2);\n              H.set(i, k + 2, H.get(i, k + 2) - p * r);\n            }\n\n            H.set(i, k, H.get(i, k) - p);\n            H.set(i, k + 1, H.get(i, k + 1) - p * q);\n          }\n\n          for (i = low; i <= high; i++) {\n            p = x * V.get(i, k) + y * V.get(i, k + 1);\n            if (notlast) {\n              p = p + z * V.get(i, k + 2);\n              V.set(i, k + 2, V.get(i, k + 2) - p * r);\n            }\n\n            V.set(i, k, V.get(i, k) - p);\n            V.set(i, k + 1, V.get(i, k + 1) - p * q);\n          }\n        }\n      }\n    }\n  }\n\n  if (norm === 0) {\n    return;\n  }\n\n  for (n = nn - 1; n >= 0; n--) {\n    p = d[n];\n    q = e[n];\n\n    if (q === 0) {\n      l = n;\n      H.set(n, n, 1);\n      for (i = n - 1; i >= 0; i--) {\n        w = H.get(i, i) - p;\n        r = 0;\n        for (j = l; j <= n; j++) {\n          r = r + H.get(i, j) * H.get(j, n);\n        }\n\n        if (e[i] < 0) {\n          z = w;\n          s = r;\n        } else {\n          l = i;\n          if (e[i] === 0) {\n            H.set(i, n, w !== 0 ? -r / w : -r / (eps * norm));\n          } else {\n            x = H.get(i, i + 1);\n            y = H.get(i + 1, i);\n            q = (d[i] - p) * (d[i] - p) + e[i] * e[i];\n            t = (x * s - z * r) / q;\n            H.set(i, n, t);\n            H.set(\n              i + 1,\n              n,\n              Math.abs(x) > Math.abs(z) ? (-r - w * t) / x : (-s - y * t) / z,\n            );\n          }\n\n          t = Math.abs(H.get(i, n));\n          if (eps * t * t > 1) {\n            for (j = i; j <= n; j++) {\n              H.set(j, n, H.get(j, n) / t);\n            }\n          }\n        }\n      }\n    } else if (q < 0) {\n      l = n - 1;\n\n      if (Math.abs(H.get(n, n - 1)) > Math.abs(H.get(n - 1, n))) {\n        H.set(n - 1, n - 1, q / H.get(n, n - 1));\n        H.set(n - 1, n, -(H.get(n, n) - p) / H.get(n, n - 1));\n      } else {\n        cdivres = cdiv(0, -H.get(n - 1, n), H.get(n - 1, n - 1) - p, q);\n        H.set(n - 1, n - 1, cdivres[0]);\n        H.set(n - 1, n, cdivres[1]);\n      }\n\n      H.set(n, n - 1, 0);\n      H.set(n, n, 1);\n      for (i = n - 2; i >= 0; i--) {\n        ra = 0;\n        sa = 0;\n        for (j = l; j <= n; j++) {\n          ra = ra + H.get(i, j) * H.get(j, n - 1);\n          sa = sa + H.get(i, j) * H.get(j, n);\n        }\n\n        w = H.get(i, i) - p;\n\n        if (e[i] < 0) {\n          z = w;\n          r = ra;\n          s = sa;\n        } else {\n          l = i;\n          if (e[i] === 0) {\n            cdivres = cdiv(-ra, -sa, w, q);\n            H.set(i, n - 1, cdivres[0]);\n            H.set(i, n, cdivres[1]);\n          } else {\n            x = H.get(i, i + 1);\n            y = H.get(i + 1, i);\n            vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;\n            vi = (d[i] - p) * 2 * q;\n            if (vr === 0 && vi === 0) {\n              vr =\n                eps *\n                norm *\n                (Math.abs(w) +\n                  Math.abs(q) +\n                  Math.abs(x) +\n                  Math.abs(y) +\n                  Math.abs(z));\n            }\n            cdivres = cdiv(\n              x * r - z * ra + q * sa,\n              x * s - z * sa - q * ra,\n              vr,\n              vi,\n            );\n            H.set(i, n - 1, cdivres[0]);\n            H.set(i, n, cdivres[1]);\n            if (Math.abs(x) > Math.abs(z) + Math.abs(q)) {\n              H.set(\n                i + 1,\n                n - 1,\n                (-ra - w * H.get(i, n - 1) + q * H.get(i, n)) / x,\n              );\n              H.set(\n                i + 1,\n                n,\n                (-sa - w * H.get(i, n) - q * H.get(i, n - 1)) / x,\n              );\n            } else {\n              cdivres = cdiv(\n                -r - y * H.get(i, n - 1),\n                -s - y * H.get(i, n),\n                z,\n                q,\n              );\n              H.set(i + 1, n - 1, cdivres[0]);\n              H.set(i + 1, n, cdivres[1]);\n            }\n          }\n\n          t = Math.max(Math.abs(H.get(i, n - 1)), Math.abs(H.get(i, n)));\n          if (eps * t * t > 1) {\n            for (j = i; j <= n; j++) {\n              H.set(j, n - 1, H.get(j, n - 1) / t);\n              H.set(j, n, H.get(j, n) / t);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < nn; i++) {\n    if (i < low || i > high) {\n      for (j = i; j < nn; j++) {\n        V.set(i, j, H.get(i, j));\n      }\n    }\n  }\n\n  for (j = nn - 1; j >= low; j--) {\n    for (i = low; i <= high; i++) {\n      z = 0;\n      for (k = low; k <= Math.min(j, high); k++) {\n        z = z + V.get(i, k) * H.get(k, j);\n      }\n      V.set(i, j, z);\n    }\n  }\n}\n\nfunction cdiv(xr, xi, yr, yi) {\n  let r, d;\n  if (Math.abs(yr) > Math.abs(yi)) {\n    r = yi / yr;\n    d = yr + r * yi;\n    return [(xr + r * xi) / d, (xi - r * xr) / d];\n  } else {\n    r = yr / yi;\n    d = yi + r * yr;\n    return [(r * xr + xi) / d, (r * xi - xr) / d];\n  }\n}\n\nclass CholeskyDecomposition {\n  constructor(value) {\n    value = WrapperMatrix2D.checkMatrix(value);\n    if (!value.isSymmetric()) {\n      throw new Error('Matrix is not symmetric');\n    }\n\n    let a = value;\n    let dimension = a.rows;\n    let l = new Matrix(dimension, dimension);\n    let positiveDefinite = true;\n    let i, j, k;\n\n    for (j = 0; j < dimension; j++) {\n      let d = 0;\n      for (k = 0; k < j; k++) {\n        let s = 0;\n        for (i = 0; i < k; i++) {\n          s += l.get(k, i) * l.get(j, i);\n        }\n        s = (a.get(j, k) - s) / l.get(k, k);\n        l.set(j, k, s);\n        d = d + s * s;\n      }\n\n      d = a.get(j, j) - d;\n\n      positiveDefinite &&= d > 0;\n      l.set(j, j, Math.sqrt(Math.max(d, 0)));\n      for (k = j + 1; k < dimension; k++) {\n        l.set(j, k, 0);\n      }\n    }\n\n    this.L = l;\n    this.positiveDefinite = positiveDefinite;\n  }\n\n  isPositiveDefinite() {\n    return this.positiveDefinite;\n  }\n\n  solve(value) {\n    value = WrapperMatrix2D.checkMatrix(value);\n\n    let l = this.L;\n    let dimension = l.rows;\n\n    if (value.rows !== dimension) {\n      throw new Error('Matrix dimensions do not match');\n    }\n    if (this.isPositiveDefinite() === false) {\n      throw new Error('Matrix is not positive definite');\n    }\n\n    let count = value.columns;\n    let B = value.clone();\n    let i, j, k;\n\n    for (k = 0; k < dimension; k++) {\n      for (j = 0; j < count; j++) {\n        for (i = 0; i < k; i++) {\n          B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(k, i));\n        }\n        B.set(k, j, B.get(k, j) / l.get(k, k));\n      }\n    }\n\n    for (k = dimension - 1; k >= 0; k--) {\n      for (j = 0; j < count; j++) {\n        for (i = k + 1; i < dimension; i++) {\n          B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(i, k));\n        }\n        B.set(k, j, B.get(k, j) / l.get(k, k));\n      }\n    }\n\n    return B;\n  }\n\n  get lowerTriangularMatrix() {\n    return this.L;\n  }\n}\n\nclass nipals {\n  constructor(X, options = {}) {\n    X = WrapperMatrix2D.checkMatrix(X);\n    let { Y } = options;\n    const {\n      scaleScores = false,\n      maxIterations = 1000,\n      terminationCriteria = 1e-10,\n    } = options;\n\n    let u;\n    if (Y) {\n      if (isAnyArray(Y) && typeof Y[0] === 'number') {\n        Y = Matrix.columnVector(Y);\n      } else {\n        Y = WrapperMatrix2D.checkMatrix(Y);\n      }\n      if (Y.rows !== X.rows) {\n        throw new Error('Y should have the same number of rows as X');\n      }\n      u = Y.getColumnVector(0);\n    } else {\n      u = X.getColumnVector(0);\n    }\n\n    let diff = 1;\n    let t, q, w, tOld;\n\n    for (\n      let counter = 0;\n      counter < maxIterations && diff > terminationCriteria;\n      counter++\n    ) {\n      w = X.transpose().mmul(u).div(u.transpose().mmul(u).get(0, 0));\n      w = w.div(w.norm());\n\n      t = X.mmul(w).div(w.transpose().mmul(w).get(0, 0));\n\n      if (counter > 0) {\n        diff = t.clone().sub(tOld).pow(2).sum();\n      }\n      tOld = t.clone();\n\n      if (Y) {\n        q = Y.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n        q = q.div(q.norm());\n\n        u = Y.mmul(q).div(q.transpose().mmul(q).get(0, 0));\n      } else {\n        u = t;\n      }\n    }\n\n    if (Y) {\n      let p = X.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n      p = p.div(p.norm());\n      let xResidual = X.clone().sub(t.clone().mmul(p.transpose()));\n      let residual = u.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n      let yResidual = Y.clone().sub(\n        t.clone().mulS(residual.get(0, 0)).mmul(q.transpose()),\n      );\n\n      this.t = t;\n      this.p = p.transpose();\n      this.w = w.transpose();\n      this.q = q;\n      this.u = u;\n      this.s = t.transpose().mmul(t);\n      this.xResidual = xResidual;\n      this.yResidual = yResidual;\n      this.betas = residual;\n    } else {\n      this.w = w.transpose();\n      this.s = t.transpose().mmul(t).sqrt();\n      if (scaleScores) {\n        this.t = t.clone().div(this.s.get(0, 0));\n      } else {\n        this.t = t;\n      }\n      this.xResidual = X.sub(t.mmul(w.transpose()));\n    }\n  }\n}\n\nexports.AbstractMatrix = AbstractMatrix;\nexports.CHO = CholeskyDecomposition;\nexports.CholeskyDecomposition = CholeskyDecomposition;\nexports.DistanceMatrix = DistanceMatrix;\nexports.EVD = EigenvalueDecomposition;\nexports.EigenvalueDecomposition = EigenvalueDecomposition;\nexports.LU = LuDecomposition;\nexports.LuDecomposition = LuDecomposition;\nexports.Matrix = Matrix;\nexports.MatrixColumnSelectionView = MatrixColumnSelectionView;\nexports.MatrixColumnView = MatrixColumnView;\nexports.MatrixFlipColumnView = MatrixFlipColumnView;\nexports.MatrixFlipRowView = MatrixFlipRowView;\nexports.MatrixRowSelectionView = MatrixRowSelectionView;\nexports.MatrixRowView = MatrixRowView;\nexports.MatrixSelectionView = MatrixSelectionView;\nexports.MatrixSubView = MatrixSubView;\nexports.MatrixTransposeView = MatrixTransposeView;\nexports.NIPALS = nipals;\nexports.Nipals = nipals;\nexports.QR = QrDecomposition;\nexports.QrDecomposition = QrDecomposition;\nexports.SVD = SingularValueDecomposition;\nexports.SingularValueDecomposition = SingularValueDecomposition;\nexports.SymmetricMatrix = SymmetricMatrix;\nexports.WrapperMatrix1D = WrapperMatrix1D;\nexports.WrapperMatrix2D = WrapperMatrix2D;\nexports.correlation = correlation;\nexports.covariance = covariance;\nexports.default = Matrix;\nexports.determinant = determinant;\nexports.inverse = inverse;\nexports.linearDependencies = linearDependencies;\nexports.pseudoInverse = pseudoInverse;\nexports.solve = solve;\nexports.wrap = wrap;\n//# sourceMappingURL=matrix.js.map\n","import * as matrix from './matrix.js';\n\nexport const AbstractMatrix = matrix.AbstractMatrix;\nexport const CHO = matrix.CHO;\nexport const CholeskyDecomposition = matrix.CholeskyDecomposition;\nexport const DistanceMatrix = matrix.DistanceMatrix;\nexport const EVD = matrix.EVD;\nexport const EigenvalueDecomposition = matrix.EigenvalueDecomposition;\nexport const LU = matrix.LU;\nexport const LuDecomposition = matrix.LuDecomposition;\nexport const Matrix = matrix.Matrix;\nexport const MatrixColumnSelectionView = matrix.MatrixColumnSelectionView;\nexport const MatrixColumnView = matrix.MatrixColumnView;\nexport const MatrixFlipColumnView = matrix.MatrixFlipColumnView;\nexport const MatrixFlipRowView = matrix.MatrixFlipRowView;\nexport const MatrixRowSelectionView = matrix.MatrixRowSelectionView;\nexport const MatrixRowView = matrix.MatrixRowView;\nexport const MatrixSelectionView = matrix.MatrixSelectionView;\nexport const MatrixSubView = matrix.MatrixSubView;\nexport const MatrixTransposeView = matrix.MatrixTransposeView;\nexport const NIPALS = matrix.NIPALS;\nexport const Nipals = matrix.Nipals;\nexport const QR = matrix.QR;\nexport const QrDecomposition = matrix.QrDecomposition;\nexport const SVD = matrix.SVD;\nexport const SingularValueDecomposition = matrix.SingularValueDecomposition;\nexport const SymmetricMatrix = matrix.SymmetricMatrix;\nexport const WrapperMatrix1D = matrix.WrapperMatrix1D;\nexport const WrapperMatrix2D = matrix.WrapperMatrix2D;\nexport const correlation = matrix.correlation;\nexport const covariance = matrix.covariance;\nexport default matrix.default.Matrix ? matrix.default.Matrix : matrix.Matrix;\nexport const determinant = matrix.determinant;\nexport const inverse = matrix.inverse;\nexport const linearDependencies = matrix.linearDependencies;\nexport const pseudoInverse = matrix.pseudoInverse;\nexport const solve = matrix.solve;\nexport const wrap = matrix.wrap;\n","import { Matrix } from 'ml-matrix';\nconst absDiff = (a, b) => Math.abs(a - b);\n/**\n * Generate a cost matrix from two set of values using the function passed. by default it\n * generate the cost matrix of absolute value of differences.\n * @param rowsArray - Array of values that will represent the rows of the cost matrix.\n * @param columnsArray - Array of values that will represent the columns of the cost matrix.\n * @param options\n * @returns - A matrix instance with dimensions rowsArray.length x columnsArray.length\n */\nexport function xCostMatrix(rowsArray, columnsArray, options = {}) {\n    const { fct = absDiff } = options;\n    const nbRows = rowsArray.length;\n    const nbColumns = columnsArray.length;\n    const result = new Matrix(nbRows, nbColumns);\n    for (let r = 0; r < nbRows; r++) {\n        for (let c = 0; c < nbColumns; c++) {\n            result.set(r, c, fct(rowsArray[r], columnsArray[c]));\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=xCostMatrix.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Calculate an array of the same size that is the cumulative values\n * @param array - initial array\n */\nexport function xCumulative(array) {\n    if (!isAnyArray(array)) {\n        throw new TypeError('input must be an array');\n    }\n    const newArray = new Float64Array(array.length);\n    if (array.length === 0)\n        return newArray;\n    newArray[0] = array[0];\n    for (let i = 1; i < array.length; i++) {\n        newArray[i] = newArray[i - 1] + array[i];\n    }\n    return newArray;\n}\n//# sourceMappingURL=xCumulative.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the mean value of an array of values.\n * @param array - array of numbers\n * @param options - options\n */\nexport function xMean(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let sumValue = array[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        sumValue += array[i];\n    }\n    return sumValue / (toIndex - fromIndex + 1);\n}\n//# sourceMappingURL=xMean.js.map","import { isAnyArray } from 'is-any-array';\nimport { xMean } from \"./xMean.js\";\n/**\n * Finds the variance of the data\n * @param values - the values of the array\n * @param options - options\n * @returns variance\n */\nexport function xVariance(values, options = {}) {\n    if (!isAnyArray(values)) {\n        throw new TypeError('input must be an array');\n    }\n    const { unbiased = true, mean = xMean(values) } = options;\n    let sqrError = 0;\n    for (const value of values) {\n        const x = value - mean;\n        sqrError += x * x;\n    }\n    if (unbiased) {\n        return sqrError / (values.length - 1);\n    }\n    else {\n        return sqrError / values.length;\n    }\n}\n//# sourceMappingURL=xVariance.js.map","import { xVariance } from \"./xVariance.js\";\n/**\n * Finds the standard deviation for the data at hand\n * @param values - values in the data\n * @param options - options\n * @returns standard deviation\n */\nexport function xStandardDeviation(values, options = {}) {\n    return Math.sqrt(xVariance(values, options));\n}\n//# sourceMappingURL=xStandardDeviation.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Returns a copy of the data as a Float64Array.\n * @param array - array of numbers\n */\nexport function xEnsureFloat64(array) {\n    xCheck(array);\n    if (array instanceof Float64Array) {\n        return array.slice(0);\n    }\n    return Float64Array.from(array);\n}\n//# sourceMappingURL=xEnsureFloat64.js.map","import { xFindClosestIndex } from \"./xFindClosestIndex.js\";\n/**\n *  Returns the targetIndex\n * @param x - array of numbers\n * @param options - options\n */\nexport function xGetTargetIndex(x, options = {}) {\n    const { target, targetIndex } = options;\n    if (targetIndex === undefined) {\n        if (target !== undefined) {\n            return xFindClosestIndex(x, target);\n        }\n        else {\n            return 0;\n        }\n    }\n    return targetIndex;\n}\n//# sourceMappingURL=xGetTargetIndex.js.map","'use strict';\n\nfunction FFT(size) {\n  this.size = size | 0;\n  if (this.size <= 1 || (this.size & (this.size - 1)) !== 0)\n    throw new Error('FFT size must be a power of two and bigger than 1');\n\n  this._csize = size << 1;\n\n  // NOTE: Use of `var` is intentional for old V8 versions\n  var table = new Array(this.size * 2);\n  for (var i = 0; i < table.length; i += 2) {\n    const angle = Math.PI * i / this.size;\n    table[i] = Math.cos(angle);\n    table[i + 1] = -Math.sin(angle);\n  }\n  this.table = table;\n\n  // Find size's power of two\n  var power = 0;\n  for (var t = 1; this.size > t; t <<= 1)\n    power++;\n\n  // Calculate initial step's width:\n  //   * If we are full radix-4 - it is 2x smaller to give inital len=8\n  //   * Otherwise it is the same as `power` to give len=4\n  this._width = power % 2 === 0 ? power - 1 : power;\n\n  // Pre-compute bit-reversal patterns\n  this._bitrev = new Array(1 << this._width);\n  for (var j = 0; j < this._bitrev.length; j++) {\n    this._bitrev[j] = 0;\n    for (var shift = 0; shift < this._width; shift += 2) {\n      var revShift = this._width - shift - 2;\n      this._bitrev[j] |= ((j >>> shift) & 3) << revShift;\n    }\n  }\n\n  this._out = null;\n  this._data = null;\n  this._inv = 0;\n}\nmodule.exports = FFT;\n\nFFT.prototype.fromComplexArray = function fromComplexArray(complex, storage) {\n  var res = storage || new Array(complex.length >>> 1);\n  for (var i = 0; i < complex.length; i += 2)\n    res[i >>> 1] = complex[i];\n  return res;\n};\n\nFFT.prototype.createComplexArray = function createComplexArray() {\n  const res = new Array(this._csize);\n  for (var i = 0; i < res.length; i++)\n    res[i] = 0;\n  return res;\n};\n\nFFT.prototype.toComplexArray = function toComplexArray(input, storage) {\n  var res = storage || this.createComplexArray();\n  for (var i = 0; i < res.length; i += 2) {\n    res[i] = input[i >>> 1];\n    res[i + 1] = 0;\n  }\n  return res;\n};\n\nFFT.prototype.completeSpectrum = function completeSpectrum(spectrum) {\n  var size = this._csize;\n  var half = size >>> 1;\n  for (var i = 2; i < half; i += 2) {\n    spectrum[size - i] = spectrum[i];\n    spectrum[size - i + 1] = -spectrum[i + 1];\n  }\n};\n\nFFT.prototype.transform = function transform(out, data) {\n  if (out === data)\n    throw new Error('Input and output buffers must be different');\n\n  this._out = out;\n  this._data = data;\n  this._inv = 0;\n  this._transform4();\n  this._out = null;\n  this._data = null;\n};\n\nFFT.prototype.realTransform = function realTransform(out, data) {\n  if (out === data)\n    throw new Error('Input and output buffers must be different');\n\n  this._out = out;\n  this._data = data;\n  this._inv = 0;\n  this._realTransform4();\n  this._out = null;\n  this._data = null;\n};\n\nFFT.prototype.inverseTransform = function inverseTransform(out, data) {\n  if (out === data)\n    throw new Error('Input and output buffers must be different');\n\n  this._out = out;\n  this._data = data;\n  this._inv = 1;\n  this._transform4();\n  for (var i = 0; i < out.length; i++)\n    out[i] /= this.size;\n  this._out = null;\n  this._data = null;\n};\n\n// radix-4 implementation\n//\n// NOTE: Uses of `var` are intentional for older V8 version that do not\n// support both `let compound assignments` and `const phi`\nFFT.prototype._transform4 = function _transform4() {\n  var out = this._out;\n  var size = this._csize;\n\n  // Initial step (permute and transform)\n  var width = this._width;\n  var step = 1 << width;\n  var len = (size / step) << 1;\n\n  var outOff;\n  var t;\n  var bitrev = this._bitrev;\n  if (len === 4) {\n    for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n      const off = bitrev[t];\n      this._singleTransform2(outOff, off, step);\n    }\n  } else {\n    // len === 8\n    for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n      const off = bitrev[t];\n      this._singleTransform4(outOff, off, step);\n    }\n  }\n\n  // Loop through steps in decreasing order\n  var inv = this._inv ? -1 : 1;\n  var table = this.table;\n  for (step >>= 2; step >= 2; step >>= 2) {\n    len = (size / step) << 1;\n    var quarterLen = len >>> 2;\n\n    // Loop through offsets in the data\n    for (outOff = 0; outOff < size; outOff += len) {\n      // Full case\n      var limit = outOff + quarterLen;\n      for (var i = outOff, k = 0; i < limit; i += 2, k += step) {\n        const A = i;\n        const B = A + quarterLen;\n        const C = B + quarterLen;\n        const D = C + quarterLen;\n\n        // Original values\n        const Ar = out[A];\n        const Ai = out[A + 1];\n        const Br = out[B];\n        const Bi = out[B + 1];\n        const Cr = out[C];\n        const Ci = out[C + 1];\n        const Dr = out[D];\n        const Di = out[D + 1];\n\n        // Middle values\n        const MAr = Ar;\n        const MAi = Ai;\n\n        const tableBr = table[k];\n        const tableBi = inv * table[k + 1];\n        const MBr = Br * tableBr - Bi * tableBi;\n        const MBi = Br * tableBi + Bi * tableBr;\n\n        const tableCr = table[2 * k];\n        const tableCi = inv * table[2 * k + 1];\n        const MCr = Cr * tableCr - Ci * tableCi;\n        const MCi = Cr * tableCi + Ci * tableCr;\n\n        const tableDr = table[3 * k];\n        const tableDi = inv * table[3 * k + 1];\n        const MDr = Dr * tableDr - Di * tableDi;\n        const MDi = Dr * tableDi + Di * tableDr;\n\n        // Pre-Final values\n        const T0r = MAr + MCr;\n        const T0i = MAi + MCi;\n        const T1r = MAr - MCr;\n        const T1i = MAi - MCi;\n        const T2r = MBr + MDr;\n        const T2i = MBi + MDi;\n        const T3r = inv * (MBr - MDr);\n        const T3i = inv * (MBi - MDi);\n\n        // Final values\n        const FAr = T0r + T2r;\n        const FAi = T0i + T2i;\n\n        const FCr = T0r - T2r;\n        const FCi = T0i - T2i;\n\n        const FBr = T1r + T3i;\n        const FBi = T1i - T3r;\n\n        const FDr = T1r - T3i;\n        const FDi = T1i + T3r;\n\n        out[A] = FAr;\n        out[A + 1] = FAi;\n        out[B] = FBr;\n        out[B + 1] = FBi;\n        out[C] = FCr;\n        out[C + 1] = FCi;\n        out[D] = FDr;\n        out[D + 1] = FDi;\n      }\n    }\n  }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleTransform2 = function _singleTransform2(outOff, off,\n                                                             step) {\n  const out = this._out;\n  const data = this._data;\n\n  const evenR = data[off];\n  const evenI = data[off + 1];\n  const oddR = data[off + step];\n  const oddI = data[off + step + 1];\n\n  const leftR = evenR + oddR;\n  const leftI = evenI + oddI;\n  const rightR = evenR - oddR;\n  const rightI = evenI - oddI;\n\n  out[outOff] = leftR;\n  out[outOff + 1] = leftI;\n  out[outOff + 2] = rightR;\n  out[outOff + 3] = rightI;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleTransform4 = function _singleTransform4(outOff, off,\n                                                             step) {\n  const out = this._out;\n  const data = this._data;\n  const inv = this._inv ? -1 : 1;\n  const step2 = step * 2;\n  const step3 = step * 3;\n\n  // Original values\n  const Ar = data[off];\n  const Ai = data[off + 1];\n  const Br = data[off + step];\n  const Bi = data[off + step + 1];\n  const Cr = data[off + step2];\n  const Ci = data[off + step2 + 1];\n  const Dr = data[off + step3];\n  const Di = data[off + step3 + 1];\n\n  // Pre-Final values\n  const T0r = Ar + Cr;\n  const T0i = Ai + Ci;\n  const T1r = Ar - Cr;\n  const T1i = Ai - Ci;\n  const T2r = Br + Dr;\n  const T2i = Bi + Di;\n  const T3r = inv * (Br - Dr);\n  const T3i = inv * (Bi - Di);\n\n  // Final values\n  const FAr = T0r + T2r;\n  const FAi = T0i + T2i;\n\n  const FBr = T1r + T3i;\n  const FBi = T1i - T3r;\n\n  const FCr = T0r - T2r;\n  const FCi = T0i - T2i;\n\n  const FDr = T1r - T3i;\n  const FDi = T1i + T3r;\n\n  out[outOff] = FAr;\n  out[outOff + 1] = FAi;\n  out[outOff + 2] = FBr;\n  out[outOff + 3] = FBi;\n  out[outOff + 4] = FCr;\n  out[outOff + 5] = FCi;\n  out[outOff + 6] = FDr;\n  out[outOff + 7] = FDi;\n};\n\n// Real input radix-4 implementation\nFFT.prototype._realTransform4 = function _realTransform4() {\n  var out = this._out;\n  var size = this._csize;\n\n  // Initial step (permute and transform)\n  var width = this._width;\n  var step = 1 << width;\n  var len = (size / step) << 1;\n\n  var outOff;\n  var t;\n  var bitrev = this._bitrev;\n  if (len === 4) {\n    for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n      const off = bitrev[t];\n      this._singleRealTransform2(outOff, off >>> 1, step >>> 1);\n    }\n  } else {\n    // len === 8\n    for (outOff = 0, t = 0; outOff < size; outOff += len, t++) {\n      const off = bitrev[t];\n      this._singleRealTransform4(outOff, off >>> 1, step >>> 1);\n    }\n  }\n\n  // Loop through steps in decreasing order\n  var inv = this._inv ? -1 : 1;\n  var table = this.table;\n  for (step >>= 2; step >= 2; step >>= 2) {\n    len = (size / step) << 1;\n    var halfLen = len >>> 1;\n    var quarterLen = halfLen >>> 1;\n    var hquarterLen = quarterLen >>> 1;\n\n    // Loop through offsets in the data\n    for (outOff = 0; outOff < size; outOff += len) {\n      for (var i = 0, k = 0; i <= hquarterLen; i += 2, k += step) {\n        var A = outOff + i;\n        var B = A + quarterLen;\n        var C = B + quarterLen;\n        var D = C + quarterLen;\n\n        // Original values\n        var Ar = out[A];\n        var Ai = out[A + 1];\n        var Br = out[B];\n        var Bi = out[B + 1];\n        var Cr = out[C];\n        var Ci = out[C + 1];\n        var Dr = out[D];\n        var Di = out[D + 1];\n\n        // Middle values\n        var MAr = Ar;\n        var MAi = Ai;\n\n        var tableBr = table[k];\n        var tableBi = inv * table[k + 1];\n        var MBr = Br * tableBr - Bi * tableBi;\n        var MBi = Br * tableBi + Bi * tableBr;\n\n        var tableCr = table[2 * k];\n        var tableCi = inv * table[2 * k + 1];\n        var MCr = Cr * tableCr - Ci * tableCi;\n        var MCi = Cr * tableCi + Ci * tableCr;\n\n        var tableDr = table[3 * k];\n        var tableDi = inv * table[3 * k + 1];\n        var MDr = Dr * tableDr - Di * tableDi;\n        var MDi = Dr * tableDi + Di * tableDr;\n\n        // Pre-Final values\n        var T0r = MAr + MCr;\n        var T0i = MAi + MCi;\n        var T1r = MAr - MCr;\n        var T1i = MAi - MCi;\n        var T2r = MBr + MDr;\n        var T2i = MBi + MDi;\n        var T3r = inv * (MBr - MDr);\n        var T3i = inv * (MBi - MDi);\n\n        // Final values\n        var FAr = T0r + T2r;\n        var FAi = T0i + T2i;\n\n        var FBr = T1r + T3i;\n        var FBi = T1i - T3r;\n\n        out[A] = FAr;\n        out[A + 1] = FAi;\n        out[B] = FBr;\n        out[B + 1] = FBi;\n\n        // Output final middle point\n        if (i === 0) {\n          var FCr = T0r - T2r;\n          var FCi = T0i - T2i;\n          out[C] = FCr;\n          out[C + 1] = FCi;\n          continue;\n        }\n\n        // Do not overwrite ourselves\n        if (i === hquarterLen)\n          continue;\n\n        // In the flipped case:\n        // MAi = -MAi\n        // MBr=-MBi, MBi=-MBr\n        // MCr=-MCr\n        // MDr=MDi, MDi=MDr\n        var ST0r = T1r;\n        var ST0i = -T1i;\n        var ST1r = T0r;\n        var ST1i = -T0i;\n        var ST2r = -inv * T3i;\n        var ST2i = -inv * T3r;\n        var ST3r = -inv * T2i;\n        var ST3i = -inv * T2r;\n\n        var SFAr = ST0r + ST2r;\n        var SFAi = ST0i + ST2i;\n\n        var SFBr = ST1r + ST3i;\n        var SFBi = ST1i - ST3r;\n\n        var SA = outOff + quarterLen - i;\n        var SB = outOff + halfLen - i;\n\n        out[SA] = SFAr;\n        out[SA + 1] = SFAi;\n        out[SB] = SFBr;\n        out[SB + 1] = SFBi;\n      }\n    }\n  }\n};\n\n// radix-2 implementation\n//\n// NOTE: Only called for len=4\nFFT.prototype._singleRealTransform2 = function _singleRealTransform2(outOff,\n                                                                     off,\n                                                                     step) {\n  const out = this._out;\n  const data = this._data;\n\n  const evenR = data[off];\n  const oddR = data[off + step];\n\n  const leftR = evenR + oddR;\n  const rightR = evenR - oddR;\n\n  out[outOff] = leftR;\n  out[outOff + 1] = 0;\n  out[outOff + 2] = rightR;\n  out[outOff + 3] = 0;\n};\n\n// radix-4\n//\n// NOTE: Only called for len=8\nFFT.prototype._singleRealTransform4 = function _singleRealTransform4(outOff,\n                                                                     off,\n                                                                     step) {\n  const out = this._out;\n  const data = this._data;\n  const inv = this._inv ? -1 : 1;\n  const step2 = step * 2;\n  const step3 = step * 3;\n\n  // Original values\n  const Ar = data[off];\n  const Br = data[off + step];\n  const Cr = data[off + step2];\n  const Dr = data[off + step3];\n\n  // Pre-Final values\n  const T0r = Ar + Cr;\n  const T1r = Ar - Cr;\n  const T2r = Br + Dr;\n  const T3r = inv * (Br - Dr);\n\n  // Final values\n  const FAr = T0r + T2r;\n\n  const FBr = T1r;\n  const FBi = -T3r;\n\n  const FCr = T0r - T2r;\n\n  const FDr = T1r;\n  const FDi = T3r;\n\n  out[outOff] = FAr;\n  out[outOff + 1] = 0;\n  out[outOff + 2] = FBr;\n  out[outOff + 3] = FBi;\n  out[outOff + 4] = FCr;\n  out[outOff + 5] = 0;\n  out[outOff + 6] = FDr;\n  out[outOff + 7] = FDi;\n};\n","export function createNumberArray(ArrayConstructor, length) {\n    if (ArrayConstructor === Array) {\n        return new ArrayConstructor(length).fill(0);\n    }\n    else {\n        return new ArrayConstructor(length);\n    }\n}\nexport function createDoubleArray(ArrayConstructor, length) {\n    if (ArrayConstructor === Array) {\n        return new ArrayConstructor(length).fill(0);\n    }\n    else {\n        return new ArrayConstructor(length);\n    }\n}\n//# sourceMappingURL=createArray.js.map","/**\n * Create an array with numbers between \"from\" and \"to\" of length \"length\"\n * @param options - options\n * @returns - array of distributed numbers between \"from\" and \"to\"\n */\nexport function createFromToArray(options = {}) {\n    const { from = 0, to = 1, length = 1000, includeFrom = true, includeTo = true, distribution = 'uniform', } = options;\n    const array = new Float64Array(length);\n    let div = length;\n    if (includeFrom && includeTo) {\n        div = length - 1;\n    }\n    else if ((!includeFrom && includeTo) || (includeFrom && !includeTo)) {\n        div = length;\n    }\n    else if (!includeFrom && !includeTo) {\n        div = length + 1;\n    }\n    const delta = (to - from) / div;\n    if (distribution === 'uniform') {\n        if (includeFrom) {\n            let index = 0;\n            while (index < length) {\n                array[index] = from + delta * index;\n                index++;\n            }\n        }\n        else {\n            let index = 0;\n            while (index < length) {\n                array[index] = from + delta * (index + 1);\n                index++;\n            }\n        }\n    }\n    else if (distribution === 'log') {\n        const base = (to / from) ** (1 / div);\n        const firstExponent = Math.log(from) / Math.log(base);\n        if (includeFrom) {\n            let index = 0;\n            while (index < length) {\n                array[index] = base ** (firstExponent + index);\n                index++;\n            }\n        }\n        else {\n            let index = 0;\n            while (index < length) {\n                array[index] = base ** (firstExponent + index + 1);\n                index++;\n            }\n        }\n    }\n    else {\n        throw new Error('distribution must be uniform or log');\n    }\n    return array;\n}\n//# sourceMappingURL=createFromToArray.js.map","const LOOP = 8;\nconst FLOAT_MUL = 1 / 16777216;\nconst sh1 = 15;\nconst sh2 = 18;\nconst sh3 = 11;\nfunction multiplyUint32(n, m) {\n    n >>>= 0;\n    m >>>= 0;\n    const nlo = n & 0xffff;\n    const nhi = n - nlo;\n    return (((nhi * m) >>> 0) + nlo * m) >>> 0;\n}\nexport class XSadd {\n    random;\n    state;\n    /**\n     * create an instance of XSadd with the specified seed\n     * @param [seed=Date.now()]\n     */\n    constructor(seed = Date.now()) {\n        this.state = new Uint32Array(4);\n        this.init(seed);\n        this.random = this.getFloat.bind(this);\n    }\n    /**\n     * Returns a 32-bit integer r (0 <= r < 2^32)\n     */\n    getUint32() {\n        this.nextState();\n        return (this.state[3] + this.state[2]) >>> 0;\n    }\n    /**\n     * Returns a floating point number r (0.0 <= r < 1.0)\n     */\n    getFloat() {\n        return (this.getUint32() >>> 8) * FLOAT_MUL;\n    }\n    init(seed) {\n        if (!Number.isInteger(seed)) {\n            throw new TypeError(\"seed must be an integer\");\n        }\n        this.state[0] = seed;\n        this.state[1] = 0;\n        this.state[2] = 0;\n        this.state[3] = 0;\n        for (let i = 1; i < LOOP; i++) {\n            this.state[i & 3] ^=\n                (i +\n                    multiplyUint32(1812433253, this.state[(i - 1) & 3] ^ ((this.state[(i - 1) & 3] >>> 30) >>> 0))) >>>\n                    0;\n        }\n        this.periodCertification();\n        for (let i = 0; i < LOOP; i++) {\n            this.nextState();\n        }\n    }\n    periodCertification() {\n        if (this.state[0] === 0 &&\n            this.state[1] === 0 &&\n            this.state[2] === 0 &&\n            this.state[3] === 0) {\n            this.state[0] = 88; // X\n            this.state[1] = 83; // S\n            this.state[2] = 65; // A\n            this.state[3] = 68; // D\n        }\n    }\n    nextState() {\n        let t = this.state[0];\n        t ^= t << sh1;\n        t ^= t >>> sh2;\n        t ^= this.state[3] << sh3;\n        this.state[0] = this.state[1];\n        this.state[1] = this.state[2];\n        this.state[2] = this.state[3];\n        this.state[3] = t;\n    }\n}\n//# sourceMappingURL=XSadd.js.map","import { XSadd } from 'ml-xsadd';\n/**\n * Create a random array of numbers of a specific length.\n * @param options\n * @returns - array of random floats normally distributed\n */\nexport function createRandomArray(options = {}) {\n    const { mean = 0, standardDeviation = 1, length = 1000, range = 1, seed, distribution = 'normal', } = options;\n    const generator = new XSadd(seed);\n    const returnArray = new Float64Array(length);\n    switch (distribution) {\n        case 'normal': {\n            const gaussianGenerator = new GaussianGenerator(mean, standardDeviation, generator);\n            for (let i = 0; i < length; i++) {\n                returnArray[i] = gaussianGenerator.generateGaussian();\n            }\n            break;\n        }\n        case 'uniform': {\n            for (let i = 0; i < length; i++) {\n                returnArray[i] = (generator.random() - 0.5) * range + mean;\n            }\n            break;\n        }\n        default: {\n            throw new Error(`unknown distribution: ${String(distribution)}`);\n        }\n    }\n    return returnArray;\n}\nclass GaussianGenerator {\n    #spare = 0;\n    #hasSpare = false;\n    #mean;\n    #standardDeviation;\n    #generator;\n    constructor(mean, standardDeviation, generator) {\n        this.#mean = mean;\n        this.#standardDeviation = standardDeviation;\n        this.#generator = generator;\n    }\n    generateGaussian() {\n        let val, u, v, s;\n        if (this.#hasSpare) {\n            this.#hasSpare = false;\n            val = this.#spare * this.#standardDeviation + this.#mean;\n        }\n        else {\n            do {\n                u = this.#generator.random() * 2 - 1;\n                v = this.#generator.random() * 2 - 1;\n                s = u * u + v * v;\n            } while (s >= 1 || s === 0);\n            s = Math.sqrt((-2 * Math.log(s)) / s);\n            this.#spare = v * s;\n            this.#hasSpare = true;\n            val = this.#mean + this.#standardDeviation * u * s;\n        }\n        return val;\n    }\n}\n//# sourceMappingURL=createRandomArray.js.map","/**\n * Check if a number is a power of two.\n * @param n\n */\nexport function isPowerOfTwo(n) {\n    return n !== 0 && (n & (n - 1)) === 0;\n}\n//# sourceMappingURL=isPowerOfTwo.js.map","/**\n * Get the size of the next power of two.\n * @param n\n */\nexport function nextPowerOfTwo(n) {\n    if (n === 0)\n        return 1;\n    n--;\n    n |= n >> 1;\n    n |= n >> 2;\n    n |= n >> 4;\n    n |= n >> 8;\n    n |= n >> 16;\n    return n + 1;\n}\n//# sourceMappingURL=nextPowerOfTwo.js.map","/**\n * Resolves all promises in an object recursively. The promise with be replaced by the resolved value.\n * The changes are therefore done in-place !\n * @param object\n * @returns\n */\nexport async function recursiveResolve(object) {\n    if (typeof object !== 'object')\n        return object;\n    const promises = [];\n    await appendPromises(object, promises);\n    await Promise.all(promises);\n    return object;\n}\nfunction appendPromises(object, promises) {\n    if (typeof object !== 'object')\n        return object;\n    for (const key in object) {\n        if (typeof object[key].then === 'function') {\n            promises.push(object[key].then((value) => (object[key] = value)));\n        }\n        else if (typeof object[key] === 'object') {\n            appendPromises(object[key], promises);\n        }\n    }\n    return object;\n}\n//# sourceMappingURL=recursiveResolve.js.map","/**\n * Recursively change the typed arrays to normal arrays\n * The changes are done in-place !\n * @param object\n * @returns\n */\nexport function recursiveUntypeArrays(object) {\n    if (typeof object !== 'object')\n        return object;\n    object = modifier(object);\n    return object;\n}\nfunction modifier(object) {\n    if (typeof object !== 'object')\n        return object;\n    if (ArrayBuffer.isView(object)) {\n        return Array.from(object);\n    }\n    for (const key in object) {\n        if (ArrayBuffer.isView(object[key])) {\n            object[key] = Array.from(object[key]);\n        }\n        else if (typeof object[key] === 'object') {\n            modifier(object[key]);\n        }\n    }\n    return object;\n}\n//# sourceMappingURL=recursiveUntypeArrays.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * This function xSubtract the first array by the second array or a constant value from each element of the first array\n * @param array1 - the array that will be rotated\n * @param array2 - second array or number\n * @returns array after subtraction\n */\nexport function xSubtract(array1, array2) {\n    let isConstant = false;\n    let constant = 0;\n    if (isAnyArray(array2)) {\n        if (array1.length !== array2.length) {\n            throw new Error('size of array1 and array2 must be identical');\n        }\n    }\n    else {\n        isConstant = true;\n        constant = array2;\n    }\n    const array3 = new Float64Array(array1.length);\n    if (isConstant) {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] - constant;\n        }\n    }\n    else {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] - array2[i];\n        }\n    }\n    return array3;\n}\n//# sourceMappingURL=xSubtract.js.map","import { xAbsolute } from \"../x/xAbsolute.js\";\nimport { xMedian } from \"../x/xMedian.js\";\nimport { xSubtract } from \"../x/xSubtract.js\";\n/**\n * Calculate the weights based on the control points and the MAD between the original data and the new baseline.\n * MAD (Median Absolute Deviation) is more robust to outliers and\n * the factor (1.4826) makes MAD scaled to be equivalent to the standard deviation for\n * normal distributions. {@link https://en.m.wikipedia.org/wiki/Median_absolute_deviation}.\n * @param yData - The original data.\n * @param baseline - The new baseline calculated.\n * @param weights - The current weights to be updated.\n * @param options - Options for updating weights.\n * @returns new array of weights.\n */\nexport function calculateAdaptiveWeights(yData, baseline, weights, options) {\n    const { controlPoints, factorStd = 3, learningRate = 0.5 } = options;\n    if (learningRate === 0) {\n        return weights;\n    }\n    const absResiduals = xAbsolute(xSubtract(yData, baseline));\n    const medAbsRes = xMedian(absResiduals);\n    const mad = 1.4826 * medAbsRes;\n    const threshold = mad > 0 ? factorStd * mad : 1;\n    const rawWeights = new Float64Array(absResiduals.length);\n    for (let i = 0; i < absResiduals.length; i++) {\n        rawWeights[i] = Math.exp(-((absResiduals[i] / threshold) ** 2));\n    }\n    const oneMinusLearningRate = 1 - learningRate;\n    for (let i = 0; i < weights.length; i++) {\n        let weight = weights[i];\n        weight = (oneMinusLearningRate * weight + learningRate * rawWeights[i]) / 4;\n        if (controlPoints && controlPoints[i] > 0) {\n            weight *= 4;\n        }\n        weights[i] = weight;\n    }\n    weights[0] = 1;\n    weights[weights.length - 1] = 1;\n    return weights;\n}\n//# sourceMappingURL=calculateAdaptiveWeights.js.map","/*\n * This file is based on the code from \"deep-cleaner\" by darksinge\n * https://github.com/darksinge/deep-cleaner\n *\n * The following license applies:\n *\n * MIT License\n *\n * Copyright (c) 2021 darksinge\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/**\n * Recursively removes empty values from an object. This will also remove empty object or empty array.\n * @param object - the object being cleaned\n * @param options - Optional object with options for cleaning\n * @returns the cleaned object\n */\nexport function recursiveRemoveEmptyAndNull(object, options = {}) {\n    const { propertiesToRemove = [], ...otherOptions } = options;\n    if (propertiesToRemove.length > 0) {\n        for (const removeProperty of propertiesToRemove) {\n            cleanCyclicObject(object, removeProperty, otherOptions);\n        }\n    }\n    else {\n        cleanCyclicObject(object, '', otherOptions);\n    }\n    return object;\n}\n/**\n * cleanCyclicObject Removes any undefined, null, or empty strings, arrays, or objects from `object`.\n *    Uses a `WeakMap` to keep track of objects that have been visited while recursively cleaning\n *    an object to prevent infinite recursive calls.\n * @param object - the object to be cleaned\n * @param propertiesToRemove - Optional key to remove from `object`. If not specified, the default\n *    behavior is to remove \"empty\" values from `object`. A value is considered to be empty if it\n *    is one of the following:\n *      - empty strings\n *      - empty arrays\n *      - empty objects\n *      - values that are null\n *      - values that are undefined\n * @param removeProperty\n * @param options\n */\nfunction cleanCyclicObject(object, removeProperty, options = {}) {\n    const visitedObjects = new WeakMap();\n    function recursiveClean(object, parent, parentKey) {\n        if (isObject(object)) {\n            if (visitedObjects.has(object))\n                return;\n            visitedObjects.set(object, null);\n            for (const key of Reflect.ownKeys(object)) {\n                if ((removeProperty && key === removeProperty) ||\n                    (!removeProperty && isEmpty(object[key]))) {\n                    Reflect.deleteProperty(object, key);\n                }\n                else {\n                    recursiveClean(object[key], object, key);\n                }\n            }\n            if (!removeProperty && isEmpty(object) && parent) {\n                Reflect.deleteProperty(parent, parentKey);\n            }\n        }\n        else if (isArray(object)) {\n            if (visitedObjects.has(object))\n                return;\n            visitedObjects.set(object, null);\n            for (let i = 0; i < object.length; i++) {\n                recursiveClean(object[i], object, i);\n            }\n            for (let i = object.length - 1; i >= 0; i--) {\n                const arrayElement = object[i];\n                if (isEmpty(arrayElement) &&\n                    !(isArray(arrayElement) &&\n                        arrayElement.length === 0 &&\n                        options?.removeEmptyArrayAndObject === false)) {\n                    object.splice(i, 1);\n                }\n            }\n            for (const key of Reflect.ownKeys(object)) {\n                const isIndex = typeof key === 'string' && /^\\d+$/.test(key);\n                if (!isIndex) {\n                    const value = object[key];\n                    if ((removeProperty && key === removeProperty) ||\n                        (!removeProperty && isEmpty(value))) {\n                        Reflect.deleteProperty(object, key);\n                    }\n                    else {\n                        recursiveClean(value, object, key);\n                    }\n                }\n            }\n            if (!removeProperty &&\n                object.length === 0 &&\n                parent &&\n                options?.removeEmptyArrayAndObject) {\n                Reflect.deleteProperty(parent, parentKey);\n            }\n        }\n    }\n    recursiveClean(object);\n}\n/**\n * repr gets the string representation of `arg`\n * @param {} arg - unknown function argument\n * @returns a string representation of `arg`\n */\nfunction repr(arg) {\n    return Object.prototype.toString.call(arg);\n}\n/**\n * Check if the argument is an array\n * @param {} arg - unknown function argument\n * @returns returns true if `arg` is an Array, false otherwise\n */\nfunction isArray(arg) {\n    return Array.isArray ? Array.isArray(arg) : repr(arg) === '[object Array]';\n}\n/**\n * Check if the argument is an object\n * @param {} arg - unknown function argument\n * @returns returns true if `arg` is an object.\n */\nfunction isObject(arg) {\n    return repr(arg) === '[object Object]';\n}\n/**\n * Check if the argument is a string\n * @param {} arg - unknown function argument\n * @returns returns true if `arg` is a String, false otherwise\n */\nfunction isString(arg) {\n    return repr(arg) === '[object String]';\n}\n/**\n * Check if the argument is null.\n * @param {} arg - unknown function argument\n * @returns returns true if `arg` is of type Null, false otherwise\n */\nfunction isNull(arg) {\n    return repr(arg) === '[object Null]';\n}\n/**\n * Check if the argument is undefined.\n * @param {} arg - unknown function argument\n * @returns Returns true if `arg` is of type Undefined, false otherwise\n */\nfunction isUndefined(arg) {\n    return arg === undefined;\n}\n/**\n * Check if the argument is null, undefined, an empty string, array, or object.\n * @param {} arg - unknown function argument\n * @returns Returns true if `arg` is an empty string,\n *  array, or object. Also returns true is `arg` is null or\n *  undefined. Returns true otherwise.\n */\nfunction isEmpty(arg) {\n    return (isUndefined(arg) ||\n        isNull(arg) ||\n        (isString(arg) && arg.length === 0) ||\n        (isArray(arg) && arg.length === 0) ||\n        (isObject(arg) && Object.keys(arg).length === 0));\n}\n//# sourceMappingURL=recursiveRemoveEmptyAndNull.js.map","import FFT from 'fft.js';\nimport { isPowerOfTwo, nextPowerOfTwo } from \"../utils/index.js\";\nimport { xCheck } from \"./xCheck.js\";\n/**\n * Performs the Hilbert transform\n * @link https://en.wikipedia.org/wiki/Hilbert_transform\n * @param array - Array containing values\n * @param options\n * @returns A new vector with 90 degree shift regarding the phase of the original function\n */\nexport function xHilbertTransform(array, options = {}) {\n    xCheck(array);\n    const { forceFFT = false } = options;\n    const length = array.length;\n    if (isPowerOfTwo(length)) {\n        return hilbertTransformWithFFT(array);\n    }\n    else if (forceFFT) {\n        return resampling(hilbertTransformWithFFT(resampling(array, nextPowerOfTwo(length))), length);\n    }\n    else {\n        return hilbertTransform(array);\n    }\n}\n/**\n * Performs the discrete Hilbert transform using fast Fourier transform\n * @param array - Array containing values\n * @returns A new vector with 90 degree shift regarding the phase of the original function\n * @see DOI: 10.1109/TAU.1970.1162139 \"Discrete Hilbert transform\"\n */\nfunction hilbertTransformWithFFT(array) {\n    const length = array.length;\n    const fft = new FFT(length);\n    // Single reusable buffer for FFT spectrum\n    const spectrum = new Float64Array(length * 2);\n    // Forward FFT\n    fft.realTransform(spectrum, array);\n    fft.completeSpectrum(spectrum);\n    const half = length >> 1;\n    // Zero Nyquist\n    const j = half << 1;\n    spectrum[j] = 0;\n    spectrum[j + 1] = 0;\n    // Negate negative frequencies\n    for (let j = (half + 1) << 1; j < spectrum.length; j += 2) {\n        spectrum[j] = -spectrum[j];\n        spectrum[j + 1] = -spectrum[j + 1];\n    }\n    const hilbertSignal = new Float64Array(length * 2);\n    fft.inverseTransform(hilbertSignal, spectrum);\n    // Extract imaginary part directly into output\n    const result = new Float64Array(length);\n    for (let i = 0; i < length; i++) {\n        result[i] = hilbertSignal[i * 2 + 1];\n    }\n    return result;\n}\n/**\n * Performs the discrete Hilbert transform\n * @param array - Array containing values\n * @param options\n * @param options.inClockwise\n * @returns A new vector with 90 degree shift regarding the phase of the original function\n */\nfunction hilbertTransform(array, options = {}) {\n    const { inClockwise = true } = options;\n    const input = [0, ...array, 0];\n    const result = new Float64Array(array.length);\n    for (let k = 1; k < input.length - 1; k++) {\n        let aSum = 0;\n        for (let i = 0; i < k - 1; i++) {\n            const log = Math.log((k - i) / (k - i - 1));\n            aSum += input[i] * log + (input[i + 1] - input[i]) * (-1 + (k - i) * log);\n        }\n        const b = input[k - 1] - input[k + 1];\n        let cSum = 0;\n        for (let i = k + 1; i < input.length - 1; i++) {\n            const log = Math.log((i - k) / (i - k + 1));\n            cSum += input[i] * log + (input[i - 1] - input[i]) * (1 + (i - k) * log);\n        }\n        result[k - 1] = ((inClockwise ? 1 : -1) * (aSum + b + cSum)) / Math.PI;\n    }\n    return result;\n}\n/**\n * Performs resampling of an input array to the desired length employing linear interpolation.\n * @param array - Array containing values.\n * @param length - The length of the resulting array.\n * @returns It returns a new array of the desired length.\n * @link https://en.wikipedia.org/wiki/Sample-rate_conversion\n */\nfunction resampling(array, length) {\n    xCheck(array);\n    const oldLength = array.length;\n    const ratio = (oldLength - 1) / (length - 1);\n    const result = new Float64Array(length);\n    let currentIndex = 0;\n    let floor = Math.floor(currentIndex);\n    let ceil = Math.min(Math.ceil(currentIndex), oldLength - 1);\n    let diff = currentIndex - floor;\n    for (let i = 0; i < length; i++) {\n        result[i] = array[floor] * (1 - diff) + array[ceil] * diff;\n        currentIndex += ratio;\n        floor = Math.floor(currentIndex);\n        ceil = Math.min(Math.ceil(currentIndex), oldLength - 1);\n        diff = currentIndex - floor;\n    }\n    return result;\n}\n//# sourceMappingURL=xHilbertTransform.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the maximal value of an array of values\n * @param array - array of numbers\n * @param options - options\n */\nexport function xMaxValue(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let maxValue = array[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        if (array[i] > maxValue) {\n            maxValue = array[i];\n        }\n    }\n    return maxValue;\n}\n//# sourceMappingURL=xMaxValue.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the minimal value of an array of values.\n * @param array - array of numbers\n * @param options - options\n */\nexport function xMinValue(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let minValue = array[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        if (array[i] < minValue) {\n            minValue = array[i];\n        }\n    }\n    return minValue;\n}\n//# sourceMappingURL=xMinValue.js.map","import { createFromToArray } from \"../utils/index.js\";\nimport { xAbsolute } from \"./xAbsolute.js\";\nimport { xCheck } from \"./xCheck.js\";\nimport { xMaxValue } from \"./xMaxValue.js\";\nimport { xMinValue } from \"./xMinValue.js\";\n/**\n * Calculates a histogram of defined number of slots\n * @param array - Array containing values\n * @param options - options\n * @returns - result of the histogram\n */\nexport function xHistogram(array, options = {}) {\n    xCheck(array);\n    const histogram = options.histogram;\n    const { centerX = true, nbSlots = histogram === undefined ? 256 : histogram.x.length, logBaseX, logBaseY, absolute = false, } = options;\n    if (absolute) {\n        array = xAbsolute(array);\n    }\n    if (logBaseX) {\n        array = array.slice();\n        const logOfBase = Math.log10(logBaseX);\n        for (let i = 0; i < array.length; i++) {\n            array[i] = Math.log10(array[i]) / logOfBase;\n        }\n    }\n    const { min = xMinValue(array), max = xMaxValue(array) } = options;\n    const slotSize = (max - min) / (nbSlots + Number.EPSILON);\n    const y = histogram === undefined ? new Float64Array(nbSlots) : histogram.y;\n    const x = histogram === undefined\n        ? Array.from(createFromToArray({\n            from: min + (centerX ? slotSize / 2 : 0),\n            to: max - (centerX ? slotSize / 2 : 0),\n            length: nbSlots,\n        }))\n        : histogram.x;\n    for (const element of array) {\n        const index = Math.max(Math.min(Math.floor((element - min - Number.EPSILON) / slotSize), nbSlots - 1), 0);\n        y[index]++;\n    }\n    if (logBaseY) {\n        const logOfBase = Math.log10(logBaseY);\n        for (let i = 0; i < y.length; i++) {\n            y[i] = Math.log10(y[i] + 1) / logOfBase;\n        }\n    }\n    return { x, y };\n}\n//# sourceMappingURL=xHistogram.js.map","/**\n * Check if the values are separated always by the same difference\n * @param array - Monotone growing array of number\n * @param options\n */\nexport function xIsEquallySpaced(array, options = {}) {\n    if (array.length < 3)\n        return true;\n    const { tolerance = 0.05 } = options;\n    let maxDx = 0;\n    let minDx = Number.MAX_SAFE_INTEGER;\n    for (let i = 0; i < array.length - 1; ++i) {\n        const absoluteDifference = array[i + 1] - array[i];\n        if (absoluteDifference < minDx) {\n            minDx = absoluteDifference;\n        }\n        if (absoluteDifference > maxDx) {\n            maxDx = absoluteDifference;\n        }\n    }\n    return (maxDx - minDx) / maxDx < tolerance;\n}\n//# sourceMappingURL=xIsEquallySpaced.js.map","/**\n * Returns true if x is monotonic.\n * @param array - array of numbers.\n * @returns 1 if monotonic increasing, -1 if monotonic decreasing, 0 if not monotonic.\n */\nexport function xIsMonotonic(array) {\n    if (array.length <= 2) {\n        return 1;\n    }\n    if (array[0] === array[1]) {\n        // maybe a constant series\n        for (let i = 1; i < array.length - 1; i++) {\n            if (array[i] !== array[i + 1])\n                return 0;\n        }\n        return 1;\n    }\n    if (array[0] < array.at(-1)) {\n        for (let i = 0; i < array.length - 1; i++) {\n            if (array[i] >= array[i + 1])\n                return 0;\n        }\n        return 1;\n    }\n    else {\n        for (let i = 0; i < array.length - 1; i++) {\n            if (array[i] <= array[i + 1])\n                return 0;\n        }\n        return -1;\n    }\n}\n//# sourceMappingURL=xIsMonotonic.js.map","/**\n * Check the similarity between array created by xyMassCenterVector\n * @param array1\n * @param array2\n * @param options\n * @returns\n */\nexport function xMassCenterVectorSimilarity(array1, array2, options = {}) {\n    const { recenter = true, similarityFct = (a, b) => (a === b ? 1 : 0), } = options;\n    const depth1 = getDepth(array1);\n    const depth2 = getDepth(array2);\n    const depth = Math.min(depth1, depth2);\n    // need to copy the array because we shift the data in place if recenter is true\n    if (recenter) {\n        array1 = array1.slice();\n    }\n    let similarity = 0;\n    // we will compare level by level\n    // and recenter the array at each level\n    for (let level = 0; level < depth; level++) {\n        const maxSimilarity = 1 / depth / (1 << level);\n        for (let slot = 0; slot < 1 << level; slot++) {\n            const index = (1 << level) - 1 + slot;\n            const value1 = array1[index];\n            const value2 = array2[index];\n            similarity += similarityFct(value1, value2) * maxSimilarity;\n            if (recenter) {\n                shiftSubTree(array1, depth, level, slot, value2 - value1);\n            }\n        }\n    }\n    return similarity;\n}\nfunction shiftSubTree(array, depth, level, slot, shift) {\n    for (let currentLevel = level; currentLevel < depth; currentLevel++) {\n        const levelSlotShift = slot * (1 << (currentLevel - level));\n        const levelShift = (1 << currentLevel) - 1;\n        const levelSlotSize = 1 << (currentLevel - level);\n        for (let slotIndex = levelSlotShift; slotIndex < levelSlotShift + levelSlotSize; slotIndex++) {\n            const index = levelShift + slotIndex;\n            array[index] += shift;\n        }\n    }\n}\nfunction getDepth(array) {\n    const depth = Math.log2(array.length + 1);\n    if (depth % 1 !== 0) {\n        throw new Error('the array length is not a power of 2 minus 1');\n    }\n    return depth;\n}\n//# sourceMappingURL=xMassCenterVectorSimilarity.js.map","import { xMedian } from \"./xMedian.js\";\n/**\n * This function calculates the median absolute deviation (MAD).\n * https://en.wikipedia.org/wiki/Median_absolute_deviation\n * @param array\n */\nexport function xMedianAbsoluteDeviation(array) {\n    const median = xMedian(array);\n    const averageDeviations = new Float64Array(array.length);\n    for (let i = 0; i < array.length; i++) {\n        averageDeviations[i] = Math.abs(array[i] - median);\n    }\n    return {\n        median,\n        mad: xMedian(averageDeviations),\n    };\n}\n//# sourceMappingURL=xMedianAbsoluteDeviation.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Return min and max values of an array.\n * @param array - array of number\n * @returns - Object with 2 properties, min and max.\n */\nexport function xMinMaxValues(array) {\n    xCheck(array);\n    let min = array[0];\n    let max = array[0];\n    for (const value of array) {\n        if (value < min)\n            min = value;\n        if (value > max)\n            max = value;\n    }\n    return { min, max };\n}\n//# sourceMappingURL=xMinMaxValues.js.map","/*\nAdapted from: https://github.com/compute-io/erfcinv/blob/aa116e23883839359e310ad41a7c42f72815fc1e/lib/number.js\n\nThe MIT License (MIT)\n\nCopyright (c) 2014-2015 The Compute.io Authors. All rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\nBoost Software License - Version 1.0 - August 17th, 2003\n\nPermission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the \"Software\") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:\n\nThe copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n/* eslint-disable no-loss-of-precision */\n// Coefficients for erfcinv on [0, 0.5]:\nconst Y1 = 8.91314744949340820313e-2;\nconst P1 = [\n    -5.38772965071242932965e-3, 8.22687874676915743155e-3,\n    2.19878681111168899165e-2, -3.65637971411762664006e-2,\n    -1.26926147662974029034e-2, 3.34806625409744615033e-2,\n    -8.36874819741736770379e-3, -5.08781949658280665617e-4,\n];\nconst Q1 = [\n    8.86216390456424707504e-4, -2.33393759374190016776e-3,\n    7.95283687341571680018e-2, -5.27396382340099713954e-2,\n    -7.1228902341542847553e-1, 6.62328840472002992063e-1, 1.56221558398423026363,\n    -1.56574558234175846809, -9.70005043303290640362e-1, 1,\n];\n// Coefficients for erfcinv for 0.5 > 1-x >= 0:\nconst Y2 = 2.249481201171875;\nconst P2 = [\n    -3.67192254707729348546, 2.11294655448340526258e1, 1.7445385985570866523e1,\n    -4.46382324441786960818e1, -1.88510648058714251895e1,\n    1.76447298408374015486e1, 8.37050328343119927838, 1.05264680699391713268e-1,\n    -2.02433508355938759655e-1,\n];\nconst Q2 = [\n    1.72114765761200282724, -2.26436933413139721736e1, 1.08268667355460159008e1,\n    4.85609213108739935468e1, -2.01432634680485188801e1,\n    -2.86608180499800029974e1, 3.9713437953343869095, 6.24264124854247537712, 1,\n];\n// Coefficients for erfcinv for sqrt( -log(1-x)):\nconst Y3 = 8.07220458984375e-1;\nconst P3 = [\n    -6.81149956853776992068e-10, 2.85225331782217055858e-8,\n    -6.79465575181126350155e-7, 2.14558995388805277169e-3,\n    2.90157910005329060432e-2, 1.42869534408157156766e-1,\n    3.37785538912035898924e-1, 3.87079738972604337464e-1,\n    1.17030156341995252019e-1, -1.63794047193317060787e-1,\n    -1.31102781679951906451e-1,\n];\nconst Q3 = [\n    1.105924229346489121e-2, 1.52264338295331783612e-1, 8.48854343457902036425e-1,\n    2.59301921623620271374, 4.77846592945843778382, 5.38168345707006855425,\n    3.46625407242567245975, 1,\n];\nconst Y4 = 9.3995571136474609375e-1;\nconst P4 = [\n    2.66339227425782031962e-12, -2.30404776911882601748e-10,\n    4.60469890584317994083e-6, 1.57544617424960554631e-4,\n    1.87123492819559223345e-3, 9.50804701325919603619e-3,\n    1.85573306514231072324e-2, -2.22426529213447927281e-3,\n    -3.50353787183177984712e-2,\n];\nconst Q4 = [\n    7.64675292302794483503e-5, 2.63861676657015992959e-3,\n    3.41589143670947727934e-2, 2.20091105764131249824e-1,\n    7.62059164553623404043e-1, 1.3653349817554063097, 1,\n];\nconst Y5 = 9.8362827301025390625e-1;\nconst P5 = [\n    9.9055709973310326855e-17, -2.81128735628831791805e-14,\n    4.62596163522878599135e-9, 4.49696789927706453732e-7,\n    1.49624783758342370182e-5, 2.09386317487588078668e-4,\n    1.05628862152492910091e-3, -1.12951438745580278863e-3,\n    -1.67431005076633737133e-2,\n];\nconst Q5 = [\n    2.82243172016108031869e-7, 2.75335474764726041141e-5,\n    9.64011807005165528527e-4, 1.60746087093676504695e-2,\n    1.38151865749083321638e-1, 5.91429344886417493481e-1, 1,\n];\n/**\n * Polyval.\n * @param c - Array of Number.\n * @param x - Number.\n * @returns Number.\n */\nfunction polyval(c, x) {\n    let p = 0;\n    for (const coef of c) {\n        p = p * x + coef;\n    }\n    return p;\n}\n/**\n * Calculates a rational approximation.\n * @private\n * @param x - Number.\n * @param v - Number.\n * @param P - Array of polynomial coefficients.\n * @param Q - Array of polynomial coefficients.\n * @param Y - Number.\n * @returns Rational approximation.\n */\nfunction calc(x, v, P, Q, Y) {\n    const s = x - v;\n    const r = polyval(P, s) / polyval(Q, s);\n    return Y * x + r * x;\n}\n/**\n * Evaluates the complementary inverse error function for an input value.\n * @private\n * @param x - Input value.\n * @returns Evaluated complementary inverse error function.\n */\nexport default function erfcinv(x) {\n    let sign = false;\n    let val;\n    let q;\n    let g;\n    let r;\n    // [1] Special cases...\n    // NaN:\n    if (Number.isNaN(x)) {\n        return Number.NaN;\n    }\n    // x not on the interval: [0,2]\n    if (x < 0 || x > 2) {\n        throw new RangeError(`erfcinv()::invalid input argument. Value must be on the interval [0,2]. Value: \\`${x}\\`.`);\n    }\n    if (x === 0) {\n        return Number.POSITIVE_INFINITY;\n    }\n    if (x === 2) {\n        return Number.NEGATIVE_INFINITY;\n    }\n    if (x === 1) {\n        return 0;\n    }\n    // [2] Get the sign and make use of `erfc` reflection formula: `erfc(-z)=2 - erfc(z)`...\n    if (x > 1) {\n        q = 2 - x;\n        x = 1 - q;\n        sign = true;\n    }\n    else {\n        q = x;\n        x = 1 - x;\n    }\n    // [3] |x| <= 0.5\n    if (x <= 0.5) {\n        g = x * (x + 10);\n        r = polyval(P1, x) / polyval(Q1, x);\n        val = g * Y1 + g * r;\n        return sign ? -val : val;\n    }\n    // [4] 1-|x| >= 0.25\n    if (q >= 0.25) {\n        g = Math.sqrt(-2 * Math.log(q));\n        q = q - 0.25;\n        r = polyval(P2, q) / polyval(Q2, q);\n        val = g / (Y2 + r);\n        return sign ? -val : val;\n    }\n    q = Math.sqrt(-Math.log(q));\n    // [5] q < 3\n    if (q < 3) {\n        return calc(q, 1.125, P3, Q3, Y3);\n    }\n    // [6] q < 6\n    if (q < 6) {\n        return calc(q, 3, P4, Q4, Y4);\n    }\n    // Note that the smallest number in JavaScript is 5e-324. Math.sqrt( -Math.log( 5e-324 ) ) ~27.2844\n    return calc(q, 6, P5, Q5, Y5);\n    // Note that in the boost library, they are able to go to much smaller values, as 128 bit long doubles support ~1e-5000; something which JavaScript does not natively support.\n}\n//# sourceMappingURL=erfcinv.js.map","import erfcinv from \"./erfcinv.js\";\n/**\n * Applies a simple normalization inverse transformation to the input data.\n * @param data - The input array of numbers to be transformed.\n * @param options - Optional parameters for the transformation.\n * @returns A new Float64Array containing the transformed data.\n */\nexport function simpleNormInv(data, options = {}) {\n    const { magnitudeMode = false } = options;\n    const result = new Float64Array(data.length);\n    if (magnitudeMode) {\n        for (let i = 0; i < result.length; i++) {\n            result[i] = -Math.sqrt(-2 * Math.log(1 - data[i]));\n        }\n    }\n    else {\n        for (let i = 0; i < result.length; i++) {\n            result[i] = -1 * Math.SQRT2 * erfcinv(2 * data[i]);\n        }\n    }\n    return result;\n}\n/**\n * Convenience wrapper for single number processing by simpleNormInv function.\n * @param data - The number to be normalized.\n * @param options - The options for the normalization process.\n * @returns The normalized number.\n */\nexport function simpleNormInvNumber(data, options = {}) {\n    return simpleNormInv([data], options)[0];\n}\n//# sourceMappingURL=simpleNormInv.js.map","import { isAnyArray } from 'is-any-array';\nimport { createFromToArray } from \"../utils/index.js\";\nimport { simpleNormInvNumber } from \"./utils/simpleNormInv.js\";\nimport { xEnsureFloat64 } from \"./xEnsureFloat64.js\";\n/**\n * Determine noise level by san plot methodology (https://doi.org/10.1002/mrc.4882)\n * @param array - real or magnitude spectra data.\n * @param options - options\n * @returns noise level\n */\nexport function xNoiseSanPlot(array, options = {}) {\n    const { mask, cutOff, refine = true, magnitudeMode = false, scaleFactor = 1, factorStd = 5, fixOffset = true, } = options;\n    const input = prepareData(array, { scaleFactor, mask });\n    if (fixOffset && !magnitudeMode) {\n        const medianIndex = Math.floor(input.length / 2);\n        const median = input.length % 2 === 0\n            ? 0.5 * (input[medianIndex - 1] + input[medianIndex])\n            : input[medianIndex];\n        for (let i = 0; i < input.length; i++) {\n            input[i] -= median;\n        }\n    }\n    const firstNegativeValueIndex = input.at(-1) >= 0\n        ? input.length\n        : input.findIndex((e) => e < 0);\n    let lastPositiveValueIndex = firstNegativeValueIndex - 1;\n    for (let i = lastPositiveValueIndex; i >= 0; i--) {\n        if (input[i] > 0) {\n            lastPositiveValueIndex = i;\n            break;\n        }\n    }\n    const signPositive = input.slice(0, lastPositiveValueIndex + 1);\n    const signNegative = input.slice(firstNegativeValueIndex);\n    const cutOffDist = cutOff || determineCutOff(signPositive, { magnitudeMode });\n    const pIndex = Math.floor(signPositive.length * cutOffDist);\n    const initialNoiseLevelPositive = signPositive[pIndex];\n    const skyPoint = signPositive[0];\n    let initialNoiseLevelNegative;\n    if (signNegative.length > 0) {\n        const nIndex = Math.floor(signNegative.length * (1 - cutOffDist));\n        initialNoiseLevelNegative = -1 * signNegative[nIndex];\n    }\n    else {\n        initialNoiseLevelNegative = 0;\n    }\n    let noiseLevelPositive = initialNoiseLevelPositive;\n    let noiseLevelNegative = initialNoiseLevelNegative;\n    let cloneSignPositive = signPositive.slice();\n    let cloneSignNegative = signNegative.slice();\n    let cutOffSignalsIndexPlus = 0;\n    let cutOffSignalsIndexNeg = 2;\n    if (refine) {\n        let cutOffSignals = noiseLevelPositive * factorStd;\n        cutOffSignalsIndexPlus = signPositive.findIndex((e) => e < cutOffSignals);\n        if (cutOffSignalsIndexPlus > -1) {\n            cloneSignPositive = signPositive.slice(cutOffSignalsIndexPlus);\n            noiseLevelPositive =\n                cloneSignPositive[Math.floor(cloneSignPositive.length * cutOffDist)];\n        }\n        cutOffSignals = noiseLevelNegative * factorStd;\n        cutOffSignalsIndexNeg = signNegative.findIndex((e) => e < cutOffSignals);\n        if (cutOffSignalsIndexNeg > -1) {\n            cloneSignNegative = signNegative.slice(cutOffSignalsIndexNeg);\n            noiseLevelNegative =\n                cloneSignPositive[Math.floor(cloneSignNegative.length * (1 - cutOffDist))];\n        }\n    }\n    const correctionFactor = -simpleNormInvNumber(cutOffDist / 2, {\n        magnitudeMode,\n    });\n    let effectiveCutOffDist, refinedCorrectionFactor;\n    if (refine && cutOffSignalsIndexPlus > -1) {\n        effectiveCutOffDist =\n            (cutOffDist * cloneSignPositive.length + cutOffSignalsIndexPlus) /\n                (cloneSignPositive.length + cutOffSignalsIndexPlus);\n        refinedCorrectionFactor =\n            -1 * simpleNormInvNumber(effectiveCutOffDist / 2, { magnitudeMode });\n        noiseLevelPositive /= refinedCorrectionFactor;\n        if (cutOffSignalsIndexNeg > -1) {\n            effectiveCutOffDist =\n                (cutOffDist * cloneSignNegative.length + cutOffSignalsIndexNeg) /\n                    (cloneSignNegative.length + cutOffSignalsIndexNeg);\n            refinedCorrectionFactor =\n                -1 * simpleNormInvNumber(effectiveCutOffDist / 2, { magnitudeMode });\n            if (noiseLevelNegative !== 0) {\n                noiseLevelNegative /= refinedCorrectionFactor;\n            }\n        }\n    }\n    else {\n        noiseLevelPositive /= correctionFactor;\n        noiseLevelNegative /= correctionFactor;\n    }\n    return {\n        positive: noiseLevelPositive,\n        negative: noiseLevelNegative,\n        snr: skyPoint / noiseLevelPositive,\n        sanplot: generateSanPlot(input, {\n            fromTo: {\n                positive: { from: 0, to: lastPositiveValueIndex },\n                negative: { from: firstNegativeValueIndex, to: input.length },\n            },\n        }),\n    };\n}\n/**\n * Determines the optimal cut-off point for a given array of positive numbers.\n * @param signPositive - An array of positive numbers.\n * @param options - Optional parameters to configure the cut-off determination.\n * @param options.magnitudeMode - If true, uses magnitude mode for normalization. Default is false.\n * @param options.considerList - An object specifying the range and step for consideration.\n * @param options.considerList.from - The starting point of the range. Default is 0.5.\n * @param options.considerList.step - The step size for the range. Default is 0.1.\n * @param options.considerList.to - The ending point of the range. Default is 0.9.\n * @returns The optimal cut-off point as a number.\n */\nfunction determineCutOff(signPositive, options = {}) {\n    const { magnitudeMode = false, considerList = { from: 0.5, step: 0.1, to: 0.9 }, } = options;\n    //generate a list of values for\n    const cutOff = [];\n    const indexMax = signPositive.length - 1;\n    for (let i = 0.01; i <= 0.99; i += 0.01) {\n        const index = Math.round(indexMax * i);\n        const value = -signPositive[index] / simpleNormInvNumber(i / 2, { magnitudeMode });\n        cutOff.push([i, value]);\n    }\n    let minKi = Number.MAX_SAFE_INTEGER;\n    const { from, to, step } = considerList;\n    const delta = step / 2;\n    let whereToCutStat = 0.5;\n    for (let i = from; i <= to; i += step) {\n        const floor = i - delta;\n        const top = i + delta;\n        const elementsOfCutOff = cutOff.filter((e) => e[0] < top && e[0] > floor);\n        let averageValue = 0;\n        for (const element of elementsOfCutOff) {\n            averageValue += Math.abs(element[1]);\n        }\n        let kiSqrt = 0;\n        for (const element of elementsOfCutOff) {\n            kiSqrt += (element[1] - averageValue) ** 2;\n        }\n        if (kiSqrt < minKi) {\n            minKi = kiSqrt;\n            whereToCutStat = i;\n        }\n    }\n    return whereToCutStat;\n}\n/**\n * Generates a SAN plot from the given array based on the specified options.\n * @param array - The input array of numbers to be processed.\n * @param options - An optional object containing configuration options.\n * @param options.logBaseY - The logarithmic base for the Y-axis. Defaults to 2.\n * @param options.fromTo - An object specifying the range for each key. Each key maps to an object with `from` and `to` properties.\n * @returns An object where each key maps to a DataXY object containing the processed data.\n */\nfunction generateSanPlot(array, options = {}) {\n    const { fromTo, logBaseY = 2 } = options;\n    const sanplot = {};\n    for (const key in fromTo) {\n        const { from, to } = fromTo[key];\n        sanplot[key] =\n            from !== to\n                ? scale(array.slice(from, to), {\n                    logBaseY,\n                })\n                : { x: [], y: [] };\n        if (key === 'negative') {\n            sanplot[key].y.reverse();\n        }\n    }\n    return sanplot;\n}\n/**\n * Scales the input array based on the provided options.\n * @param array - The input array to be scaled.\n * @param options - An optional object containing scaling options.\n * @param options.logBaseY - If provided, the array values will be scaled using the logarithm of this base.\n * @returns An object containing the scaled x and y arrays.\n */\nfunction scale(array, options = {}) {\n    const { log10, abs } = Math;\n    const { logBaseY } = options;\n    if (logBaseY) {\n        array = array.slice(0);\n        const logOfBase = log10(logBaseY);\n        for (let i = 0; i < array.length; i++) {\n            array[i] = log10(abs(array[i])) / logOfBase;\n        }\n    }\n    const xAxis = createFromToArray({\n        from: 0,\n        to: array.length - 1,\n        length: array.length,\n    });\n    return { x: xAxis, y: array };\n}\n/**\n * Prepares and processes the input data array based on the provided options.\n * @param array - The input array of numbers to be processed.\n * @param options - An object containing the following properties:\n *   - scaleFactor: A number by which to scale each element of the array.\n *   - mask: An optional array of the same length as the input array, where\n *           elements corresponding to `true` values will be excluded from processing.\n * @param options.scaleFactor\n * @param options.mask\n * @returns A new Float64Array containing the processed data, scaled by the\n *          scaleFactor and sorted in descending order.\n */\nfunction prepareData(array, options) {\n    const { scaleFactor, mask } = options;\n    const input = xEnsureFloat64(isAnyArray(mask) && mask.length === array.length\n        ? array.filter((_e, i) => !mask[i])\n        : array);\n    if (scaleFactor > 1) {\n        for (let i = 0; i < input.length; i++) {\n            input[i] *= scaleFactor;\n        }\n    }\n    input.sort();\n    input.reverse();\n    return input;\n}\n//# sourceMappingURL=xNoiseSanPlot.js.map","import { xMedianAbsoluteDeviation } from \"./xMedianAbsoluteDeviation.js\";\n/**\n * Determine noise level using MAD https://en.wikipedia.org/wiki/Median_absolute_deviation\n * Constant to convert mad to sd calculated using https://www.wolframalpha.com/input?i=sqrt%282%29+inverse+erf%280.5%29\n * This assumes a gaussian distribution of the noise\n * @param array\n * @returns noise level corresponding to one standard deviation\n */\nexport function xNoiseStandardDeviation(array) {\n    const { mad, median } = xMedianAbsoluteDeviation(array);\n    return { sd: mad / 0.6744897501960817, mad, median };\n}\n//# sourceMappingURL=xNoiseStandardDeviation.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Calculate the sum of the values\n * @param array - Object that contains property x (an ordered increasing array) and y (an array).\n * @param options - Options.\n * @returns XSum value on the specified range.\n */\nexport function xSum(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let sumValue = array[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        sumValue += array[i];\n    }\n    return sumValue;\n}\n//# sourceMappingURL=xSum.js.map","import { getOutputArray } from \"./getOutputArray.js\";\nimport { xCheck } from \"./xCheck.js\";\nimport { xMaxValue } from \"./xMaxValue.js\";\nimport { xSum } from \"./xSum.js\";\n/**\n * Divides the data with either the sum, the absolute sum or the maximum of the data\n * @param input - Array containing values\n * @param options - options\n * @returns - normalized data\n */\nexport function xNormed(input, options = {}) {\n    const { algorithm = 'absolute', value = 1 } = options;\n    xCheck(input);\n    const output = getOutputArray(options.output, input.length);\n    if (input.length === 0) {\n        throw new Error('input must not be empty');\n    }\n    switch (algorithm) {\n        case 'absolute': {\n            const absoluteSumValue = absoluteSum(input) / value;\n            if (absoluteSumValue === 0) {\n                throw new Error('trying to divide by 0');\n            }\n            for (let i = 0; i < input.length; i++) {\n                output[i] = input[i] / absoluteSumValue;\n            }\n            return output;\n        }\n        case 'max': {\n            const currentMaxValue = xMaxValue(input);\n            if (currentMaxValue === 0) {\n                throw new Error('trying to divide by 0');\n            }\n            const factor = value / currentMaxValue;\n            for (let i = 0; i < input.length; i++) {\n                output[i] = input[i] * factor;\n            }\n            return output;\n        }\n        case 'sum': {\n            const sumFactor = xSum(input) / value;\n            if (sumFactor === 0) {\n                throw new Error('trying to divide by 0');\n            }\n            for (let i = 0; i < input.length; i++) {\n                output[i] = input[i] / sumFactor;\n            }\n            return output;\n        }\n        default:\n            throw new Error(`unknown algorithm: ${String(algorithm)}`);\n    }\n}\nfunction absoluteSum(input) {\n    let sumValue = 0;\n    for (const value of input) {\n        sumValue += Math.abs(value);\n    }\n    return sumValue;\n}\n//# sourceMappingURL=xNormed.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xEnsureFloat64 } from \"./xEnsureFloat64.js\";\n/**\n * This function pads an array\n *s\n * @param array - the array that will be padded\n * @param options - options\n */\nexport function xPadding(array, options = {}) {\n    const { size = 0, value = 0, algorithm } = options;\n    xCheck(array);\n    if (!algorithm) {\n        return xEnsureFloat64(array);\n    }\n    const result = new Float64Array(array.length + size * 2);\n    for (let i = 0; i < array.length; i++) {\n        result[i + size] = array[i];\n    }\n    const fromEnd = size + array.length;\n    const toEnd = 2 * size + array.length;\n    switch (algorithm) {\n        case 'value':\n            for (let i = 0; i < size; i++) {\n                result[i] = value;\n            }\n            for (let i = fromEnd; i < toEnd; i++) {\n                result[i] = value;\n            }\n            break;\n        case 'duplicate':\n            for (let i = 0; i < size; i++) {\n                result[i] = array[0];\n            }\n            for (let i = fromEnd; i < toEnd; i++) {\n                result[i] = array.at(-1);\n            }\n            break;\n        case 'circular':\n            for (let i = 0; i < size; i++) {\n                result[i] =\n                    array[(array.length - (size % array.length) + i) % array.length];\n            }\n            for (let i = 0; i < size; i++) {\n                result[i + fromEnd] = array[i % array.length];\n            }\n            break;\n        default:\n            throw new Error(`unknown algorithm ${String(algorithm)}`);\n    }\n    return result;\n}\n//# sourceMappingURL=xPadding.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xPadding } from \"./xPadding.js\";\n/**\n * This function calculates a rolling average\n * @param array - array\n * @param fct - callback function that from an array returns a value\n * @param options - options\n */\nexport function xRolling(array, fct, options = {}) {\n    xCheck(array);\n    if (typeof fct !== 'function') {\n        throw new TypeError('fct must be a function');\n    }\n    const { window = 5, padding = {} } = options;\n    const { size = window - 1, algorithm, value } = padding;\n    const padded = xPadding(array, { size, algorithm, value }); // ensure we get a copy and it is float64\n    const newArray = [];\n    for (let i = 0; i < padded.length - window + 1; i++) {\n        // we will send a view to the original buffer\n        newArray.push(fct(padded.subarray(i, i + window)));\n    }\n    return newArray;\n}\n//# sourceMappingURL=xRolling.js.map","import { xMean } from \"./xMean.js\";\nimport { xRolling } from \"./xRolling.js\";\n/**\n * This function calculates a rolling average\n * @param array - array\n * @param options - option\n */\nexport function xRollingAverage(array, options = {}) {\n    return xRolling(array, xMean, options);\n}\n//# sourceMappingURL=xRollingAverage.js.map","/**\n * This function performs a circular shift to an array.\n * Positive values of shifts will shift to the right and negative values will do to the left.\n * @example xRotate([1,2,3,4],1) -> [4,1,2,3]\n * @example xRotate([1,2,3,4],-1) -> [2,3,4,1]\n * @param array - array\n * @param shift - shift\n * @returns - rotated array\n */\nexport function xRotate(array, shift) {\n    shift = shift % array.length;\n    if (shift < 0)\n        shift += array.length;\n    const result = new Float64Array(array.length);\n    result.set(array.slice(array.length - shift));\n    result.set(array.slice(0, array.length - shift), shift);\n    return result;\n}\n//# sourceMappingURL=xRotate.js.map","import { createNumberArray } from \"../utils/index.js\";\nexport function xSequentialFillFromStep(parameters, options = {}) {\n    const { from, step, size } = parameters;\n    const { ArrayConstructor = Float64Array } = options;\n    const result = createNumberArray(ArrayConstructor, size);\n    for (let i = 0; i < size; i++) {\n        result[i] = from + i * step;\n    }\n    return result;\n}\n//# sourceMappingURL=xSequentialFillFromStep.js.map","/**\n * Function that sorts arrays or Float64Arrays in descending order\n * @param array - array to sort\n * @returns sorted array\n */\nexport function xSortDescending(array) {\n    if (ArrayBuffer.isView(array)) {\n        array.sort();\n        array.reverse();\n        return array;\n    }\n    else if (Array.isArray(array)) {\n        array.sort((a, b) => b - a);\n        return array;\n    }\n    throw new Error('trying to sort non array');\n}\n//# sourceMappingURL=xSortDescending.js.map","import { createNumberArray } from \"../utils/index.js\";\n/**\n * Create a new matrix based on the size of the current one or by using specific dimensions.\n * @param options\n */\nexport function matrixCreateEmpty(options) {\n    const { matrix, nbRows = matrix?.length || 1, nbColumns = matrix?.[0].length || 1, ArrayConstructor = Float64Array, } = options;\n    const newMatrix = [];\n    for (let row = 0; row < nbRows; row++) {\n        newMatrix.push(createNumberArray(ArrayConstructor, nbColumns));\n    }\n    return newMatrix;\n}\n//# sourceMappingURL=matrixCreateEmpty.js.map","export function matrixCheck(data) {\n    if (data.length === 0 || data[0].length === 0) {\n        throw new RangeError('matrix must contain data');\n    }\n    const firstLength = data[0].length;\n    for (let i = 1; i < data.length; i++) {\n        if (data[i].length !== firstLength) {\n            throw new RangeError('all rows must has the same length');\n        }\n    }\n}\n//# sourceMappingURL=matrixCheck.js.map","/*\nThe MIT License (MIT)\n\nCopyright (c) 2013 Eric Arnebäck\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n/**\n * Solves a system of linear equations using the Cholesky decomposition method.\n * It is a direct conversion to TS from {@link https://github.com/scijs/cholesky-solve}\n * @param nonZerosArray - The matrix in triplet form (array of arrays), where each sub-array contains three elements: row index, column index, and value.\n * @param dimension - The order of the matrix (number of rows/columns).\n * @param permutationEncoded - Optional permutation array. If provided, it will be used to permute the matrix.\n * @returns A function that takes a right-hand side vector `b` and returns the solution vector `x`, or `null` if the decomposition fails.\n */\nexport function matrixCholeskySolver(nonZerosArray, dimension, permutationEncoded) {\n    if (permutationEncoded) {\n        const pinv = new Int32Array(dimension);\n        for (let k = 0; k < dimension; k++) {\n            pinv[permutationEncoded[k]] = k;\n        }\n        // Build a permuted copy (kept as plain arrays for compatibility)\n        const mt = new Array(nonZerosArray.length);\n        for (let a = 0; a < nonZerosArray.length; ++a) {\n            const [r, c, value] = nonZerosArray[a];\n            const ar = pinv[r];\n            const ac = pinv[c];\n            mt[a] = ac < ar ? [ac, ar, value] : [ar, ac, value];\n        }\n        nonZerosArray = mt;\n    }\n    else {\n        // use a typed identity permutation\n        const p = new Int32Array(dimension);\n        for (let i = 0; i < dimension; ++i) {\n            p[i] = i;\n        }\n        permutationEncoded = p;\n    }\n    const nnz = nonZerosArray.length;\n    const ap = new Int32Array(dimension + 1);\n    const ai = new Int32Array(nnz);\n    const ax = new Float64Array(nnz);\n    const lnz = new Int32Array(dimension);\n    for (let idx = 0; idx < nnz; idx++) {\n        const col = nonZerosArray[idx][1];\n        lnz[col]++;\n    }\n    ap[0] = 0;\n    for (let i = 0; i < dimension; ++i) {\n        ap[i + 1] = ap[i] + lnz[i];\n    }\n    const colOffset = new Int32Array(dimension);\n    for (let idx = 0; idx < nnz; idx++) {\n        const e = nonZerosArray[idx];\n        const col = e[1];\n        const adr = ap[col] + colOffset[col];\n        ai[adr] = e[0];\n        ax[adr] = e[2];\n        colOffset[col]++;\n    }\n    const d = new Float64Array(dimension);\n    const y = new Float64Array(dimension);\n    const lp = new Int32Array(dimension + 1);\n    const parent = new Int32Array(dimension);\n    const lnzArray = new Int32Array(dimension);\n    const flag = new Int32Array(dimension);\n    const pattern = new Int32Array(dimension);\n    const bp1 = new Float64Array(dimension);\n    const x = new Float64Array(dimension);\n    ldlSymbolic(dimension, ap, ai, lp, parent, lnzArray, flag);\n    const nz = lp[dimension];\n    const lx = new Float64Array(nz);\n    const li = new Int32Array(nz);\n    const result = ldlNumeric(dimension, ap, ai, ax, lp, parent, lnzArray, li, lx, d, y, pattern, flag);\n    if (result === dimension) {\n        return (b) => {\n            ldlPerm(dimension, bp1, b, permutationEncoded);\n            ldlLsolve(dimension, bp1, lp, li, lx);\n            ldlDsolve(dimension, bp1, d);\n            ldlLTsolve(dimension, bp1, lp, li, lx);\n            ldlPermt(dimension, x, bp1, permutationEncoded);\n            return x;\n        };\n    }\n    else {\n        return null;\n    }\n}\nfunction ldlSymbolic(dimension, ap, ai, lp, parent, lnz, flag) {\n    const apLoc = ap;\n    const aiLoc = ai;\n    const parentLoc = parent;\n    const lnzLoc = lnz;\n    const flagLoc = flag;\n    for (let k = 0; k < dimension; k++) {\n        parentLoc[k] = -1;\n        flagLoc[k] = k;\n        lnzLoc[k] = 0;\n        const kk = k;\n        const p2 = apLoc[kk + 1];\n        for (let p = apLoc[kk]; p < p2; p++) {\n            let i = aiLoc[p];\n            if (i < k) {\n                for (; flagLoc[i] !== k; i = parentLoc[i]) {\n                    if (parentLoc[i] === -1)\n                        parentLoc[i] = k;\n                    lnzLoc[i]++;\n                    flagLoc[i] = k;\n                }\n            }\n        }\n    }\n    lp[0] = 0;\n    for (let k = 0; k < dimension; k++) {\n        lp[k + 1] = lp[k] + lnz[k];\n    }\n}\nfunction ldlNumeric(dimension, ap, ai, ax, lp, parent, lnz, li, lx, d, y, pattern, flag) {\n    const apLoc = ap;\n    const aiLoc = ai;\n    const axLoc = ax;\n    const lpLoc = lp;\n    const parentLoc = parent;\n    const lnzLoc = lnz;\n    const liLoc = li;\n    const lxLoc = lx;\n    const dLoc = d;\n    const yLoc = y;\n    const patternLoc = pattern;\n    const flagLoc = flag;\n    let yi, lKi;\n    for (let k = 0; k < dimension; k++) {\n        yLoc[k] = 0;\n        let top = dimension;\n        flagLoc[k] = k;\n        lnzLoc[k] = 0;\n        const kk = k;\n        const p2col = apLoc[kk + 1];\n        for (let p = apLoc[kk]; p < p2col; p++) {\n            let i = aiLoc[p];\n            if (i <= k) {\n                yLoc[i] += axLoc[p];\n                let len = 0;\n                for (; flagLoc[i] !== k; i = parentLoc[i]) {\n                    patternLoc[len++] = i;\n                    flagLoc[i] = k;\n                }\n                while (len > 0)\n                    patternLoc[--top] = patternLoc[--len];\n            }\n        }\n        dLoc[k] = yLoc[k];\n        yLoc[k] = 0;\n        for (; top < dimension; top++) {\n            const i = patternLoc[top];\n            yi = yLoc[i];\n            yLoc[i] = 0;\n            const p2 = lpLoc[i] + lnzLoc[i];\n            let p;\n            for (p = lpLoc[i]; p < p2; p++) {\n                yLoc[liLoc[p]] -= lxLoc[p] * yi;\n            }\n            lKi = yi / dLoc[i];\n            dLoc[k] -= lKi * yi;\n            liLoc[p] = k;\n            lxLoc[p] = lKi;\n            lnzLoc[i]++;\n        }\n        if (dLoc[k] === 0)\n            return k;\n    }\n    return dimension;\n}\nfunction ldlLsolve(dimension, x, lp, li, lx) {\n    const lpLoc = lp;\n    const liLoc = li;\n    const lxLoc = lx;\n    const xLoc = x;\n    for (let j = 0; j < dimension; j++) {\n        const p2 = lpLoc[j + 1];\n        for (let p = lpLoc[j]; p < p2; p++) {\n            xLoc[liLoc[p]] -= lxLoc[p] * xLoc[j];\n        }\n    }\n}\nfunction ldlDsolve(dimension, x, d) {\n    const xLoc = x;\n    const dLoc = d;\n    for (let j = 0; j < dimension; j++) {\n        xLoc[j] /= dLoc[j];\n    }\n}\nfunction ldlLTsolve(dimension, x, lp, li, lx) {\n    const lpLoc = lp;\n    const liLoc = li;\n    const lxLoc = lx;\n    const xLoc = x;\n    for (let j = dimension - 1; j >= 0; j--) {\n        const p2 = lpLoc[j + 1];\n        for (let p = lpLoc[j]; p < p2; p++) {\n            xLoc[j] -= lxLoc[p] * xLoc[liLoc[p]];\n        }\n    }\n}\nfunction ldlPerm(dimension, x, b, permutationEncoded) {\n    const perm = permutationEncoded;\n    const xLoc = x;\n    const bLoc = b;\n    for (let j = 0; j < dimension; j++) {\n        xLoc[j] = bLoc[perm[j]];\n    }\n}\nfunction ldlPermt(dimension, x, b, permutationEncoded) {\n    const perm = permutationEncoded;\n    const xLoc = x;\n    const bLoc = b;\n    for (let j = 0; j < dimension; j++) {\n        xLoc[perm[j]] = bLoc[j];\n    }\n}\n//# sourceMappingURL=matrixCholeskySolver.js.map","/**\n * Clone a matrix.\n * @param matrix\n */\nexport function matrixClone(matrix) {\n    return matrix.map((row) => row.slice(0));\n}\n//# sourceMappingURL=matrixClone.js.map","/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2013 Mikola Lysenko\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * The reverse Cuthill-Mckee method is a fast and effective preconditioner for reducing the bandwidth of sparse linear systems.\n * When solving a positive semidefinite linear system using Cholesky factorization, it greatly reduces fill-in.\n * It is a direct conversion to TS from {@link github.com/mikolalysenko/cuthill-mckee}\n * @param list - lower triangular non zeros from a symmetric sparse matrix.\n * @param dimension - matrix dimension\n * @returns A Float64Array where the value at each index represents the new position of the node\n *          in the bandwidth-reduced ordering.\n */\nexport function matrixCuthillMckee(list, dimension) {\n    const adj = new Array(dimension);\n    const visited = new Array(dimension).fill(false);\n    for (let i = 0; i < dimension; ++i) {\n        adj[i] = [];\n    }\n    for (const l of list) {\n        adj[l[0]].push(l[1]);\n    }\n    const toVisit = new Float64Array(dimension);\n    let eol = 0;\n    let ptr = 0;\n    for (let i = 0; i < dimension; ++i) {\n        if (visited[i]) {\n            continue;\n        }\n        toVisit[eol++] = i;\n        visited[i] = true;\n        while (ptr < eol) {\n            const v = toVisit[ptr++];\n            const nbhd = Float64Array.from(adj[v]);\n            nbhd.sort();\n            for (const u of nbhd) {\n                if (visited[u]) {\n                    continue;\n                }\n                visited[u] = true;\n                toVisit[eol++] = u;\n            }\n        }\n    }\n    const result = new Float64Array(dimension);\n    for (let i = 0; i < dimension; ++i) {\n        result[toVisit[i]] = i;\n    }\n    return result;\n}\n//# sourceMappingURL=matrixCuthillMckee.js.map","/**\n * Checks if the specified submatrix boundaries are within the valid range of the given matrix.\n * @param matrix - The matrix to check the boundaries against.\n * @param boundaries - The boundaries of the submatrix.\n * @throws {RangeError} If any of the specified boundaries are out of the matrix's range.\n */\nexport function matrixCheckRanges(matrix, boundaries) {\n    const { startRow, endRow, startColumn, endColumn } = boundaries;\n    if (startRow > endRow ||\n        startColumn > endColumn ||\n        startRow < 0 ||\n        startRow >= matrix.length ||\n        endRow < 0 ||\n        endRow >= matrix.length ||\n        startColumn < 0 ||\n        startColumn >= matrix[0].length ||\n        endColumn < 0 ||\n        endColumn >= matrix[0].length) {\n        throw new RangeError('submatrix indices are out of range');\n    }\n}\n//# sourceMappingURL=matrixCheckRanges.js.map","/**\n * Get min and max of the absolute values of Z.\n * @param matrix - matrix [rows][cols].\n */\nexport function matrixMinMaxAbsoluteZ(matrix) {\n    if (matrix.length === 0 || matrix[0].length === 0) {\n        throw new Error('matrixMinMaxAbsoluteZ requires at least 1 row and 1 column');\n    }\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    let min = Number.POSITIVE_INFINITY;\n    let max = Number.NEGATIVE_INFINITY;\n    for (let column = 0; column < nbColumns; column++) {\n        for (let row = 0; row < nbRows; row++) {\n            let value = matrix[row][column];\n            if (value < 0)\n                value *= -1;\n            if (value < min)\n                min = value;\n            if (value > max)\n                max = value;\n        }\n    }\n    return { min, max };\n}\n//# sourceMappingURL=matrixMinMaxAbsoluteZ.js.map","import { matrixCheck } from \"./matrixCheck.js\";\n/**\n * Get min and max Z.\n * @param matrix - matrix [rows][cols].\n */\nexport function matrixMinMaxZ(matrix) {\n    matrixCheck(matrix);\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    let min = matrix[0][0];\n    let max = matrix[0][0];\n    for (let column = 0; column < nbColumns; column++) {\n        for (let row = 0; row < nbRows; row++) {\n            if (matrix[row][column] < min)\n                min = matrix[row][column];\n            if (matrix[row][column] > max)\n                max = matrix[row][column];\n        }\n    }\n    return { min, max };\n}\n//# sourceMappingURL=matrixMinMaxZ.js.map","/**\n * Returns the max absolute values of Z.\n * @param matrix - matrix [rows][cols].\n */\nexport function matrixMaxAbsoluteZ(matrix) {\n    if (matrix.length === 0 || matrix[0].length === 0) {\n        throw new Error('matrix must have at least 1 row and 1 column');\n    }\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    let max = Number.NEGATIVE_INFINITY;\n    for (let column = 0; column < nbColumns; column++) {\n        for (let row = 0; row < nbRows; row++) {\n            const value = Math.abs(matrix[row][column]);\n            if (value > max)\n                max = value;\n        }\n    }\n    return max;\n}\n//# sourceMappingURL=matrixMaxAbsoluteZ.js.map","import { matrixCheck } from \"./matrixCheck.js\";\n/**\n * Convert a matrix to a flat Float64Array.\n * @param matrix\n */\nexport function matrixToArray(matrix) {\n    matrixCheck(matrix);\n    const nbColumns = matrix[0].length;\n    const flatten = new Float64Array(matrix.length * nbColumns);\n    for (let row = 0; row < matrix.length; row++) {\n        const currentRow = row * nbColumns;\n        for (let column = 0; column < nbColumns; column++) {\n            flatten[currentRow + column] = matrix[row][column];\n        }\n    }\n    return flatten;\n}\n//# sourceMappingURL=matrixToArray.js.map","/**\n * add the provided weights to a particular given system matrix (lD'D) in the triplet form and y data. This function is not general\n * it assumes that diagonal coefficients are in the even indexes, it is the case of the matrix generated by createSystemMatrix function.\n * It simulates the matrix operation W + lD'D and Wy.\n * @param leftHandSide - The original system matrix to be updated, a lower triangular non-zeros of the system matrix (lambda D'D).\n * @param rightHandSide - The original vector to be updated.\n * @param weights - The weights to apply to the system matrix and vector.\n * @returns An object that contains the news left and right hand-side of the system.\n */\nexport function addWeights(leftHandSide, rightHandSide, weights) {\n    const nbPoints = rightHandSide.length;\n    const l = nbPoints - 1;\n    const newLeftHandSide = new Array(leftHandSide.length);\n    const newRightHandSide = new Float64Array(nbPoints);\n    for (let i = 0; i < l; i++) {\n        const w = weights[i];\n        const diag = i * 2;\n        const next = diag + 1;\n        newLeftHandSide[diag] = leftHandSide[diag].slice();\n        newLeftHandSide[next] = leftHandSide[next].slice();\n        newRightHandSide[i] = rightHandSide[i] * w;\n        newLeftHandSide[diag][2] += w;\n    }\n    newRightHandSide[l] = rightHandSide[l] * weights[l];\n    newLeftHandSide[l * 2] = leftHandSide[l * 2].slice();\n    newLeftHandSide[l * 2][2] += weights[l];\n    return {\n        leftHandSide: newLeftHandSide,\n        rightHandSide: newRightHandSide,\n    };\n}\n//# sourceMappingURL=addWeights.js.map","import { matrixCholeskySolver } from \"../matrix/index.js\";\nimport { addWeights } from \"../utils/addWeights.js\";\nimport { createSystemMatrix } from \"../utils/createSystemMatrix.js\";\nimport { calculateAdaptiveWeights } from \"../utils/index.js\";\nimport { xEnsureFloat64 } from \"./xEnsureFloat64.js\";\nimport { xMultiply } from \"./xMultiply.js\";\nexport function xWhittakerSmoother(yData, options = {}) {\n    const { algorithm = 'thomas', ...restOptions } = options;\n    if (algorithm === 'thomas') {\n        return whittakerByThomas(yData, restOptions);\n    }\n    return whittakerByCholesky(yData, restOptions);\n}\n/**\n * @deprecated Use xWhittakerSmoother instead.\n * TODO: Remove in next major version.\n */\nexport const xWhitakerSmoother = xWhittakerSmoother;\n/**\n * Computes the baseline points for the given data using an iterative smoothing algorithm.\n * @param yData - The input data array.\n * @param options - The options for baseline computation.\n * @returns - The computed baseline points.\n */\nfunction whittakerByCholesky(yData, options = {}) {\n    const { lambda = 100, maxIterations = 100, tolerance = 1e-6, factorStd = 3, learningRate = 0.5, } = options;\n    const size = yData.length;\n    const { controlPoints, weights } = getWeightsAndControlPoints(yData, options);\n    const prevBaseline = new Float64Array(size);\n    let iteration = 0;\n    let delta = Infinity;\n    let baseline = xEnsureFloat64(yData);\n    const { upperTriangularNonZeros, permutationEncodedArray } = createSystemMatrix(size, lambda);\n    while (iteration < maxIterations && delta > tolerance) {\n        const { leftHandSide, rightHandSide } = addWeights(upperTriangularNonZeros, yData, weights);\n        const cho = matrixCholeskySolver(leftHandSide, size, permutationEncodedArray);\n        if (!cho) {\n            return baseline;\n        }\n        const newBaseline = cho(rightHandSide);\n        //weights is updated inplace\n        calculateAdaptiveWeights(yData, newBaseline, weights, {\n            controlPoints,\n            learningRate,\n            factorStd,\n        });\n        delta = calculateDelta(newBaseline, prevBaseline, size);\n        prevBaseline.set(newBaseline);\n        baseline = xEnsureFloat64(newBaseline);\n        iteration++;\n    }\n    return baseline;\n}\n/**\n * Calculates the delta between the current and previous baseline.\n * @param baseline - The current baseline array.\n * @param prevBaseline - The previous baseline array.\n * @param n - The length of the arrays.\n * @returns - The calculated delta value.\n */\nfunction calculateDelta(baseline, prevBaseline, n) {\n    let sum = 0;\n    for (let i = 0; i < n; i++) {\n        sum += (baseline[i] - prevBaseline[i]) ** 2;\n    }\n    return Math.sqrt(sum / n);\n}\n/**\n * Retrieves the control points and weights for the given data, the weights are modified multiplication of controlPoints if it exists.\n * @param  y - The input data array.\n * @param  options - The options for control points and weights.\n * @returns - The control points and modified weights.\n */\nfunction getWeightsAndControlPoints(y, options = {}) {\n    const { length } = y;\n    const { controlPoints } = options;\n    const { weights = Float64Array.from({ length }).fill(1) } = options;\n    if (controlPoints && controlPoints.length !== y.length) {\n        throw new RangeError('controlPoints should match the length with X');\n    }\n    else if (weights.length !== y.length) {\n        throw new RangeError('weights should match the length with X');\n    }\n    return {\n        weights: controlPoints ? xMultiply(weights, controlPoints) : weights,\n        controlPoints,\n    };\n}\nfunction whittakerByThomas(yData, options = {}) {\n    const { lambda = 100, maxIterations = 100, tolerance = 1e-6, factorStd = 3, learningRate = 0.5, } = options;\n    const n = yData.length;\n    const y = xEnsureFloat64(yData);\n    const { controlPoints, weights } = getWeightsAndControlPoints(yData, options);\n    const prevBaseline = new Float64Array(n);\n    let baseline = xEnsureFloat64(yData);\n    // Precompute base diagonal and constant off-diagonals (−lambda)\n    const baseDiag = new Float64Array(n);\n    if (n === 1) {\n        baseDiag[0] = lambda;\n    }\n    else {\n        baseDiag[0] = lambda;\n        for (let i = 1; i < n - 1; i++)\n            baseDiag[i] = 2 * lambda;\n        baseDiag[n - 1] = lambda;\n    }\n    const lower = new Float64Array(Math.max(0, n - 1));\n    const upper = new Float64Array(Math.max(0, n - 1));\n    for (let i = 0; i < lower.length; i++) {\n        lower[i] = -lambda;\n        upper[i] = -lambda;\n    }\n    const main = new Float64Array(n);\n    const rhs = new Float64Array(n);\n    const solution = new Float64Array(n);\n    const workC = new Float64Array(Math.max(0, n - 1));\n    const workD = new Float64Array(n);\n    let iteration = 0;\n    let delta = Infinity;\n    /**\n     * Iterative Whittaker smoothing implementation using the Thomas algorithm\n     * (tridiagonal solver). The method constructs the system\n     * [W + lambda * D'D] z = W * y where D is the second-difference operator\n     * and W are adaptive weights. At each iteration the tridiagonal system is\n     * solved with the Thomas algorithm and the weights are updated using\n     * `calculateAdaptiveWeights` until convergence.\n     *\n     * Use this algorithm by passing `algorithm: 'thomas'` to `xWhittakerSmoother`.\n     * It is more memory-efficient for large inputs because it avoids forming\n     * the full banded matrix, but both implementations aim to produce the same\n     * baseline result.\n     * @param yData - input signal/spectrum\n     * @param options - smoothing options (supports `lambda`, `maxIterations`,\n     *                  `tolerance`, `factorStd`, `learningRate`, and optional\n     *                  `controlPoints` / `weights` inherited from\n     *                  `CalculateAdaptiveWeightsOptions`).\n     * @returns baseline as a `Float64Array`.\n     */\n    while (iteration < maxIterations && delta > tolerance) {\n        // Build main diagonal = baseDiag + weights, and RHS = weights * y\n        for (let i = 0; i < n; i++) {\n            main[i] = baseDiag[i] + weights[i];\n            rhs[i] = weights[i] * y[i];\n        }\n        // Solve tridiagonal system in-place into `solution`\n        solveTridiagonalFloat64(lower, main, upper, rhs, solution, workC, workD);\n        calculateAdaptiveWeights(y, solution, weights, {\n            controlPoints,\n            learningRate,\n            factorStd,\n        });\n        delta = calculateDelta(solution, prevBaseline, n);\n        prevBaseline.set(solution);\n        baseline = xEnsureFloat64(solution);\n        iteration++;\n    }\n    return baseline;\n}\nfunction solveTridiagonalFloat64(lower, diag, upper, rhs, out, cp, dp) {\n    const n = diag.length;\n    const x = out ?? new Float64Array(n);\n    if (n === 0)\n        return x;\n    if (n === 1) {\n        x[0] = rhs[0] / diag[0];\n        return x;\n    }\n    const cprime = cp ?? new Float64Array(n - 1);\n    const dprime = dp ?? new Float64Array(n);\n    let denom = diag[0];\n    cprime[0] = upper[0] / denom;\n    dprime[0] = rhs[0] / denom;\n    for (let i = 1; i < n - 1; i++) {\n        denom = diag[i] - lower[i - 1] * cprime[i - 1];\n        cprime[i] = upper[i] / denom;\n        dprime[i] = (rhs[i] - lower[i - 1] * dprime[i - 1]) / denom;\n    }\n    denom = diag[n - 1] - lower[n - 2] * cprime[n - 2];\n    dprime[n - 1] = (rhs[n - 1] - lower[n - 2] * dprime[n - 2]) / denom;\n    x[n - 1] = dprime[n - 1];\n    for (let i = n - 2; i >= 0; i--) {\n        x[i] = dprime[i] - cprime[i] * x[i + 1];\n    }\n    return x;\n}\n//# sourceMappingURL=xWhittakerSmoother.js.map","import { matrixCuthillMckee } from \"../matrix/matrixCuthillMckee.js\";\n/**\n * Generates a lower triangular non-zeros of the first order smoother matrix (lambda D'D) where D is the derivate of the identity matrix\n * this function in combination with addWeights function can obtain (Q = W + lambda D'D) a penalized least square of Whittaker smoother,\n * it also generates a permutation encoded array.\n * @param dimension - The number of points in the matrix.\n * @param lambda - The factor of smoothness .\n * @returns An object containing the lower triangular non-zero elements of the matrix\n * and the permutation encoded array.\n * @property lowerTriangularNonZeros - The lower triangular non-zero elements of the matrix in triplet form.\n * @property permutationEncodedArray - The permutation encoded array generated using the Cuthill-McKee algorithm.\n */\nexport function createSystemMatrix(dimension, lambda) {\n    const upperTriangularNonZeros = [];\n    const last = dimension - 1;\n    for (let i = 0; i < last; i++) {\n        upperTriangularNonZeros.push([i, i, lambda * 2], [i, i + 1, -1 * lambda]);\n    }\n    upperTriangularNonZeros[0][2] = lambda;\n    upperTriangularNonZeros.push([last, last, lambda]);\n    const permutationEncodedArray = matrixCuthillMckee(upperTriangularNonZeros, dimension);\n    return { upperTriangularNonZeros, permutationEncodedArray };\n}\n//# sourceMappingURL=createSystemMatrix.js.map","/**\n * Phase correction filter.\n * @param data - complex spectrum\n * @param phi0 - Angle in radians for zero order phase correction\n * @param phi1 - Angle in radians for first order phase correction\n * @param options\n * @returns - returns a new object {re:[], im:[]} unless inPlace=true\n */\nexport function reimPhaseCorrection(data, phi0 = 0, phi1 = 0, options = {}) {\n    const { reverse = false, inPlace = false } = options;\n    phi0 = Number.isFinite(phi0) ? phi0 : 0;\n    phi1 = Number.isFinite(phi1) ? phi1 : 0;\n    const length = data.re.length;\n    // Decide target arrays\n    const re = data.re;\n    const im = data.im;\n    const outRe = inPlace ? re : new Float64Array(length);\n    const outIm = inPlace ? im : new Float64Array(length);\n    let firstAngle = phi0;\n    let delta = phi1 / length;\n    if (reverse) {\n        delta *= -1;\n        firstAngle += phi1;\n    }\n    const alpha = 2 * Math.sin(delta / 2) ** 2;\n    const beta = Math.sin(delta);\n    let cosTheta = Math.cos(firstAngle);\n    let sinTheta = Math.sin(firstAngle);\n    for (let i = 0; i < length; i++) {\n        const r = re[i];\n        const ii = im[i];\n        outRe[i] = r * cosTheta - ii * sinTheta;\n        outIm[i] = ii * cosTheta + r * sinTheta;\n        // Recursive angle update (stable incremental rotation)\n        const newCosTheta = cosTheta - (alpha * cosTheta + beta * sinTheta);\n        const newSinTheta = sinTheta - (alpha * sinTheta - beta * cosTheta);\n        cosTheta = newCosTheta;\n        sinTheta = newSinTheta;\n    }\n    return { re: outRe, im: outIm };\n}\n//# sourceMappingURL=reimPhaseCorrection.js.map","import { xNoiseSanPlot } from \"../x/index.js\";\nimport { reimAbsolute } from \"./reimAbsolute.js\";\nimport { reimPhaseCorrection } from \"./reimPhaseCorrection.js\";\n/**\n * Implementation of the algorithm for automatic phase correction: A robust, general automatic phase\n * correction algorithm for high-resolution NMR data. 10.1002/mrc.4586\n * @param data - complex spectrum\n * @param options - options\n */\nexport function reimAutoPhaseCorrection(data, options = {}) {\n    const { magnitudeMode = true, minRegSize = 30, factorNoise = 3, maxDistanceToJoin = 256, reverse = false, inPlace = false, } = options;\n    const finalPeaks = detectBaselineRegions(data, {\n        maxDistanceToJoin,\n        magnitudeMode,\n        factorNoise,\n    });\n    const { re, im } = data;\n    const length = re.length;\n    const indexMask = reverse ? (i) => length - 1 - i : (i) => i;\n    let x0 = 0;\n    let counter = -1;\n    const res = [];\n    while (counter < length) {\n        const reTmp = [];\n        const imTmp = [];\n        while (!finalPeaks[indexMask(++counter)] && counter < length) {\n            // Add some extra points(0.1 ppm) at rigth and left sides of the region.\n            x0 = counter;\n        }\n        for (; finalPeaks[indexMask(counter)] && counter < length; counter += 2) {\n            reTmp.push(re[indexMask(counter)]);\n            imTmp.push(im[indexMask(counter)]);\n        }\n        if (reTmp.length > minRegSize) {\n            res.push(autoPhaseRegion(reTmp, imTmp, x0));\n        }\n    }\n    const { ph1, ph0 } = determiningGlobalValues(res.map((r) => r.x0 / length), res.map((r) => r.ph0), res.map((r) => r.area / 1e11));\n    const phased = reimPhaseCorrection({ re, im }, toRadians(ph0), toRadians(ph1), { reverse, inPlace });\n    return { data: phased, ph0, ph1 };\n}\nfunction determiningGlobalValues(x, ph0Values, weights) {\n    if (x.length === 0) {\n        return { ph0: 0, ph1: 0 };\n    }\n    else if (x.length === 1) {\n        return { ph0: ph0Values[0], ph1: 0 };\n    }\n    const [ph1, ph0] = weightedLinearRegression(x, ph0Values, weights);\n    let indexMax = -1;\n    let maxDiff = Number.MIN_SAFE_INTEGER;\n    for (let i = 0; i < x.length; i++) {\n        const predictedPh0 = x[i] * ph1 + ph0;\n        const diff = Math.abs(ph0Values[i] - predictedPh0);\n        if (diff > 34 && maxDiff < diff) {\n            indexMax = i;\n            maxDiff = diff;\n        }\n    }\n    if (indexMax > -1) {\n        x.splice(indexMax, 1);\n        ph0Values.splice(indexMax, 1);\n        weights.splice(indexMax, 1);\n        return determiningGlobalValues(x, ph0Values, weights);\n    }\n    return { ph0, ph1 };\n}\nfunction detectBaselineRegions(data, options) {\n    const magnitudeData = options.magnitudeMode ? reimAbsolute(data) : data.re;\n    const ds = holoborodko(magnitudeData);\n    const peaksDs = robustBaseLineRegionsDetection(ds, options);\n    const peaksSp = robustBaseLineRegionsDetection(magnitudeData, options);\n    return peaksSp.map((sp, i) => sp && peaksDs[i]);\n}\n/**\n * AutoPhaseRegion.\n * @param re - Array of Number.\n * @param im - Array of Number.\n * @param x0 - Number.\n * @returns Region.\n */\nfunction autoPhaseRegion(re, im, x0) {\n    let start = -180;\n    let stop = 180;\n    const nSteps = 6;\n    let maxSteps = 10;\n    let bestAng = 0;\n    let minArea = Number.MAX_SAFE_INTEGER;\n    while (maxSteps > 0) {\n        const dAng = (stop - start) / (nSteps + 1);\n        for (let i = start; i <= stop; i += dAng) {\n            const tmpPhased = reimPhaseCorrection({ re, im }, toRadians(i), 0);\n            const negArea = getNegArea(tmpPhased.re);\n            if (negArea < minArea) {\n                [minArea, bestAng] = [negArea, i];\n            }\n        }\n        start = bestAng - dAng;\n        stop = bestAng + dAng;\n        maxSteps--;\n    }\n    // Calculate the area for the best angle\n    const phased = reimPhaseCorrection({ re, im }, toRadians(bestAng), 0);\n    let area = 0;\n    let sumX = 0;\n    for (let j = 0; j < re.length; j++) {\n        area += phased.re[j];\n        sumX += phased.re[j] * (j + x0);\n    }\n    return { ph0: bestAng, area, x0: sumX / area };\n}\n/**\n * Holoborodko.\n * @param s - Array of float.\n * @returns Array of float.\n */\nfunction holoborodko(s) {\n    const dk = new Float64Array(s.length);\n    for (let i = 5; i < s.length - 5; i++) {\n        dk[i] =\n            (42 * (s[i + 1] - s[i - 1]) +\n                48 * (s[i + 2] - s[i - 2]) +\n                27 * (s[i + 3] + s[i - 3]) +\n                8 * (s[i + 4] - s[i - 4]) +\n                s[i + 5] -\n                s[i - 5]) /\n                512;\n    }\n    //Fill the borders\n    for (let i = 0; i < 5; i++) {\n        dk[i] = dk[5];\n        dk[s.length - i - 1] = dk[s.length - 6];\n    }\n    return dk;\n}\n/**\n * RobustBaseLineRegionsDetection.\n * @param s\n * @param options\n * @param options.magnitudeMode\n * @param options.maxDistanceToJoin\n * @param options.factorNoise\n */\nfunction robustBaseLineRegionsDetection(s, options) {\n    const { maxDistanceToJoin, magnitudeMode, factorNoise } = options;\n    const mask = new Uint8Array(s.length);\n    for (let i = 0; i < s.length; i++) {\n        mask[i] = 0;\n    }\n    let change = true;\n    while (change) {\n        const noiseLevel = xNoiseSanPlot(s, { magnitudeMode });\n        const cutOff = factorNoise * noiseLevel.positive;\n        change = false;\n        for (let i = 0; i < s.length; i++) {\n            if (Math.abs(s[i]) > cutOff && !mask[i]) {\n                change = true;\n                mask[i] = 1;\n            }\n        }\n    }\n    // Clean up mask by merging peaks blocks, separated by just a few points(4??).\n    let count = 0;\n    let prev = 0;\n    for (let i = 0; i < s.length; i++) {\n        if (!mask[i]) {\n            count++;\n        }\n        else {\n            if (count < maxDistanceToJoin) {\n                for (let j = 0; j <= count; j++) {\n                    mask[prev + j] = 1;\n                }\n            }\n            while (mask[++i] && i < s.length)\n                ;\n            prev = i;\n            count = 0;\n        }\n    }\n    return mask;\n}\n/**\n * WeightedLinearRegression.\n * @param x\n * @param y\n * @param w\n */\nfunction weightedLinearRegression(x, y, w) {\n    let sxtw = 0;\n    let swx = 0;\n    let sw = 0;\n    let sxtwy = 0;\n    let swy = 0;\n    for (let i = 0; i < x.length; i++) {\n        sxtw += x[i] * x[i] * w[i];\n        swx += x[i] * w[i];\n        sw += w[i];\n        sxtwy += x[i] * w[i] * y[i];\n        swy += w[i] * y[i];\n    }\n    /* Just to know what is the matrix system that we solve\n     let Mx=[[sxtw, swx], [swx, sw]];\n     let My=[[sxtwy], [swy]];\n    */\n    //Mx inverse\n    const detMx = sxtw * sw - swx * swx;\n    const inMx = [\n        [sw / detMx, -swx / detMx],\n        [-swx / detMx, sxtw / detMx],\n    ];\n    return [\n        inMx[0][0] * sxtwy + inMx[0][1] * swy,\n        inMx[1][0] * sxtwy + inMx[1][1] * swy,\n    ];\n}\nfunction toRadians(degree) {\n    return (degree * Math.PI) / 180;\n}\nfunction getNegArea(data) {\n    let area = 0;\n    for (const element of data) {\n        if (element < 0)\n            area -= element;\n    }\n    return area;\n}\n//# sourceMappingURL=reimAutoPhaseCorrection.js.map","import { xRotate } from \"../x/index.js\";\nexport function zeroShift(data, inverse) {\n    const middle = inverse\n        ? Math.ceil(data.length / 2)\n        : Math.floor(data.length / 2);\n    return xRotate(data, middle);\n}\n//# sourceMappingURL=zeroShift.js.map","import { createDoubleArray } from \"../utils/createArray.js\";\n/**\n * This function make a zero filling to re and im part.\n * @param data - object of kind {re:[], im:[]}\n * @param totalLength - final number of points\n * @returns - New DataReIm object with zero-filled,\n * truncated arrays if totalLength is smaller current length or\n * the same input if totalLength is equal that current length\n */\nexport function reimZeroFilling(data, totalLength) {\n    if (!Number.isInteger(totalLength) || totalLength < 0) {\n        throw new RangeError('totalLength must be a non-negative integer');\n    }\n    const { re, im } = data;\n    const length = re.length;\n    if (totalLength === 0 || length === totalLength)\n        return data;\n    if (length > totalLength) {\n        return {\n            re: re.slice(0, totalLength),\n            im: im.slice(0, totalLength),\n        };\n    }\n    const newRE = createDoubleArray(re.constructor, totalLength);\n    const newIM = createDoubleArray(im.constructor, totalLength);\n    for (let i = 0; i < re.length; i++) {\n        newRE[i] = re[i];\n        newIM[i] = im[i];\n    }\n    return {\n        re: newRE,\n        im: newIM,\n    };\n}\n//# sourceMappingURL=reimZeroFilling.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Verify that `data` is an object of x,y arrays.\n * Throws an error if it's not.\n * @param data\n * @param options\n * @param options.minLength\n */\nexport function xyCheck(data, options = {}) {\n    const { minLength } = options;\n    if (data === null ||\n        typeof data !== 'object' ||\n        // @ts-expect-error Typechecking\n        !isAnyArray(data.x) ||\n        // @ts-expect-error Typechecking\n        !isAnyArray(data.y)) {\n        throw new Error('data must be an object of x and y arrays');\n    }\n    // @ts-expect-error Typechecking\n    if (data.x.length !== data.y.length) {\n        throw new Error('the x and y arrays must have the same length');\n    }\n    // @ts-expect-error Typechecking\n    if (minLength && data.x.length < minLength) {\n        throw new Error(`data.x must have a length of at least ${minLength}`);\n    }\n}\n//# sourceMappingURL=xyCheck.js.map","import { xGetFromToIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Finds the max y value in a range and return a {x,y} point\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n */\nexport function xyMaxYPoint(data, options = {}) {\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    if (x.length === 1) {\n        return { x: x[0], y: y[0], index: 0 };\n    }\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let current = { x: x[fromIndex], y: y[fromIndex], index: fromIndex };\n    for (let i = fromIndex; i <= toIndex; i++) {\n        if (y[i] > current.y)\n            current = { x: x[i], y: y[i], index: i };\n    }\n    return current;\n}\n//# sourceMappingURL=xyMaxYPoint.js.map","import { xCumulative, xMaxValue } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\nimport { xyMaxYPoint } from \"./xyMaxYPoint.js\";\nconst STEPS = [0.25, 0.5, 0.75];\n/**\n * Cumulative Distribution Statistics\n * @param data - array of points {x,y}\n * @returns x0, x25, x50, x75, x100, xMode, xMean (x for maxY)\n */\nexport function xyCumulativeDistributionStatistics(data) {\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    const cumulativeSum = xCumulative(y);\n    const maxY = xMaxValue(cumulativeSum);\n    for (let i = 0; i < cumulativeSum.length; i++) {\n        cumulativeSum[i] /= maxY;\n    }\n    const result = {\n        x0: x[0],\n        x25: 0,\n        x50: 0,\n        x75: 0,\n        x100: x.at(-1),\n        xMode: 0,\n        xMean: 0,\n    };\n    // need to find the x values closest to STEPS/100\n    let currentStep = 0;\n    breakPoint: for (let i = 1; i < cumulativeSum.length; i++) {\n        while (STEPS[currentStep] < cumulativeSum[i]) {\n            // Key is computed dynamically with a multiplication. This cannot be type-safe, hence the \"as\" assertion.\n            const key = `x${STEPS[currentStep] * 100}`;\n            result[key] =\n                x[i - 1] +\n                    (x[i] - x[i - 1]) *\n                        ((STEPS[currentStep] - cumulativeSum[i - 1]) /\n                            (cumulativeSum[i] - cumulativeSum[i - 1]));\n            currentStep++;\n            if (currentStep === STEPS.length)\n                break breakPoint;\n        }\n    }\n    result.xMode = xyMaxYPoint(data).x;\n    let sumXY = 0;\n    let sumY = 0;\n    for (let i = 0; i < x.length; i++) {\n        sumXY += x[i] * y[i];\n        sumY += y[i];\n    }\n    result.xMean = sumXY / sumY;\n    return result;\n}\n//# sourceMappingURL=xyCumulativeDistributionStatistics.js.map","/**\n * Normalize an array of zones:\n * - ensure than from < to\n * - merge overlapping zones\n * - deal with exclusions zones\n * - if no zones is specified add one between -Infinity and +Infinity\n * @param zones - array of zones\n * @param options - options\n * @returns array of zones\n */\nexport function zonesNormalize(zones = [], options = {}) {\n    const { exclusions = [] } = options;\n    let { from = Number.NEGATIVE_INFINITY, to = Number.POSITIVE_INFINITY } = options;\n    if (from > to)\n        [from, to] = [to, from];\n    zones = zones.map((zone) => zone.from > zone.to ? { from: zone.to, to: zone.from } : { ...zone });\n    zones.sort((a, b) => {\n        if (a.from !== b.from)\n            return a.from - b.from;\n        return a.to - b.to;\n    });\n    if (zones.length === 0) {\n        zones.push({ from, to });\n    }\n    for (const zone of zones) {\n        if (from > zone.from)\n            zone.from = from;\n        if (to < zone.to)\n            zone.to = to;\n    }\n    zones = zones.filter((zone) => zone.from <= zone.to);\n    if (zones.length === 0)\n        return [];\n    let currentZone = zones[0];\n    const beforeExclusionsZones = [currentZone];\n    for (let i = 1; i < zones.length; i++) {\n        const zone = zones[i];\n        if (zone.from <= currentZone.to) {\n            if (currentZone.to < zone.to) {\n                currentZone.to = zone.to;\n            }\n        }\n        else {\n            currentZone = zone;\n            beforeExclusionsZones.push(currentZone);\n        }\n    }\n    if (exclusions.length === 0)\n        return beforeExclusionsZones;\n    const normalizedExclusions = zonesNormalize(exclusions);\n    let currentExclusionIndex = 0;\n    const results = [];\n    for (let zoneIndex = 0; zoneIndex < beforeExclusionsZones.length; zoneIndex++) {\n        const zone = beforeExclusionsZones[zoneIndex];\n        if (currentExclusionIndex === normalizedExclusions.length) {\n            // we analysed all the exclusion zones\n            results.push(zone);\n            continue;\n        }\n        while (currentExclusionIndex < normalizedExclusions.length &&\n            normalizedExclusions[currentExclusionIndex].to <= zone.from) {\n            currentExclusionIndex++;\n        }\n        if (currentExclusionIndex === normalizedExclusions.length) {\n            // we analysed all the exclusion zones\n            results.push(zone);\n            continue;\n        }\n        if (zone.to < normalizedExclusions[currentExclusionIndex].from) {\n            // no problems, not yet in exclusion\n            results.push(zone);\n            continue;\n        }\n        if (normalizedExclusions[currentExclusionIndex].to >= zone.to) {\n            // could be totally excluded\n            if (normalizedExclusions[currentExclusionIndex].from <= zone.from) {\n                continue;\n            }\n            results.push({\n                from: normalizedExclusions[currentExclusionIndex].to,\n                to: zone.to,\n            });\n        }\n        // we cut in the middle, we need to create more zones, annoying !\n        if (normalizedExclusions[currentExclusionIndex].from > zone.from) {\n            results.push({\n                from: zone.from,\n                to: normalizedExclusions[currentExclusionIndex].from,\n            });\n        }\n        zone.from = normalizedExclusions[currentExclusionIndex].to;\n        zoneIndex--;\n    }\n    return results;\n}\n//# sourceMappingURL=zonesNormalize.js.map","import { zonesNormalize } from \"./zonesNormalize.js\";\n/**\n * Add the number of points per zone to reach a specified total\n * @param zones - array of zones\n * @param numberOfPoints - total number of points to distribute between zones\n * @param options - options\n * @returns array of zones with points\n */\nexport function zonesWithPoints(zones = [], \n/**\n * total number of points to distribute between zones\n * @default 10\n */\nnumberOfPoints = 10, options = {}) {\n    if (zones.length === 0)\n        return [];\n    const normalizedZones = zonesNormalize(zones, options);\n    const zonesWithNumberOfPoints = [];\n    const totalSize = normalizedZones.reduce((previous, current) => {\n        return previous + (current.to - current.from);\n    }, 0);\n    const unitsPerPoint = totalSize / numberOfPoints;\n    let currentTotal = 0;\n    for (let i = 0; i < normalizedZones.length - 1; i++) {\n        const tempZone = normalizedZones[i];\n        const tempZoneNumberOfPoints = Math.min(Math.round((tempZone.to - tempZone.from) / unitsPerPoint), numberOfPoints - currentTotal);\n        zonesWithNumberOfPoints.push({\n            ...tempZone,\n            numberOfPoints: tempZoneNumberOfPoints,\n        });\n        currentTotal += tempZoneNumberOfPoints;\n    }\n    zonesWithNumberOfPoints.push({\n        ...normalizedZones.at(-1),\n        numberOfPoints: numberOfPoints - currentTotal,\n    });\n    return zonesWithNumberOfPoints;\n}\n//# sourceMappingURL=zonesWithPoints.js.map","/**\n * Function that calculates the integral of the line between two\n * x-coordinates, given the slope and intercept of the line.\n * @param x0\n * @param x1\n * @param slope\n * @param intercept\n * @returns integral value.\n */\nexport default function integral(\n/** first coordinate of point */\nx0, \n/** second coordinate of point */\nx1, \n/** slope of the line */\nslope, \n/** intercept of the line on the y axis */\nintercept) {\n    return (0.5 * slope * x1 * x1 +\n        intercept * x1 -\n        (0.5 * slope * x0 * x0 + intercept * x0));\n}\n//# sourceMappingURL=integral.js.map","import integral from \"./integral.js\";\n/**\n * Function that retrieves the getEquallySpacedData with the variant \"smooth\".\n * @param x\n * @param y\n * @param from\n * @param to\n * @param numberOfPoints\n * @returns - Array of y's equally spaced with the variant \"smooth\"\n */\nexport default function equallySpacedSmooth(\n/** x coordinates */\nx, \n/** y coordinates */\ny, \n/** from value */\nfrom, \n/** to value */\nto, \n/** number of points */\nnumberOfPoints) {\n    const xLength = x.length;\n    const step = (to - from) / (numberOfPoints > 1 ? numberOfPoints - 1 : 1);\n    const halfStep = step / 2;\n    // Changed Array to Float64Array\n    const output = new Float64Array(numberOfPoints);\n    const initialOriginalStep = x[1] - x[0];\n    const lastOriginalStep = x[xLength - 1] - x[xLength - 2];\n    // Init main variables\n    let min = from - halfStep;\n    let max = from + halfStep;\n    let previousX = Number.MIN_SAFE_INTEGER;\n    let previousY = 0;\n    let nextX = x[0] - initialOriginalStep;\n    let nextY = 0;\n    let currentValue = 0;\n    let slope = 0;\n    let intercept = 0;\n    let sumAtMin = 0;\n    let sumAtMax = 0;\n    let i = 0; // index of input\n    let j = 0; // index of output\n    let add = 0;\n    main: while (true) {\n        if (previousX >= nextX)\n            throw new Error('x must be a growing series');\n        if (previousX <= min && min <= nextX) {\n            add = integral(0, min - previousX, slope, previousY);\n            sumAtMin = currentValue + add;\n        }\n        while (nextX - max >= 0) {\n            // no overlap with original point, just consume current value\n            add = integral(0, max - previousX, slope, previousY);\n            sumAtMax = currentValue + add;\n            output[j++] = (sumAtMax - sumAtMin) / step;\n            if (j === numberOfPoints) {\n                break main;\n            }\n            min = max;\n            max += step;\n            sumAtMin = sumAtMax;\n        }\n        currentValue += integral(previousX, nextX, slope, intercept);\n        previousX = nextX;\n        previousY = nextY;\n        if (i < xLength) {\n            nextX = x[i];\n            nextY = y[i];\n            i++;\n        }\n        else if (i === xLength) {\n            nextX += lastOriginalStep;\n            nextY = 0;\n        }\n        slope = getSlope(previousX, previousY, nextX, nextY);\n        intercept = -slope * previousX + previousY;\n    }\n    return output;\n}\nfunction getSlope(x0, y0, x1, y1) {\n    return (y1 - y0) / (x1 - x0);\n}\n//# sourceMappingURL=equallySpacedSmooth.js.map","import { createFromToArray } from \"../utils/index.js\";\nimport { zonesNormalize, zonesWithPoints } from \"../zones/index.js\";\nimport equallySpacedSlot from \"./utils/equallySpacedSlot.js\";\nimport equallySpacedSmooth from \"./utils/equallySpacedSmooth.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Function that returns a Number array of equally spaced numberOfPoints\n * containing a representation of intensities of the spectra arguments x\n * and y.\n *\n * The options parameter contains an object in the following form:\n * from: starting point\n * to: last point\n * numberOfPoints: number of points between from and to\n * variant: \"slot\" or \"smooth\" - smooth is the default option\n *\n * The slot variant consist that each point in an array is calculated\n * averaging the existing points between the slot that belongs to the current\n * value. The smooth variant is the same but takes the integral of the range\n * of the slot and divide by the step size between two points in an array.\n *\n * If exclusions zone are present, zones are ignored !\n * @param data - object containing 2 properties x and y\n * @param options - options\n * @returns new object with x / y array with the equally spaced data.\n */\nexport function xyEquallySpaced(data, options = {}) {\n    const { x, y } = data;\n    const xLength = x.length;\n    const { from = x[0], to = x[xLength - 1], variant = 'smooth', numberOfPoints = 100, exclusions = [], zones = [{ from, to }], } = options;\n    if (from > to) {\n        throw new RangeError('from should be larger than to');\n    }\n    xyCheck(data);\n    if (numberOfPoints < 2) {\n        throw new RangeError(\"'numberOfPoints' option must be greater than 1\");\n    }\n    const normalizedZones = zonesNormalize(zones, { from, to, exclusions });\n    const zonesWithPointsRes = zonesWithPoints(normalizedZones, numberOfPoints, {\n        from,\n        to,\n    }).filter((zone) => zone.numberOfPoints);\n    let xResult = [];\n    let yResult = [];\n    for (const zone of zonesWithPointsRes) {\n        if (!zone.numberOfPoints) {\n            zone.numberOfPoints = 0;\n        }\n        const zoneResult = processZone(Array.from(x), Array.from(y), zone.from, zone.to, zone.numberOfPoints, variant);\n        xResult = xResult.concat(zoneResult.x);\n        yResult = yResult.concat(zoneResult.y);\n    }\n    return { x: xResult, y: yResult };\n}\nfunction processZone(x, y, from, to, numberOfPoints, variant) {\n    if (numberOfPoints < 1) {\n        throw new RangeError('the number of points must be at least 1');\n    }\n    const output = variant === 'slot'\n        ? Array.from(equallySpacedSlot(x, y, from, to, numberOfPoints))\n        : Array.from(equallySpacedSmooth(x, y, from, to, numberOfPoints));\n    return {\n        x: Array.from(createFromToArray({\n            from,\n            to,\n            length: numberOfPoints,\n        })),\n        y: output,\n    };\n}\n//# sourceMappingURL=xyEquallySpaced.js.map","/**\n * Function that retrieves the getEquallySpacedData with the variant \"slot\".\n * @param x\n * @param y\n * @param from\n * @param to\n * @param numberOfPoints\n * @returns Array of y's equally spaced with the variant \"slot\"\n */\nexport default function equallySpacedSlot(\n/** x coordinates */\nx, \n/** y coordinates */\ny, \n/** from value */\nfrom, \n/** to value */\nto, \n/** number of points */\nnumberOfPoints) {\n    const xLength = x.length;\n    if (xLength < 2) {\n        return Float64Array.from(x);\n    }\n    const step = (to - from) / (numberOfPoints > 1 ? numberOfPoints - 1 : 1);\n    const halfStep = step / 2;\n    const lastStep = x.at(-1) - x.at(-2);\n    const start = from - halfStep;\n    // Changed Array to Float64Array\n    const output = new Float64Array(numberOfPoints);\n    // Init main variables\n    let min = start;\n    let max = start + step;\n    let previousX = -Number.MAX_VALUE;\n    let previousY = 0;\n    let nextX = x[0];\n    let nextY = y[0];\n    let frontOutsideSpectra = 0;\n    let backOutsideSpectra = true;\n    let currentValue = 0;\n    // for slot algorithm\n    let currentPoints = 0;\n    let i = 1; // index of input\n    let j = 0; // index of output\n    main: while (true) {\n        if (previousX >= nextX)\n            throw new Error('x must be a growing series');\n        while (previousX - max > 0) {\n            // no overlap with original point, just consume current value\n            if (backOutsideSpectra) {\n                currentPoints++;\n                backOutsideSpectra = false;\n            }\n            output[j] = currentPoints <= 0 ? 0 : currentValue / currentPoints;\n            j++;\n            if (j === numberOfPoints) {\n                break main;\n            }\n            min = max;\n            max += step;\n            currentValue = 0;\n            currentPoints = 0;\n        }\n        if (previousX > min) {\n            currentValue += previousY;\n            currentPoints++;\n        }\n        if (previousX === -Number.MAX_VALUE || frontOutsideSpectra > 1) {\n            currentPoints--;\n        }\n        previousX = nextX;\n        previousY = nextY;\n        if (i < xLength) {\n            nextX = x[i];\n            nextY = y[i];\n            i++;\n        }\n        else {\n            nextX += lastStep;\n            nextY = 0;\n            frontOutsideSpectra++;\n        }\n    }\n    return output;\n}\n//# sourceMappingURL=equallySpacedSlot.js.map","import { xGetFromToIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Calculate integration\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n * @returns - xyIntegration value on the specified range\n */\nexport function xyIntegration(data, options = {}) {\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    if (x.length === 1)\n        return 0;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let currentxyIntegration = 0;\n    for (let i = fromIndex; i < toIndex; i++) {\n        currentxyIntegration += ((x[i + 1] - x[i]) * (y[i + 1] + y[i])) / 2;\n    }\n    return currentxyIntegration;\n}\n//# sourceMappingURL=xyIntegration.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * Interpolate y values at target x positions using linear interpolation.\n * This is useful for upsampling or resampling data to specific x positions.\n * Both the input data and target x values must be sorted in ascending order.\n * Uses a two-pointer approach with O(n + m) complexity.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param xTarget - Target x positions where y values should be interpolated\n * @returns - Interpolated y values at target x positions\n */\nexport function xyInterpolateLinear(data, xTarget) {\n    xyCheck(data);\n    const { x, y } = data;\n    if (x.length === 0) {\n        return new Float64Array(0);\n    }\n    const result = new Float64Array(xTarget.length);\n    let sparseIndex = 0;\n    for (let i = 0; i < xTarget.length; i++) {\n        const targetX = xTarget[i];\n        // Move sparse index forward while we can\n        while (sparseIndex < x.length - 1 && x[sparseIndex + 1] < targetX) {\n            sparseIndex++;\n        }\n        // Handle edge cases\n        if (sparseIndex === 0 && targetX <= x[0]) {\n            // Before first point\n            if (x.length === 1) {\n                result[i] = y[0];\n            }\n            else {\n                // Extrapolate using first two points\n                const t = (targetX - x[0]) / (x[1] - x[0]);\n                result[i] = y[0] * (1 - t) + y[1] * t;\n            }\n        }\n        else if (sparseIndex >= x.length - 1) {\n            // After last point\n            result[i] = y[x.length - 1];\n        }\n        else {\n            // Normal interpolation between two points\n            const leftIdx = sparseIndex;\n            const rightIdx = sparseIndex + 1;\n            const t = (targetX - x[leftIdx]) / (x[rightIdx] - x[leftIdx]);\n            result[i] = y[leftIdx] * (1 - t) + y[rightIdx] * t;\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=xyInterpolateLinear.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * Join x / y values when difference in X is closer than delta.\n * When joining, y values are summed and x values are weighted average\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n * @returns - An object with the xyIntegration function\n */\nexport function xyJoinX(data, options = {}) {\n    xyCheck(data);\n    const { delta = 1 } = options;\n    const deltaIsFunction = typeof delta === 'function';\n    const x = Array.from(data.x);\n    const y = Array.from(data.y);\n    if (x.length < 2) {\n        return { x, y };\n    }\n    let position = 0;\n    for (let i = 1; i < x.length; i++) {\n        const difference = x[i] - x[i - 1];\n        const currentDelta = deltaIsFunction ? delta((x[i] + x[i - 1]) / 2) : delta;\n        if (difference <= currentDelta) {\n            // we join\n            if (y[position] !== 0 || y[i] !== 0) {\n                x[position] =\n                    (x[position] * y[position] + x[i] * y[i]) / (y[position] + y[i]);\n                y[position] += y[i];\n            }\n        }\n        else {\n            position++;\n            x[position] = x[i];\n            y[position] = y[i];\n        }\n    }\n    x.length = position + 1;\n    y.length = position + 1;\n    return { x, y };\n}\n//# sourceMappingURL=xyJoinX.js.map","import { xFindClosestIndex } from \"../x/index.js\";\nimport { zonesNormalize } from \"../zones/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Reduce the number of points while keeping visually the same noise. Practical to\n * display many spectra as SVG. If you want a similar looking spectrum you should still however\n * generate at least 4x the nbPoints that is being displayed.\n *\n * SHOULD NOT BE USED FOR DATA PROCESSING !!!\n * You should rather use ml-xy-equally-spaced to make further processing\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns Object with x and y arrays\n */\nexport function xyReduce(data, options = {}) {\n    xyCheck(data);\n    // todo we should check that the single point is really in the range and the zones\n    if (data.x.length < 2) {\n        return {\n            x: Float64Array.from(data.x),\n            y: Float64Array.from(data.y),\n        };\n    }\n    const { x, y } = data;\n    const { from = x[0], to = x.at(-1), nbPoints = 4001, optimize = false, } = options;\n    let { zones = [] } = options;\n    zones = zonesNormalize(zones, { from, to });\n    if (zones.length === 0)\n        zones = [{ from, to }]; // we take everything\n    const { internalZones, totalPoints } = getInternalZones(zones, x);\n    // we calculate the number of points per zone that we should keep\n    if (totalPoints <= nbPoints) {\n        return notEnoughPoints(x, y, internalZones, totalPoints);\n    }\n    // need to xyReduce number of points\n    const ratio = nbPoints / totalPoints;\n    let currentTotal = 0;\n    for (let i = 0; i < internalZones.length - 1; i++) {\n        const zone = internalZones[i];\n        zone.nbPoints = Math.round(zone.nbPoints * ratio);\n        currentTotal += zone.nbPoints;\n    }\n    internalZones.at(-1).nbPoints = nbPoints - currentTotal;\n    const newX = [];\n    const newY = [];\n    for (const zone of internalZones) {\n        if (!zone.nbPoints)\n            continue;\n        appendFromTo(zone.fromIndex, zone.toIndex, zone.nbPoints);\n    }\n    return { x: newX, y: newY };\n    /**\n     * AppendFromTo.\n     * @param fromIndex - From.\n     * @param  toIndex - To.\n     * @param zoneNbPoints - NbPoints.\n     */\n    function appendFromTo(fromIndex, toIndex, zoneNbPoints) {\n        if (zoneNbPoints === 1) {\n            newX.push(x[Math.round((toIndex - fromIndex) / 2)]);\n            newY.push(y[Math.round((toIndex - fromIndex) / 2)]);\n            return;\n        }\n        if (zoneNbPoints === 2) {\n            newX.push(x[fromIndex], x[toIndex]);\n            newY.push(y[fromIndex], y[toIndex]);\n            return;\n        }\n        newX.push(x[fromIndex]);\n        newY.push(y[fromIndex]);\n        if (zoneNbPoints % 2 === 0) {\n            zoneNbPoints = zoneNbPoints / 2 + 1;\n        }\n        else {\n            zoneNbPoints = (zoneNbPoints - 1) / 2 + 1;\n        }\n        // we will need to make some kind of min / max because there are too many points\n        // we will always keep the first point and the last point\n        const slot = (x[toIndex] - x[fromIndex]) / (zoneNbPoints - 1);\n        let currentX = x[fromIndex] + slot;\n        let first = true;\n        let minY = Number.POSITIVE_INFINITY;\n        let xyMaxY = Number.NEGATIVE_INFINITY;\n        for (let i = fromIndex + 1; i <= toIndex; i++) {\n            if (first) {\n                minY = y[i];\n                xyMaxY = y[i];\n                first = false;\n            }\n            else {\n                if (y[i] < minY)\n                    minY = y[i];\n                if (y[i] > xyMaxY)\n                    xyMaxY = y[i];\n            }\n            if (x[i] >= currentX || i === toIndex) {\n                if (optimize) {\n                    if (minY > newY[newX.length - 1]) {\n                        // we can skip the intermediate value\n                    }\n                    else if (xyMaxY < newY[newX.length - 1]) {\n                        // we can skip the intermediate value\n                        xyMaxY = minY;\n                    }\n                    else {\n                        newX.push(currentX - slot / 2);\n                        newY.push(minY);\n                    }\n                }\n                else {\n                    newX.push(currentX - slot / 2);\n                    newY.push(minY);\n                }\n                newX.push(currentX);\n                newY.push(xyMaxY);\n                currentX += slot;\n                first = true;\n            }\n        }\n    }\n}\nexport function notEnoughPoints(x, y, internalZones, totalPoints) {\n    const newX = new Float64Array(totalPoints);\n    const newY = new Float64Array(totalPoints);\n    let index = 0;\n    for (const zone of internalZones) {\n        for (let i = zone.fromIndex; i < zone.toIndex + 1; i++) {\n            newX[index] = x[i];\n            newY[index] = y[i];\n            index++;\n        }\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\nexport function getInternalZones(zones, x) {\n    // for each zone we should know the first index, the last index and the number of points\n    const internalZones = [];\n    let totalPoints = 0;\n    for (const zone of zones) {\n        let fromIndex = xFindClosestIndex(x, zone.from);\n        let toIndex = xFindClosestIndex(x, zone.to);\n        if (fromIndex > 0 && x[fromIndex] > zone.from) {\n            fromIndex--;\n        }\n        if (toIndex < x.length - 1 && x[toIndex] < zone.to) {\n            toIndex++;\n        }\n        const nbPoints = toIndex - fromIndex + 1;\n        internalZones.push({\n            from: zone.from,\n            to: zone.to,\n            fromIndex,\n            toIndex,\n            nbPoints,\n        });\n        totalPoints += nbPoints;\n    }\n    return { internalZones, totalPoints };\n}\n//# sourceMappingURL=xyReduce.js.map","import { xIsMonotonic } from \"../x/index.js\";\n/**\n * This function performs a quick sort of the x array while transforming the y array to preserve the coordinates.\n * @param data - Object that contains property x (Array) and y (Array)\n */\nexport function xySortX(data) {\n    const { x, y } = data;\n    if (xIsMonotonic(x) && x.length > 1) {\n        const floatX = Float64Array.from(x);\n        const floatY = Float64Array.from(y);\n        if (floatX.at(-1) < floatX[0]) {\n            floatX.reverse();\n            floatY.reverse();\n        }\n        return {\n            x: floatX,\n            y: floatY,\n        };\n    }\n    const xyObject = Array.from(x, (val, index) => ({\n        x: val,\n        y: y[index],\n    }));\n    xyObject.sort((a, b) => a.x - b.x);\n    const response = {\n        x: new Float64Array(x.length),\n        y: new Float64Array(y.length),\n    };\n    for (let i = 0; i < x.length; i++) {\n        response.x[i] = xyObject[i].x;\n        response.y[i] = xyObject[i].y;\n    }\n    return response;\n}\n//# sourceMappingURL=xySortX.js.map","import { xyCheck } from \"./xyCheck.js\";\nimport { xySortX } from \"./xySortX.js\";\n/**\n * Ensure x values are unique\n * @param data - Object that contains property x (Array) and y (Array)\n * @param options - Object containing a property algorithm (can be 'sum' or 'average', the latter being the default value), and a property isSorted (boolean indicating if the x-array is sorted).\n */\nexport function xyUniqueX(data, options = {}) {\n    xyCheck(data);\n    if (data.x.length === 0) {\n        return { x: [], y: [] };\n    }\n    const { algorithm = 'average', isSorted = true } = options;\n    if (!isSorted) {\n        data = xySortX(data);\n    }\n    switch (algorithm) {\n        case 'average':\n            return average(data);\n        case 'sum':\n            return sum(data);\n        default:\n            throw new Error(`unknown algorithm: ${String(algorithm)}`);\n    }\n}\n/**\n * Average.\n * @param data - Input.\n * @returns Result.\n */\nfunction average(data) {\n    const x = [];\n    const y = [];\n    let cumulativeY = data.y[0];\n    let divider = 1;\n    for (let i = 1; i < data.x.length; i++) {\n        if (!(data.x[i] === data.x[i - 1])) {\n            x.push(data.x[i - 1]);\n            y.push(cumulativeY / divider);\n            cumulativeY = 0;\n            divider = 0;\n        }\n        cumulativeY += data.y[i];\n        divider++;\n    }\n    x.push(data.x.at(-1));\n    y.push(cumulativeY / divider);\n    return { x, y };\n}\n/**\n * Sum.\n * @param data - Input.\n * @returns Result.\n */\nfunction sum(data) {\n    const x = [];\n    const y = [];\n    let cumulativeY = data.y[0];\n    for (let i = 1; i < data.x.length; i++) {\n        if (!(data.x[i] === data.x[i - 1])) {\n            x.push(data.x[i - 1]);\n            y.push(cumulativeY);\n            cumulativeY = 0;\n        }\n        cumulativeY += data.y[i];\n    }\n    x.push(data.x.at(-1));\n    y.push(cumulativeY);\n    return { x, y };\n}\n//# sourceMappingURL=xyUniqueX.js.map","/**\n * GetSlots.\n * @param data - data.\n * @param options - Options.\n */\nexport function getSlots(data, options = {}) {\n    const { delta = 1 } = options;\n    const deltaIsFunction = typeof delta === 'function';\n    const possibleXs = Float64Array.from(data.flatMap((spectrum) => spectrum.x));\n    possibleXs.sort();\n    if (possibleXs.length === 0) {\n        throw new Error('can not process empty arrays');\n    }\n    let currentSlot = {\n        from: possibleXs[0],\n        to: possibleXs[0],\n        average: possibleXs[0],\n        sum: possibleXs[0],\n        number: 1,\n    };\n    const slots = [currentSlot];\n    for (let i = 1; i < possibleXs.length; i++) {\n        const currentDelta = deltaIsFunction ? delta(possibleXs[i]) : delta;\n        if (possibleXs[i] - currentSlot.to <= currentDelta) {\n            currentSlot.to = possibleXs[i];\n            currentSlot.number++;\n            currentSlot.sum += possibleXs[i];\n            currentSlot.average = currentSlot.sum / currentSlot.number;\n        }\n        else {\n            currentSlot = {\n                from: possibleXs[i],\n                to: possibleXs[i],\n                average: possibleXs[i],\n                sum: possibleXs[i],\n                number: 1,\n            };\n            slots.push(currentSlot);\n        }\n    }\n    return slots;\n}\n//# sourceMappingURL=getSlots.js.map","/**\n * Merge DataXY\n * We have an array of DataXY and the goal is to merge all the values for which the deltaX is small or equal to delta.\n * X values are weighted average\n * @param data - data\n * @param options - Options\n */\nexport function xyArrayWeightedMerge(data, options = {}) {\n    let { delta = 1 } = options;\n    if (typeof delta === 'number') {\n        const deltaNumber = delta;\n        delta = () => deltaNumber;\n    }\n    data = data.filter((spectrum) => spectrum.x.length > 0);\n    if (data.length === 0)\n        return { x: [], y: [] };\n    const x = [];\n    const y = [];\n    const positions = new Array(data.length).fill(0);\n    const point = { x: 0, y: 0 };\n    nextValue(data, positions, point);\n    const slot = {\n        maxX: point.x + delta(point.x),\n        sumY: point.y,\n        sumXY: point.y * point.x,\n    };\n    while (data.length > 0) {\n        nextValue(data, positions, point);\n        const sameSlot = point.x <= slot.maxX;\n        if (!sameSlot) {\n            if (slot.sumY > 0) {\n                x.push(slot.sumXY / slot.sumY);\n                y.push(slot.sumY);\n            }\n            slot.sumY = 0;\n            slot.sumXY = 0;\n        }\n        slot.sumY += point.y;\n        slot.sumXY += point.x * point.y;\n        slot.maxX = point.x + delta(point.x);\n        if (data.length === 0 && slot.sumY > 0) {\n            x.push(slot.sumXY / slot.sumY);\n            y.push(slot.sumY);\n        }\n    }\n    return { x, y };\n}\n/**\n * NextValue.\n * @param data - data.\n * @param positions - Positions array.\n * @param point - Point.\n */\nfunction nextValue(data, positions, point) {\n    let minIndex = 0;\n    let minX = data[0].x[positions[0]];\n    for (let i = 1; i < data.length; i++) {\n        const currentX = data[i].x[positions[i]];\n        if (currentX < minX) {\n            minX = currentX;\n            minIndex = i;\n        }\n    }\n    point.x = minX;\n    point.y = data[minIndex].y[positions[minIndex]];\n    positions[minIndex]++;\n    if (positions[minIndex] === data[minIndex].x.length) {\n        positions.splice(minIndex, 1);\n        data.splice(minIndex, 1);\n    }\n}\n//# sourceMappingURL=xyArrayWeightedMerge.js.map","/**\n * Throws an error if it's not an array of x,y objects.\n * Only checks the first element.\n * @param points - List of points.\n * @param options - Additional checks.\n */\nexport function xyObjectCheck(points, options = {}) {\n    const { minLength = 0 } = options;\n    if (!Array.isArray(points)) {\n        throw new Error('points must be an array of {x,y} objects');\n    }\n    if (points.length > 0 &&\n        (typeof points[0].x !== 'number' || typeof points[0].y !== 'number')) {\n        throw new Error('points must be an array of {x,y} objects');\n    }\n    if (minLength && points.length < minLength) {\n        throw new Error(`points must have a length of at least ${minLength}`);\n    }\n}\n//# sourceMappingURL=xyObjectCheck.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Finds the max x value and return a {x,y,index} point\n * @param points - Object that contains property x (an ordered increasing array) and y (an array)\n */\nexport function xyObjectMaxXPoint(points = []) {\n    xyObjectCheck(points);\n    if (points.length === 0)\n        return { x: 0, y: 0 };\n    let current = {\n        x: points[0].x,\n        y: points[0].y,\n        index: 0,\n    };\n    for (let i = 1; i < points.length; i++) {\n        if (points[i].x > current.x) {\n            current = {\n                x: points[i].x,\n                y: points[i].y,\n                index: i,\n            };\n        }\n    }\n    return current;\n}\n//# sourceMappingURL=xyObjectMaxXPoint.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Finds the min x value and return a {x,y,index} point\n * @param points - Object that contains property x (an ordered increasing array) and y (an array)\n */\nexport function xyObjectMinXPoint(points = []) {\n    xyObjectCheck(points);\n    if (points.length === 0)\n        return { x: 0, y: 0 };\n    let current = {\n        x: points[0].x,\n        y: points[0].y,\n        index: 0,\n    };\n    for (let i = 1; i < points.length; i++) {\n        if (points[i].x < current.x) {\n            current = {\n                x: points[i].x,\n                y: points[i].y,\n                index: i,\n            };\n        }\n    }\n    return current;\n}\n//# sourceMappingURL=xyObjectMinXPoint.js.map","/**\n * xyObjectSlotX\n * @param points - Array of growing points {x,y}.\n * @param options - Options.\n */\nexport function xyObjectSlotX(points, options = {}) {\n    const { slotWidth = 1 } = options;\n    const halfSlot = slotWidth / 2;\n    // when we join we will use the center of mass\n    const result = [];\n    let current = {\n        x: Number.NEGATIVE_INFINITY,\n        y: 0,\n    };\n    for (const point of points) {\n        const slot = point.x - ((point.x + halfSlot) % slotWidth) + halfSlot;\n        if (Math.abs(current.x - slot) > Number.EPSILON) {\n            current = {\n                x: slot,\n                y: 0,\n            };\n            result.push(current);\n        }\n        current.y += point.y;\n    }\n    return result;\n}\n//# sourceMappingURL=xyObjectSlotX.js.map","/**\n * Create an array with numbers starting from \"from\" with step \"step\" of length \"length\".\n * @param options - options\n * @returns - array of distributed numbers with step \"step\" from \"from\"\n */\nexport function createStepArray(options = {}) {\n    const { from = 0, step = 1, length = 1000 } = options;\n    const array = new Float64Array(length);\n    let index = 0;\n    while (index < length) {\n        array[index] = from + step * index;\n        index++;\n    }\n    return array;\n}\n//# sourceMappingURL=createStepArray.js.map","/**\n * Generate all combinations of choosing k items from n items.\n * @param n - Total number of items.\n * @param k - Number of items to choose.\n * @returns Array of combinations, where each combination is an array of indices.\n */\nexport function getCombinations(n, k) {\n    if (k === 0)\n        return [[]];\n    if (k > n)\n        return [];\n    const results = [];\n    const current = [];\n    function backtrack(start) {\n        if (current.length === k) {\n            results.push([...current]);\n            return;\n        }\n        for (let i = start; i < n; i++) {\n            current.push(i);\n            backtrack(i + 1);\n            current.pop();\n        }\n    }\n    backtrack(0);\n    return results;\n}\n//# sourceMappingURL=getCombinations.js.map","/**\n * Generate all combinations of choosing k items from n items as an iterator.\n * Useful for large combination sets to avoid storing all combinations in memory.\n * @param n - Total number of items.\n * @param k - Number of items to choose.\n * @yields Each combination as an array of indices.\n */\nexport function* getCombinationsIterator(n, k) {\n    if (k === 0) {\n        yield [];\n        return;\n    }\n    if (k > n)\n        return;\n    const current = [];\n    function* backtrack(start) {\n        if (current.length === k) {\n            yield [...current];\n            return;\n        }\n        for (let i = start; i < n; i++) {\n            current.push(i);\n            yield* backtrack(i + 1);\n            current.pop();\n        }\n    }\n    yield* backtrack(0);\n}\n//# sourceMappingURL=getCombinationsIterator.js.map","export function getRescaler(options = {}) {\n    const { targetMin = 0, targetMax = 1, clamp = true, algorithmOptions = {}, algorithm = 'linear', } = options;\n    let { originalMin = 0, originalMax = 1 } = options;\n    const convert = getDataConverter(algorithm, algorithmOptions);\n    originalMin = convert(originalMin);\n    originalMax = convert(originalMax);\n    const originalRange = originalMax - originalMin;\n    const targetRange = targetMax - targetMin;\n    return function rescaler(value) {\n        value = convert(value);\n        value = checkRange(value, originalMin, originalMax, clamp);\n        const valueScaled = (value - originalMin) / originalRange;\n        return targetMin + valueScaled * targetRange;\n    };\n}\nfunction getDataConverter(kind = 'linear', options = {}) {\n    return (value) => {\n        switch (kind) {\n            case 'linear':\n                return value;\n            case 'logarithmic':\n                return Math.log10(value);\n            case 'power':\n                return value ** (options.power || 2);\n            default:\n                throw new Error(`Unknown kind ${String(kind)}`);\n        }\n    };\n}\nfunction checkRange(value, min, max, clamp = true) {\n    if (value < min) {\n        if (clamp)\n            return min;\n        throw new RangeError(`Value ${value} is out of range [${min}, ${max}]`);\n    }\n    if (value > max) {\n        if (clamp)\n            return max;\n        throw new RangeError(`Value ${value} is out of range [${min}, ${max}]`);\n    }\n    return value;\n}\n//# sourceMappingURL=getRescaler.js.map","import { xMedian } from \"../x/index.js\";\n/**\n * Returns the median of the absolute matrix.\n * @param matrix\n */\nexport function matrixAbsoluteMedian(matrix) {\n    const nbColumns = matrix[0].length;\n    const flatten = new Float64Array(matrix.length * nbColumns);\n    for (let row = 0; row < matrix.length; row++) {\n        const currentRow = row * nbColumns;\n        for (let column = 0; column < nbColumns; column++) {\n            const value = matrix[row][column];\n            flatten[currentRow + column] = Math.abs(value);\n        }\n    }\n    return xMedian(flatten);\n}\n//# sourceMappingURL=matrixAbsoluteMedian.js.map","import { xMaxValue } from \"../x/index.js\";\nimport { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\n/**\n * Numerically encodes the strings in the matrix with an encoding dictionary.\n * @param matrixInitial - Original matrix before encoding.\n * @param dictionary - Dictionary against which to do the encoding.\n * @returns - Encoded matrix.\n */\nexport function matrixApplyNumericalEncoding(matrixInitial, dictionary) {\n    const matrix = matrixCreateEmpty({\n        nbRows: matrixInitial.length,\n        nbColumns: matrixInitial[0].length,\n        ArrayConstructor: Array,\n    });\n    const arrayOfValues = [];\n    for (const key in dictionary) {\n        arrayOfValues.push(dictionary[key]);\n    }\n    let k = xMaxValue(arrayOfValues);\n    for (const row of matrix) {\n        for (let j = 0; j < matrix[0].length; j++) {\n            if (typeof row[j] === 'string') {\n                if (row[j] in dictionary) {\n                    row[j] = dictionary[row[j]];\n                }\n                else {\n                    k++;\n                    dictionary[row[j]] = k;\n                    row[j] = k;\n                }\n            }\n        }\n    }\n    return matrix;\n}\n//# sourceMappingURL=matrixApplyNumericalEncoding.js.map","import { xCorrelation } from \"../x/index.js\";\nexport function matrixAutoCorrelation(matrix, index = 0) {\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    if (nbRows < 2) {\n        throw new Error('can not calculate info if matrix contains less than 2 rows');\n    }\n    const targetArray = new Float64Array(nbRows);\n    const sourceArray = new Float64Array(nbRows);\n    const result = new Float64Array(nbColumns);\n    for (let j = 0; j < nbRows; j++) {\n        targetArray[j] = matrix[j][index];\n    }\n    for (let i = 0; i < nbColumns; i++) {\n        for (let j = 0; j < nbRows; j++) {\n            sourceArray[j] = matrix[j][i];\n        }\n        result[i] = xCorrelation(targetArray, sourceArray);\n    }\n    return result;\n}\n//# sourceMappingURL=matrixAutoCorrelation.js.map","export function matrixBoxPlot(matrix) {\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    if (nbRows < 5) {\n        throw new Error('can not calculate info if matrix contains less than 5 rows');\n    }\n    const info = {\n        q1: new Float64Array(nbColumns),\n        median: new Float64Array(nbColumns),\n        q3: new Float64Array(nbColumns),\n        min: Float64Array.from(matrix[0]),\n        max: Float64Array.from(matrix.at(-1)),\n    };\n    const columnArray = new Float64Array(matrix.length);\n    for (let column = 0; column < nbColumns; column++) {\n        for (let row = 0; row < nbRows; row++) {\n            columnArray[row] = matrix[row][column];\n        }\n        let q1max = 0;\n        let q3min = 0;\n        if (nbRows % 2 === 1) {\n            // odd\n            const middle = (nbRows - 1) / 2;\n            info.median[column] = columnArray[middle];\n            q1max = middle - 1;\n            q3min = middle + 1;\n        }\n        else {\n            // even\n            q3min = nbRows / 2;\n            q1max = q3min - 1;\n            info.median[column] = (columnArray[q1max] + columnArray[q3min]) / 2;\n        }\n        if (q1max % 2 === 0) {\n            info.q1[column] = columnArray[q1max / 2];\n            info.q3[column] = columnArray[(nbRows + q3min - 1) / 2];\n        }\n        else {\n            info.q1[column] =\n                (columnArray[(q1max + 1) / 2] + columnArray[(q1max - 1) / 2]) / 2;\n            const middleOver = (columnArray.length + q3min) / 2;\n            info.q3[column] =\n                (columnArray[middleOver] + columnArray[middleOver - 1]) / 2;\n        }\n    }\n    return info;\n}\n//# sourceMappingURL=matrixBoxPlot.js.map","import { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\n/**\n * Center mean of matrix columns.\n * @param matrix - matrix [rows][cols]\n */\nexport function matrixCenterZMean(matrix) {\n    const nbColumns = matrix[0].length;\n    const nbRows = matrix.length;\n    const newMatrix = matrixCreateEmpty({ nbColumns, nbRows });\n    for (let column = 0; column < nbColumns; column++) {\n        let mean = 0;\n        for (let row = 0; row < nbRows; row++) {\n            mean += matrix[row][column];\n        }\n        mean /= nbRows;\n        for (let row = 0; row < nbRows; row++) {\n            newMatrix[row][column] = matrix[row][column] - mean;\n        }\n    }\n    return newMatrix;\n}\n//# sourceMappingURL=matrixCenterZMean.js.map","import { Matrix } from 'ml-matrix';\nimport { xCorrelation } from \"../x/index.js\";\n/**\n * Calculates a correlation matrix based on the columns of the initial matrix.\n * @param A - matrix [rows][cols]\n */\nexport function matrixColumnsCorrelation(A) {\n    const B = new Matrix(A).transpose();\n    const result = [];\n    for (let i = 0; i < B.rows; i++) {\n        result.push(new Float64Array(B.rows));\n    }\n    for (let i = 0; i < B.rows; i++) {\n        for (let j = i; j < B.rows; j++) {\n            const correlation = xCorrelation(B.getRow(i), B.getRow(j));\n            result[i][j] = correlation;\n            result[j][i] = correlation;\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=matrixColumnsCorrelation.js.map","import { matrixCheckRanges } from \"./matrixCheckRanges.js\";\n/**\n * Get a subMatrix from matrix, the function checks if the subMatrix\n * lies within the dimensions of the matrix.\n * @param matrix - The original matrix from which the subMatrix will be extracted.\n * @param options - Options to define the subMatrix boundaries and duplication behavior.\n * @returns The subMatrix extracted from the original matrix.\n */\nexport function matrixGetSubMatrix(matrix, options) {\n    const { startRow, endRow, startColumn, endColumn, duplicate = true, } = options;\n    matrixCheckRanges(matrix, { startColumn, startRow, endColumn, endRow });\n    const nbRows = endRow - startRow + 1;\n    const subMatrix = [];\n    if (duplicate) {\n        for (let i = 0; i < nbRows; i++) {\n            subMatrix.push(matrix[startRow + i].slice(startColumn, endColumn + 1));\n        }\n    }\n    else {\n        for (let i = 0; i < nbRows; i++) {\n            subMatrix.push(matrix[startRow + i].subarray(startColumn, endColumn + 1));\n        }\n    }\n    return subMatrix;\n}\n//# sourceMappingURL=matrixGetSubMatrix.js.map","import FFT from 'fft.js';\nimport { isPowerOfTwo } from \"../utils/index.js\";\nimport { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\n/**\n * Apply the Hilbert transform to each row of a real-valued matrix, reusing a\n * single FFT instance for all rows to avoid repeated instantiation overhead.\n * All rows must have the same length, which must be a power of two.\n * @param rows - array of real-valued Float64Array rows\n * @param options - options\n * @returns array of Hilbert-transformed Float64Array rows\n * @see DOI: 10.1109/TAU.1970.1162139 \"Discrete Hilbert transform\"\n */\nexport function matrixHilbertTransform(rows, options = {}) {\n    if (rows.length === 0)\n        return [];\n    const size = rows[0].length;\n    if (!isPowerOfTwo(size)) {\n        throw new RangeError(`Row length must be a power of two. Got ${size}.`);\n    }\n    for (let j = 1; j < rows.length; j++) {\n        if (rows[j].length !== size) {\n            throw new RangeError(`All rows must have the same length. Expected ${size} but row ${j} has length ${rows[j].length}.`);\n        }\n    }\n    // Single FFT instance reused across all rows\n    const fft = new FFT(size);\n    // Multiplier computed once — identical for every row of the same length\n    const half = size >> 1;\n    // Shared working buffers reused across all rows\n    const fftResult = new Float64Array(size * 2);\n    const hilbertSignal = new Float64Array(size * 2);\n    const { output = matrixCreateEmpty({\n        nbRows: rows.length,\n        nbColumns: size,\n    }), } = options;\n    for (let j = 0; j < rows.length; j++) {\n        const row = rows[j];\n        fft.realTransform(fftResult, row);\n        fft.completeSpectrum(fftResult);\n        const idx = half << 1;\n        fftResult[idx] = 0;\n        fftResult[idx + 1] = 0;\n        // Negate negative frequencies\n        for (let c = (half + 1) << 1; c < fftResult.length; c += 2) {\n            fftResult[c] = -fftResult[c];\n            fftResult[c + 1] = -fftResult[c + 1];\n        }\n        fft.inverseTransform(hilbertSignal, fftResult);\n        const result = output[j];\n        for (let i = 0; i < size; i++) {\n            result[i] = hilbertSignal[i * 2 + 1];\n        }\n    }\n    return output;\n}\n//# sourceMappingURL=matrixHilbertTransform.js.map","import { xHistogram } from \"../x/index.js\";\nimport { matrixMinMaxAbsoluteZ } from \"./matrixMinMaxAbsoluteZ.js\";\nimport { matrixMinMaxZ } from \"./matrixMinMaxZ.js\";\n/**\n * Calculates a histogram of defined number of slots.\n * @param matrix - matrix [rows][cols].\n * @param options - options\n * @returns - Result of the histogram.\n */\nexport function matrixHistogram(matrix, options = {}) {\n    let { min, max } = options;\n    const { absolute, logBaseX, logBaseY, histogram, nbSlots, centerX } = options;\n    if (matrix.length === 0 || matrix[0].length === 0) {\n        throw new Error('matrix must have at least one column and one row');\n    }\n    if (min === undefined || max === undefined) {\n        const minMax = absolute\n            ? matrixMinMaxAbsoluteZ(matrix)\n            : matrixMinMaxZ(matrix);\n        if (min === undefined) {\n            min =\n                logBaseX && minMax.min\n                    ? Math.log(minMax.min) / Math.log(logBaseX)\n                    : minMax.min;\n        }\n        if (max === undefined) {\n            max =\n                logBaseX && minMax.max\n                    ? Math.log(minMax.max) / Math.log(logBaseX)\n                    : minMax.max;\n        }\n    }\n    const xHistogramOptions = {\n        histogram,\n        nbSlots,\n        centerX,\n        absolute,\n        logBaseX,\n        // Skip logBaseY as it's handled below.\n        min,\n        max,\n    };\n    const finalHistogram = xHistogram(matrix[0], xHistogramOptions);\n    xHistogramOptions.histogram = finalHistogram;\n    const nbRows = matrix.length;\n    for (let row = 1; row < nbRows; row++) {\n        xHistogram(matrix[row], xHistogramOptions);\n    }\n    const y = finalHistogram.y;\n    if (logBaseY) {\n        const logOfBase = Math.log10(logBaseY);\n        for (let i = 0; i < y.length; i++) {\n            y[i] = Math.log10(y[i] + 1) / logOfBase;\n        }\n    }\n    return finalHistogram;\n}\n//# sourceMappingURL=matrixHistogram.js.map","import { xMedian } from \"../x/index.js\";\nimport { matrixToArray } from \"./matrixToArray.js\";\n/**\n * Returns the median of the matrix.\n * @param matrix\n */\nexport function matrixMedian(matrix) {\n    return xMedian(matrixToArray(matrix));\n}\n//# sourceMappingURL=matrixMedian.js.map","import { xNoiseStandardDeviation } from \"../x/index.js\";\nimport { matrixToArray } from \"./matrixToArray.js\";\n/**\n * Determine noise level using MAD https://en.wikipedia.org/wiki/Median_absolute_deviation\n * Constant to convert mad to sd calculated using https://www.wolframalpha.com/input?i=sqrt%282%29+inverse+erf%280.5%29\n * This assumes a gaussian distribution of the noise.\n * @param matrix\n * @returns Noise level corresponding to one standard deviation.\n */\nexport function matrixNoiseStandardDeviation(matrix) {\n    return xNoiseStandardDeviation(matrixToArray(matrix));\n}\n//# sourceMappingURL=matrixNoiseStandardDeviation.js.map","import { matrixClone } from \"./matrixClone.js\";\n/**\n * Numerically decodes the matrix using the dictionary.\n * @param matrixInitial\n * @param dictionary - dictionary against which to do the encoding\n * @returns - decoded matrix\n */\nexport function matrixNumericalDecoding(matrixInitial, dictionary) {\n    const matrix = matrixClone(matrixInitial);\n    const invertedDictionary = swap(dictionary);\n    for (const row of matrix) {\n        for (let j = 0; j < matrix[0].length; j++) {\n            const value = row[j];\n            if (typeof value === 'number' && value in invertedDictionary) {\n                row[j] = invertedDictionary[value];\n            }\n        }\n    }\n    return matrix;\n}\nfunction swap(dictionary) {\n    const ret = {};\n    for (const key in dictionary) {\n        ret[dictionary[key]] = key;\n    }\n    return ret;\n}\n//# sourceMappingURL=matrixNumericalDecoding.js.map","import { matrixClone } from \"./matrixClone.js\";\n/**\n * Numerically encodes the strings in the matrix and returns an encoding dictionary which can be used to encode other matrices\n * @param matrixInitial - original matrix before encoding\n * @returns - dictionary from string to number\n */\nexport function matrixNumericalEncoding(matrixInitial) {\n    const matrix = matrixClone(matrixInitial);\n    const nRows = matrix.length;\n    const nColumns = matrix[0].length;\n    let k = 0;\n    for (let i = 0; i < nRows; i++) {\n        for (let j = 0; j < nColumns; j++) {\n            const value = matrix[i][j];\n            if (typeof value === 'number' && value > k) {\n                k = value;\n            }\n        }\n    }\n    const dictCategoricalToNumerical = {};\n    for (let i = 0; i < nRows; i++) {\n        for (let j = 0; j < nColumns; j++) {\n            const value = matrix[i][j];\n            if (typeof value === 'string') {\n                if (value in dictCategoricalToNumerical) {\n                    matrix[i][j] = dictCategoricalToNumerical[value];\n                }\n                else {\n                    k++;\n                    dictCategoricalToNumerical[value] = k;\n                    matrix[i][j] = k;\n                }\n            }\n        }\n    }\n    return { matrix: matrix, dictCategoricalToNumerical };\n}\n//# sourceMappingURL=matrixNumericalEncoding.js.map","import { Matrix } from 'ml-matrix';\nimport { xMedian } from \"../x/index.js\";\n/**\n * Performs a Probabilistic quotient normalization (PQN) over the dataset to account dilution based in median spectrum.\n * Dieterle, F., Ross, A., Schlotterbeck, G., & Senn, H. (2006). Probabilistic quotient normalization as robust method to account for dilution of complex biological mixtures. Application in 1H NMR metabonomics. Analytical chemistry, 78(13), 4281-4290.\n * DOI: 10.1021/ac051632c\n * @param matrix - matrix [rows][cols].\n * @param options - options\n * @returns - {data: Normalized dataset, medianOfQuotients: The median of quotients of each variables}\n */\nexport function matrixPQN(matrix, options = {}) {\n    const { max = 100 } = options;\n    const matrixB = new Matrix(matrix);\n    for (let i = 0; i < matrixB.rows; i++) {\n        const normalizationFactor = matrixB.getRowVector(i).norm('frobenius') / max;\n        const row = matrixB.getRowVector(i).div(normalizationFactor);\n        matrixB.setRow(i, row);\n    }\n    const referenceSpectrum = [];\n    for (let i = 0; i < matrixB.columns; i++) {\n        const currentVariable = matrixB.getColumn(i);\n        referenceSpectrum.push(xMedian(currentVariable));\n    }\n    const medianOfQuotients = [];\n    for (let i = 0; i < matrixB.columns; i++) {\n        const quotients = matrixB.getColumnVector(i).div(referenceSpectrum[i]);\n        medianOfQuotients.push(xMedian(quotients.getColumn(0)));\n    }\n    for (let i = 0; i < matrixB.rows; i++) {\n        matrixB.mulRow(i, 1 / medianOfQuotients[i]);\n    }\n    return {\n        data: matrixB.to2DArray(),\n        medianOfQuotients,\n    };\n}\n//# sourceMappingURL=matrixPQN.js.map","import { matrixCheckRanges } from \"./matrixCheckRanges.js\";\n/**\n * Set in-place a subMatrix to matrix, the function check if the subMatrix\n * lies into the dimensions of matrix.\n * @param matrix - matrix that will receive the new element values.\n * @param subMatrix - matrix with equal or less size than matrix.\n * @param startRow - row index in matrix for the first row in subMatrix.\n * @param startColumn - column index in matrix for the first column in subMatrix.\n * @returns The modified `matrix`.\n */\nexport function matrixSetSubMatrix(matrix, subMatrix, startRow, startColumn) {\n    const endRow = startRow + subMatrix.length - 1;\n    const endColumn = startColumn + subMatrix[0].length - 1;\n    matrixCheckRanges(matrix, { startRow, endRow, startColumn, endColumn });\n    for (let i = 0; i < subMatrix.length; i++) {\n        for (let j = 0; j < subMatrix[0].length; j++) {\n            matrix[startRow + i][startColumn + j] = subMatrix[i][j];\n        }\n    }\n    return matrix;\n}\n//# sourceMappingURL=matrixSetSubMatrix.js.map","import { matrixCheck } from \"./matrixCheck.js\";\nimport { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\nexport function matrixTranspose(matrix, options = {}) {\n    matrixCheck(matrix);\n    const { ArrayConstructor } = options;\n    const nbRows = matrix.length;\n    const nbColumns = matrix[0].length;\n    // Create new matrix with swapped dimensions\n    const result = matrixCreateEmpty({\n        nbColumns: nbRows,\n        nbRows: nbColumns,\n        ArrayConstructor,\n    });\n    for (let i = 0; i < nbRows; i++) {\n        for (let j = 0; j < nbColumns; j++) {\n            result[j][i] = matrix[i][j];\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=matrixTranspose.js.map","import { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\nimport { matrixMaxAbsoluteZ } from \"./matrixMaxAbsoluteZ.js\";\n/**\n * Rescale a matrix around 0 taking into account the absolute max value.\n * @param matrix - matrix [rows][cols].\n * @param options - Options.\n */\nexport function matrixZPivotRescale(matrix, options = {}) {\n    const { max = 1, ArrayConstructor } = options;\n    const nbColumns = matrix[0].length;\n    const nbRows = matrix.length;\n    const newMatrix = matrixCreateEmpty({ nbColumns, nbRows, ArrayConstructor });\n    const currentMax = matrixMaxAbsoluteZ(matrix);\n    for (let column = 0; column < nbColumns; column++) {\n        const factor = max / currentMax;\n        for (let row = 0; row < nbRows; row++) {\n            newMatrix[row][column] = matrix[row][column] * factor;\n        }\n    }\n    return newMatrix;\n}\n//# sourceMappingURL=matrixZPivotRescale.js.map","import { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\nimport { matrixMinMaxZ } from \"./matrixMinMaxZ.js\";\n/**\n * Rescale a matrix between min and max values.\n * @param matrix - matrix [rows][cols].\n * @param options - Options.\n */\nexport function matrixZRescale(matrix, options = {}) {\n    const { min = 0, max = 1, ArrayConstructor } = options;\n    const nbColumns = matrix[0].length;\n    const nbRows = matrix.length;\n    const newMatrix = matrixCreateEmpty({ nbColumns, nbRows, ArrayConstructor });\n    const { min: currentMin, max: currentMax } = matrixMinMaxZ(matrix);\n    const factor = (max - min) / (currentMax - currentMin);\n    for (let column = 0; column < nbColumns; column++) {\n        for (let row = 0; row < nbRows; row++) {\n            newMatrix[row][column] =\n                (matrix[row][column] - currentMin) * factor + min;\n        }\n    }\n    return newMatrix;\n}\n//# sourceMappingURL=matrixZRescale.js.map","import { matrixCreateEmpty } from \"./matrixCreateEmpty.js\";\n/**\n * Rescale the matrix per column for which we get the min and max values.\n * @param matrix - matrix [rows][cols].\n * @param options - Options.\n */\nexport function matrixZRescalePerColumn(matrix, options = {}) {\n    const { min = 0, max = 1 } = options;\n    const nbColumns = matrix[0].length;\n    const nbRows = matrix.length;\n    const newMatrix = matrixCreateEmpty({ nbColumns, nbRows });\n    for (let column = 0; column < nbColumns; column++) {\n        let currentMin = matrix[0][column];\n        let currentMax = matrix[0][column];\n        for (let row = 1; row < nbRows; row++) {\n            if (matrix[row][column] < currentMin)\n                currentMin = matrix[row][column];\n            if (matrix[row][column] > currentMax)\n                currentMax = matrix[row][column];\n        }\n        const factor = (max - min) / (currentMax - currentMin);\n        for (let row = 0; row < nbRows; row++) {\n            newMatrix[row][column] =\n                (matrix[row][column] - currentMin) * factor + min;\n        }\n    }\n    return newMatrix;\n}\n//# sourceMappingURL=matrixZRescalePerColumn.js.map","import FFT from 'fft.js';\nimport { zeroShift } from \"../reim/zeroShift.js\";\n/**\n * Apply FFT to an array of complex spectra, reusing a single FFT instance for\n * all elements to avoid repeated instantiation overhead.\n * All elements must have the same length.\n * @param data - array of complex spectra\n * @param options - options\n * @returns array of transformed complex spectra\n */\nexport function reimArrayFFT(data, options = {}) {\n    if (data.length === 0)\n        return [];\n    const { inverse = false, applyZeroShift = false, inPlace = false } = options;\n    const size = data[0].re.length;\n    const csize = size << 1;\n    for (let j = 1; j < data.length; j++) {\n        if (data[j].re.length !== size || data[j].im.length !== size) {\n            throw new RangeError(`All elements must have the same length. Expected ${size} but element ${j} has length ${data[j].re.length}.`);\n        }\n    }\n    // Single FFT instance and working buffers reused across all spectra\n    const fft = new FFT(size);\n    const complexArray = new Float64Array(csize);\n    const output = new Float64Array(csize);\n    const results = new Array(data.length);\n    for (let j = 0; j < data.length; j++) {\n        const { re, im } = data[j];\n        for (let i = 0; i < csize; i += 2) {\n            complexArray[i] = re[i >>> 1];\n            complexArray[i + 1] = im[i >>> 1];\n        }\n        const outRe = inPlace ? re : new Float64Array(size);\n        const outIm = inPlace ? im : new Float64Array(size);\n        if (inverse) {\n            const input = applyZeroShift\n                ? zeroShift(complexArray, true)\n                : complexArray;\n            fft.inverseTransform(output, input);\n            for (let i = 0; i < csize; i += 2) {\n                outRe[i >>> 1] = output[i];\n                outIm[i >>> 1] = output[i + 1];\n            }\n        }\n        else {\n            fft.transform(output, complexArray);\n            const source = applyZeroShift ? zeroShift(output) : output;\n            for (let i = 0; i < csize; i += 2) {\n                outRe[i >>> 1] = source[i];\n                outIm[i >>> 1] = source[i + 1];\n            }\n        }\n        results[j] = { re: outRe, im: outIm };\n    }\n    return results;\n}\n//# sourceMappingURL=reimArrayFFT.js.map","import FFT from 'fft.js';\nimport { zeroShift } from \"./zeroShift.js\";\n/**\n * ReimFFT.\n * @param data - complex spectrum\n * @param options - options.\n * @returns FFT of complex spectrum.\n */\nexport function reimFFT(data, options = {}) {\n    const { inverse = false, applyZeroShift = false, inPlace = false } = options;\n    const { re, im } = data;\n    const size = re.length;\n    const csize = size << 1;\n    let complexArray = new Float64Array(csize);\n    for (let i = 0; i < csize; i += 2) {\n        complexArray[i] = re[i >>> 1];\n        complexArray[i + 1] = im[i >>> 1];\n    }\n    const fft = new FFT(size);\n    let output = new Float64Array(csize);\n    if (inverse) {\n        if (applyZeroShift)\n            complexArray = zeroShift(complexArray, true);\n        fft.inverseTransform(output, complexArray);\n    }\n    else {\n        fft.transform(output, complexArray);\n        if (applyZeroShift)\n            output = zeroShift(output);\n    }\n    if (inPlace) {\n        for (let i = 0; i < csize; i += 2) {\n            re[i >>> 1] = output[i];\n            im[i >>> 1] = output[i + 1];\n        }\n        return data;\n    }\n    const newRe = new Float64Array(size);\n    const newIm = new Float64Array(size);\n    for (let i = 0; i < csize; i += 2) {\n        newRe[i >>> 1] = output[i];\n        newIm[i >>> 1] = output[i + 1];\n    }\n    return { re: newRe, im: newIm };\n}\n//# sourceMappingURL=reimFFT.js.map","import FFT from 'fft.js';\nimport { zeroShift } from \"../reim/zeroShift.js\";\n/**\n * Apply FFT to each row of a complex matrix, reusing a single FFT instance for\n * all rows to avoid repeated instantiation overhead.\n * All rows must have the same length.\n * @param data - complex matrix with re and im arrays of Float64Array rows\n * @param options - options\n * @returns complex matrix with transformed rows\n */\nexport function reimMatrixFFT(data, options = {}) {\n    const { re, im } = data;\n    const numRows = re.length;\n    if (numRows === 0)\n        return { re: [], im: [] };\n    const { inverse = false, applyZeroShift = false, inPlace = false } = options;\n    const size = re[0].length;\n    const csize = size << 1;\n    for (let j = 0; j < numRows; j++) {\n        if (re[j].length !== size || im[j].length !== size) {\n            throw new RangeError(`All rows must have the same length. Expected ${size} but row ${j} has length ${re[j].length}.`);\n        }\n    }\n    // Single FFT instance and working buffers reused across all rows\n    const fft = new FFT(size);\n    const complexArray = new Float64Array(csize);\n    const output = new Float64Array(csize);\n    const resultRe = new Array(numRows);\n    const resultIm = new Array(numRows);\n    for (let j = 0; j < numRows; j++) {\n        const reRow = re[j];\n        const imRow = im[j];\n        for (let i = 0; i < csize; i += 2) {\n            complexArray[i] = reRow[i >>> 1];\n            complexArray[i + 1] = imRow[i >>> 1];\n        }\n        const outRe = inPlace ? reRow : new Float64Array(size);\n        const outIm = inPlace ? imRow : new Float64Array(size);\n        if (inverse) {\n            const input = applyZeroShift\n                ? zeroShift(complexArray, true)\n                : complexArray;\n            fft.inverseTransform(output, input);\n            for (let i = 0; i < csize; i += 2) {\n                outRe[i >>> 1] = output[i];\n                outIm[i >>> 1] = output[i + 1];\n            }\n        }\n        else {\n            fft.transform(output, complexArray);\n            const source = applyZeroShift ? zeroShift(output) : output;\n            for (let i = 0; i < csize; i += 2) {\n                outRe[i >>> 1] = source[i];\n                outIm[i >>> 1] = source[i + 1];\n            }\n        }\n        resultRe[j] = outRe;\n        resultIm[j] = outIm;\n    }\n    return { re: resultRe, im: resultIm };\n}\n//# sourceMappingURL=reimMatrixFFT.js.map","import FFT from 'fft.js';\nimport { zeroShift } from \"../reim/zeroShift.js\";\n/**\n * Apply FFT to each column of a complex matrix, reusing a single FFT instance for\n * all columns to avoid repeated instantiation overhead.\n * All columns must have the same length (all rows must have the same number of columns).\n * @param data - complex matrix with re and im arrays of Float64Array rows\n * @param options - options\n * @returns complex matrix with transformed columns\n */\nexport function reimMatrixFFTByColumns(data, options = {}) {\n    const { re, im } = data;\n    const numRows = re.length;\n    if (numRows === 0)\n        return { re: [], im: [] };\n    const { inverse = false, applyZeroShift = false, inPlace = false } = options;\n    const numColumns = re[0].length;\n    const csize = numRows << 1;\n    // Validate all rows have the same number of columns\n    for (let j = 0; j < numRows; j++) {\n        if (re[j].length !== numColumns || im[j].length !== numColumns) {\n            throw new RangeError(`All rows must have the same length. Expected ${numColumns} but row ${j} has length ${re[j].length}.`);\n        }\n    }\n    if (numColumns === 0) {\n        return { re: new Array(numRows), im: new Array(numRows) };\n    }\n    // Single FFT instance and working buffers reused across all columns\n    const fft = new FFT(numRows);\n    const complexArray = new Float64Array(csize);\n    const output = new Float64Array(csize);\n    const resultRe = new Array(numRows);\n    const resultIm = new Array(numRows);\n    // Initialize result arrays\n    for (let i = 0; i < numRows; i++) {\n        resultRe[i] = inPlace ? re[i] : new Float64Array(numColumns);\n        resultIm[i] = inPlace ? im[i] : new Float64Array(numColumns);\n    }\n    // Process each column\n    for (let col = 0; col < numColumns; col++) {\n        // Extract column data into complex array\n        for (let row = 0; row < numRows; row++) {\n            complexArray[row << 1] = re[row][col];\n            complexArray[(row << 1) + 1] = im[row][col];\n        }\n        const colRe = new Float64Array(numRows);\n        const colIm = new Float64Array(numRows);\n        if (inverse) {\n            const input = applyZeroShift\n                ? zeroShift(complexArray, true)\n                : complexArray;\n            fft.inverseTransform(output, input);\n            for (let i = 0; i < csize; i += 2) {\n                colRe[i >>> 1] = output[i];\n                colIm[i >>> 1] = output[i + 1];\n            }\n        }\n        else {\n            fft.transform(output, complexArray);\n            const source = applyZeroShift ? zeroShift(output) : output;\n            for (let i = 0; i < csize; i += 2) {\n                colRe[i >>> 1] = source[i];\n                colIm[i >>> 1] = source[i + 1];\n            }\n        }\n        // Store transformed column back into result matrix\n        for (let row = 0; row < numRows; row++) {\n            resultRe[row][col] = colRe[row];\n            resultIm[row][col] = colIm[row];\n        }\n    }\n    return { re: resultRe, im: resultIm };\n}\n//# sourceMappingURL=reimMatrixFFTByColumns.js.map","/**\n * Apply phase correction to a complex matrix along rows or columns.\n * All rows must have the same length.\n * @param data - complex matrix with re and im arrays of Float64Array rows\n * @param phi0 - Angle in radians for zero order phase correction\n * @param phi1 - Angle in radians for first order phase correction\n * @param options - options including direction ('rows' or 'columns', default 'rows')\n * @returns - complex matrix with corrected rows or columns\n */\nexport function reimMatrixPhaseCorrection(data, phi0 = 0, phi1 = 0, options = {}) {\n    const { reverse = false, inPlace = false, direction = 'rows' } = options;\n    phi0 = Number.isFinite(phi0) ? phi0 : 0;\n    phi1 = Number.isFinite(phi1) ? phi1 : 0;\n    const { re, im } = data;\n    const numRows = re.length;\n    if (numRows === 0)\n        return { re: [], im: [] };\n    const numColumns = re[0].length;\n    for (let j = 0; j < numRows; j++) {\n        if (re[j].length !== numColumns || im[j].length !== numColumns) {\n            throw new RangeError(`All rows must have the same length. Expected ${numColumns} but row ${j} has length ${re[j].length}.`);\n        }\n    }\n    const resultRe = new Array(numRows);\n    const resultIm = new Array(numRows);\n    // Initialize result arrays\n    for (let i = 0; i < numRows; i++) {\n        resultRe[i] = inPlace ? re[i] : new Float64Array(numColumns);\n        resultIm[i] = inPlace ? im[i] : new Float64Array(numColumns);\n    }\n    const size = direction === 'rows' ? numColumns : numRows;\n    let delta = phi1 / (size - 1);\n    if (reverse) {\n        delta = -delta;\n    }\n    const alpha = 2 * Math.sin(delta / 2) ** 2;\n    const beta = Math.sin(delta);\n    if (direction === 'rows') {\n        for (let j = 0; j < numRows; j++) {\n            let firstAngle = phi0;\n            if (reverse) {\n                firstAngle += phi1;\n            }\n            let cosTheta = Math.cos(firstAngle);\n            let sinTheta = Math.sin(firstAngle);\n            for (let i = 0; i < numColumns; i++) {\n                const r = re[j][i];\n                const ii = im[j][i];\n                resultRe[j][i] = r * cosTheta - ii * sinTheta;\n                resultIm[j][i] = ii * cosTheta + r * sinTheta;\n                const newCosTheta = cosTheta - (alpha * cosTheta + beta * sinTheta);\n                const newSinTheta = sinTheta - (alpha * sinTheta - beta * cosTheta);\n                cosTheta = newCosTheta;\n                sinTheta = newSinTheta;\n            }\n        }\n    }\n    else {\n        for (let col = 0; col < numColumns; col++) {\n            let firstAngle = phi0;\n            if (reverse) {\n                firstAngle += phi1;\n            }\n            let cosTheta = Math.cos(firstAngle);\n            let sinTheta = Math.sin(firstAngle);\n            for (let row = 0; row < numRows; row++) {\n                const r = re[row][col];\n                const ii = im[row][col];\n                resultRe[row][col] = r * cosTheta - ii * sinTheta;\n                resultIm[row][col] = ii * cosTheta + r * sinTheta;\n                const newCosTheta = cosTheta - (alpha * cosTheta + beta * sinTheta);\n                const newSinTheta = sinTheta - (alpha * sinTheta - beta * cosTheta);\n                cosTheta = newCosTheta;\n                sinTheta = newSinTheta;\n            }\n        }\n    }\n    return { re: resultRe, im: resultIm };\n}\n//# sourceMappingURL=reimMatrixPhaseCorrection.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Stringify an object and convert all typed arrays to arrays\n * @param object\n * @param replacer\n * @param space\n * @returns\n */\nexport function stringify(object, replacer, space) {\n    const internalReplacer = (key, value) => {\n        if (ArrayBuffer.isView(value)) {\n            value = Array.from(value);\n        }\n        if (replacer) {\n            return replacer(key, value);\n        }\n        return value;\n    };\n    return JSON.stringify(object, internalReplacer, space);\n}\n//# sourceMappingURL=stringify.js.map","import { xAbsolute } from \"./xAbsolute.js\";\nimport { xMedian } from \"./xMedian.js\";\n/**\n * This function calculates the median after taking the xAbsolute values of the points.\n * @param array - the array for which we want to calculate the absolute value\n * @returns - median\n */\nexport function xAbsoluteMedian(array) {\n    return xMedian(xAbsolute(array));\n}\n//# sourceMappingURL=xAbsoluteMedian.js.map","/**\n * Will apply a function on each element of the array described as a string\n * By default we will use as variable 'x'\n * In front of sequence of lowercase we will add 'Math.'. This allows to write\n * `sin(x) + cos(x)` and it will be replace internally by (x) => (Math.sin(x) + Math.cos(x))\n * @param array\n * @param options\n * @returns\n */\nexport function xApplyFunctionStr(array, options = {}) {\n    const { variableLabel = 'x', fctString = variableLabel } = options;\n    const fct = new Function(variableLabel, `return Number(${fctString\n        .replaceAll(/(?<before>^|\\W)(?<after>[\\da-z]{2,}\\()/g, '$<before>Math.$<after>')\n        .replaceAll('Math.Math', 'Math')})`);\n    const toReturn = Float64Array.from(array);\n    for (let i = 0; i < array.length; i++) {\n        toReturn[i] = fct(array[i]);\n        if (Number.isNaN(toReturn[i])) {\n            throw new Error(`The callback ${fctString} does not return a number: ${array[i]}`);\n        }\n    }\n    return toReturn;\n}\n//# sourceMappingURL=xApplyFunctionStr.js.map","import { xCrossCorrelation } from \"./xCrossCorrelation.js\";\n/**\n * Calculates the auto-correlation of an array\n * @param A - the array for which to calculate the auto-correlation\n * @param options - Options\n */\nexport function xAutoCorrelation(A, options = {}) {\n    return xCrossCorrelation(A, A, options);\n}\n//# sourceMappingURL=xAutoCorrelation.js.map","import { xBoxPlotWithOutliers } from \"./xBoxPlotWithOutliers.js\";\nimport { xMean } from \"./xMean.js\";\nimport { xStandardDeviation } from \"./xStandardDeviation.js\";\n/**\n * Calculate distribution statistics of an array without providing options\n * This ensure that the statistics are calculated in the same way in all the packages\n * If the array is empty it will throw an error\n * If the array has a length of 1, sd will be NaN (unbiased calculation of sd)\n * @param array - data\n * @param options\n * @returns - q1, median, q3, min, max\n */\nexport function xDistributionStats(array) {\n    return {\n        ...xBoxPlotWithOutliers(array),\n        mean: xMean(array),\n        sd: xStandardDeviation(array),\n        nb: array.length,\n    };\n}\n//# sourceMappingURL=xDistributionStats.js.map","import { isAnyArray } from 'is-any-array';\nimport { getOutputArray } from \"./getOutputArray.js\";\n/**\n * This function divide the first array by the second array or a constant value to each element of the first array\n * @param array1 - first array\n * @param array2 - second array or number\n * @param options - options\n */\nexport function xDivide(array1, array2, options = {}) {\n    let isConstant = false;\n    let constant = 0;\n    if (isAnyArray(array2)) {\n        if (array1.length !== array2.length) {\n            throw new RangeError('size of array1 and array2 must be identical');\n        }\n    }\n    else {\n        isConstant = true;\n        constant = array2;\n    }\n    const array3 = getOutputArray(options.output, array1.length);\n    if (isConstant) {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] / constant;\n        }\n    }\n    else {\n        for (let i = 0; i < array1.length; i++) {\n            array3[i] = array1[i] / array2[i];\n        }\n    }\n    return array3;\n}\n//# sourceMappingURL=xDivide.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the maximal value of an array of values\n * @param array - array of numbers\n * @param options - options\n */\nexport function xMaxAbsoluteValue(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let maxValue = array[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        if (array[i] >= 0) {\n            if (array[i] > maxValue) {\n                maxValue = array[i];\n            }\n        }\n        else if (-array[i] > maxValue) {\n            maxValue = -array[i];\n        }\n    }\n    return maxValue;\n}\n//# sourceMappingURL=xMaxAbsoluteValue.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the index of the maximum of the given values\n * @param array - array of numbers\n * @param  options - options\n * @returns - index\n */\nexport function xMaxIndex(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let maxIndex = fromIndex;\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        if (array[i] > array[maxIndex]) {\n            maxIndex = i;\n        }\n    }\n    return maxIndex;\n}\n//# sourceMappingURL=xMaxIndex.js.map","import { xCheckLengths } from \"./xCheckLengths.js\";\n/**\n * This function calculates the mean absolute error.\n * @param array1 - first array\n * @param array2 - second array\n */\nexport function xMeanAbsoluteError(array1, array2) {\n    xCheckLengths(array1, array2);\n    let sum = 0;\n    for (let i = 0; i < array1.length; i++) {\n        sum += Math.abs(array1[i] - array2[i]);\n    }\n    return sum / array1.length;\n}\n//# sourceMappingURL=xMeanAbsoluteError.js.map","import { xCheckLengths } from \"./xCheckLengths.js\";\n/**\n * This function calculates the mean squared error.\n * @param array1 -first array\n * @param array2 - second array\n */\nexport function xMeanSquaredError(array1, array2) {\n    xCheckLengths(array1, array2);\n    let sum = 0;\n    for (let i = 0; i < array1.length; i++) {\n        sum += (array1[i] - array2[i]) ** 2;\n    }\n    return sum / array1.length;\n}\n//# sourceMappingURL=xMeanSquaredError.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the weighted mean value of an array of values.\n * @deprecated please use xyMassCenter\n * @param array - array of numbers\n * @param weights - array of weights\n * @param options - options\n */\nexport function xMeanWeighted(array, weights, options = {}) {\n    xCheck(array, { minLength: 1 });\n    xCheck(weights);\n    if (array.length !== weights.length) {\n        throw new Error('array and weights must have the same length');\n    }\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    // normalize weights\n    let sumWeights = 0;\n    let sumValue = array[fromIndex] * weights[fromIndex];\n    sumWeights += weights[fromIndex];\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        sumValue += array[i] * weights[i];\n        sumWeights += weights[i];\n    }\n    if (sumWeights === 0) {\n        // We throw because the case is not well defined\n        throw new Error('sum of weights must be > 0');\n    }\n    return sumValue / sumWeights;\n}\n//# sourceMappingURL=xMeanWeighted.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xGetFromToIndex } from \"./xGetFromToIndex.js\";\n/**\n * Computes the index of the minimum of the given values.\n * @param array - array of numbers\n * @param options - options\n * @returns - index\n */\nexport function xMinIndex(array, options = {}) {\n    xCheck(array);\n    const { fromIndex, toIndex } = xGetFromToIndex(array, options);\n    let minIndex = fromIndex;\n    for (let i = fromIndex + 1; i <= toIndex; i++) {\n        if (array[i] < array[minIndex]) {\n            minIndex = i;\n        }\n    }\n    return minIndex;\n}\n//# sourceMappingURL=xMinIndex.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Return min and max values of an array.\n * @param array - array of number\n * @returns - Object with 2 properties, min and max\n */\nexport function xMinMaxDelta(array) {\n    xCheck(array, {\n        minLength: 2,\n    });\n    let minDelta = array[1] - array[0];\n    let maxDelta = minDelta;\n    for (let i = 0; i < array.length - 1; i++) {\n        const delta = array[i + 1] - array[i];\n        if (delta < minDelta)\n            minDelta = delta;\n        if (delta > maxDelta)\n            maxDelta = delta;\n    }\n    return { min: minDelta, max: maxDelta };\n}\n//# sourceMappingURL=xMinMaxDelta.js.map","/**\n * Calculates the mode of an array\n * @param input - Array containing values\n * @returns - mode\n */\nexport function xMode(input) {\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    let maxValue = 0;\n    let maxCount = 0;\n    let count = 0;\n    const counts = {};\n    for (const element of input) {\n        count = counts[element];\n        if (count) {\n            counts[element]++;\n            count++;\n        }\n        else {\n            counts[element] = 1;\n            count = 1;\n        }\n        if (count > maxCount) {\n            maxCount = count;\n            maxValue = element;\n        }\n    }\n    return maxValue;\n}\n//# sourceMappingURL=xMode.js.map","/**\n * This function calculate the norm of a vector.\n * @example xNorm([3, 4]) -> 5\n * @param array - array\n * @returns - calculated norm\n */\nexport function xNorm(array) {\n    let result = 0;\n    for (const element of array) {\n        result += element ** 2;\n    }\n    return Math.sqrt(result);\n}\n//# sourceMappingURL=xNorm.js.map","import { xCheck } from \"./xCheck.js\";\nimport { xStandardDeviation } from \"./xStandardDeviation.js\";\n/**\n * Pareto scaling, which uses the square root of standard deviation as the scaling factor, circumvents the amplification of noise by retaining a small portion of magnitude information.\n * Noda, I. (2008). Scaling techniques to enhance two-dimensional correlation spectra. Journal of Molecular Structure, 883, 216-227.\n * DOI: 10.1016/j.molstruc.2007.12.026\n * @param array - array of number\n */\nexport function xParetoNormalization(array) {\n    xCheck(array);\n    const result = new Float64Array(array.length);\n    const sqrtSD = Math.sqrt(xStandardDeviation(array));\n    for (let i = 0; i < array.length; i++) {\n        result[i] = array[i] / sqrtSD;\n    }\n    return result;\n}\n//# sourceMappingURL=xParetoNormalization.js.map","import { isAnyArray } from 'is-any-array';\nimport { xBoxPlot } from \"./xBoxPlot.js\";\n/**\n * Remove the outliers from the array\n * Based on 1.5 IQR\n * @param array - data\n * @returns - trimmed data\n */\nexport function xRemoveOutliersIQR(array) {\n    if (!isAnyArray(array)) {\n        throw new TypeError('input must be an array');\n    }\n    if (array.length === 0) {\n        return array;\n    }\n    const boxPlot = xBoxPlot(array);\n    const iqr = boxPlot.q3 - boxPlot.q1;\n    const lowerWhisker = boxPlot.q1 - 1.5 * iqr;\n    const higherWhisker = boxPlot.q3 + 1.5 * iqr;\n    if (boxPlot.min >= lowerWhisker && boxPlot.max <= higherWhisker) {\n        return array;\n    }\n    const filteredArray = [];\n    for (const element of array) {\n        if (element >= lowerWhisker && element <= higherWhisker) {\n            filteredArray.push(element);\n        }\n    }\n    return filteredArray;\n}\n//# sourceMappingURL=xRemoveOutliersIQR.js.map","import { getOutputArray } from \"./getOutputArray.js\";\nimport { xCheck } from \"./xCheck.js\";\nimport { xMaxValue } from \"./xMaxValue.js\";\nimport { xMinValue } from \"./xMinValue.js\";\n/**\n * Function used to rescale data\n * @param input - input for the rescale\n * @param options - options\n * @returns rescaled data\n */\nexport function xRescale(input, options = {}) {\n    xCheck(input);\n    const output = getOutputArray(options.output, input.length);\n    const currentMin = xMinValue(input);\n    const currentMax = xMaxValue(input);\n    if (currentMin === currentMax) {\n        throw new RangeError('minimum and maximum input values are equal. Cannot rescale a constant array');\n    }\n    const { min = 0, max = 1 } = options;\n    if (min >= max) {\n        throw new RangeError('min option must be smaller than max option');\n    }\n    const factor = (max - min) / (currentMax - currentMin);\n    for (let i = 0; i < input.length; i++) {\n        output[i] = (input[i] - currentMin) * factor + min;\n    }\n    return output;\n}\n//# sourceMappingURL=xRescale.js.map","import { xBoxPlotWithOutliers } from \"./xBoxPlotWithOutliers.js\";\nimport { xMean } from \"./xMean.js\";\nimport { xStandardDeviation } from \"./xStandardDeviation.js\";\n/**\n * Calculate distribution statistics of an array without providing options. Statistics\n * like sd and mean are calculated after removing outliers.\n * This ensure that the statistics are calculated in the same way in all the packages\n * If the array is empty it will throw an error\n * If the array has a length of 1, sd will be NaN (unbiased calculation of sd)\n * @param array - data\n * @param options\n * @returns - q1, median, q3, min, max\n */\nexport function xRobustDistributionStats(array) {\n    const boxPlot = xBoxPlotWithOutliers(array);\n    let filteredArray;\n    if (boxPlot.max - boxPlot.min <= Number.EPSILON) {\n        return {\n            ...boxPlot,\n            mean: boxPlot.median,\n            sd: array.length === 1 ? Number.NaN : 0,\n            nb: array.length,\n        };\n    }\n    if (boxPlot.outliers.length === 0) {\n        filteredArray = array;\n    }\n    else {\n        filteredArray = new Float64Array(array.length - boxPlot.outliers.length);\n        let j = 0;\n        for (const element of array) {\n            if (element >= boxPlot.min && element <= boxPlot.max) {\n                filteredArray[j++] = element;\n            }\n        }\n    }\n    return {\n        ...boxPlot,\n        mean: xMean(filteredArray),\n        sd: xStandardDeviation(filteredArray),\n        nb: filteredArray.length,\n    };\n}\n//# sourceMappingURL=xRobustDistributionStats.js.map","import { xMaxValue } from \"./xMaxValue.js\";\nimport { xRolling } from \"./xRolling.js\";\n/**\n * This function calculates a maximum within a rolling window\n * @param array - array\n * @param options - options\n */\nexport function xRollingMax(array, options = {}) {\n    return xRolling(array, xMaxValue, options);\n}\n//# sourceMappingURL=xRollingMax.js.map","import { xMedian } from \"./xMedian.js\";\nimport { xRolling } from \"./xRolling.js\";\n/**\n * This function calculates a rolling average\n * @param array - array\n * @param options - options\n */\nexport function xRollingMedian(array, options = {}) {\n    return xRolling(array, xMedian, options);\n}\n//# sourceMappingURL=xRollingMedian.js.map","import { xMinValue } from \"./xMinValue.js\";\nimport { xRolling } from \"./xRolling.js\";\n/**\n * This function calculates a minimum within a rolling window\n * @param array - array\n * @param options - options\n */\nexport function xRollingMin(array, options = {}) {\n    return xRolling(array, xMinValue, options);\n}\n//# sourceMappingURL=xRollingMin.js.map","import { xCheck } from \"./xCheck.js\";\n/**\n * Sample within the array\n * @param array - array from which to sample\n * @param options - options\n * @returns - array with evenly spaced elements\n * @link https://en.wikipedia.org/wiki/Sampling_(signal_processing)\n */\nexport function xSampling(array, options = {}) {\n    const { length = 10 } = options;\n    xCheck(array);\n    if (length === array.length) {\n        return Float64Array.from(array);\n    }\n    else if (length > array.length) {\n        throw new RangeError('length must be smaller than the array length');\n    }\n    else {\n        return downSampling(array, length);\n    }\n}\n/**\n * Downsample within the array\n * @param array - array from which to sample\n * @param length\n * @returns - array with evenly spaced elements\n * @link https://en.wikipedia.org/wiki/Downsampling_(signal_processing)\n */\nfunction downSampling(array, length) {\n    const returnArray = new Float64Array(length);\n    const delta = (array.length - 1) / (length - 1);\n    for (let i = 0; i < length; i++) {\n        returnArray[i] = array[Math.round(i * delta)];\n    }\n    return returnArray;\n}\n//# sourceMappingURL=xSampling.js.map","import { xSequentialFillFromStep } from \"./xSequentialFillFromStep.js\";\nexport function xSequentialFillFromTo(parameters, options = {}) {\n    const { from, to, size } = parameters;\n    const step = (to - from) / (size - 1);\n    return xSequentialFillFromStep({ from, step, size }, options);\n}\n//# sourceMappingURL=xSequentialFillFromTo.js.map","/**\n * Function that sorts arrays or Float64Arrays in ascending order in place !\n * This method is optimized for typed arrays.\n * @param array - array to sort\n * @returns sorted array\n */\nexport function xSortAscending(array) {\n    if (ArrayBuffer.isView(array)) {\n        array.sort();\n        return array;\n    }\n    else if (Array.isArray(array)) {\n        array.sort((a, b) => a - b);\n        return array;\n    }\n    throw new Error('trying to sort non array');\n}\n//# sourceMappingURL=xSortAscending.js.map","/**\n * XUniqueSorted.\n * @param array - array of numbers\n * @returns - sorted array\n */\nexport function xUniqueSorted(array) {\n    const unique = Float64Array.from(new Set(array));\n    unique.sort();\n    return unique;\n}\n//# sourceMappingURL=xUniqueSorted.js.map","/**\n * Sort object of arrays, x has to be monotone.\n * @param data - object of kind {x:[], re:[], im:[]}\n * @returns - sorted array\n */\nexport function xreimSortX(data) {\n    const { x, re, im } = data;\n    if (x.length !== re.length || x.length !== im.length) {\n        throw new TypeError('length of x, re and im must be identical');\n    }\n    if (x.length < 2 || x[0] < x[1])\n        return data;\n    return {\n        x: x.toReversed(),\n        re: re.toReversed(),\n        im: im.toReversed(),\n    };\n}\n//# sourceMappingURL=xreimSortX.js.map","import { reimZeroFilling } from \"../reim/index.js\";\n/**\n * This function makes a zero filling to re and im part.\n * @param data - object of kind {x:[], re:[], im:[]}\n * @param totalLength - final number of points\n * @returns - data.\n */\nexport function xreimZeroFilling(data, totalLength) {\n    const { x, re, im } = data;\n    const length = x.length;\n    if (totalLength === 0 || length === totalLength)\n        return data;\n    if (length > totalLength) {\n        return {\n            x: x.slice(0, totalLength),\n            re: re.slice(0, totalLength),\n            im: im.slice(0, totalLength),\n        };\n    }\n    const newX = new Float64Array(totalLength);\n    newX.set(x);\n    const deltaX = (x.at(-1) - x[0]) / (length - 1);\n    for (let i = length; i < totalLength; i++) {\n        newX[i] = newX[i - 1] + deltaX;\n    }\n    return {\n        x: newX,\n        ...reimZeroFilling({ re, im }, totalLength),\n    };\n}\n//# sourceMappingURL=xreimZeroFilling.js.map","/**\n * Convert an array of XY arrays to a DataXY object containing x,y arrays\n * @param data - array of arrays [[x,y],[x,y],...]\n */\nexport function xy2ToXY(data) {\n    const xy2 = { x: [], y: [] };\n    for (const xyValue of data) {\n        xy2.x.push(xyValue[0]);\n        xy2.y.push(xyValue[1]);\n    }\n    return xy2;\n}\n//# sourceMappingURL=xy2ToXY.js.map","/**\n * Align data of two spectra by verifying wether x values are in a certain range (`delta`).\n * The two spectra should not have two consecutive x values which difference is\n * smaller than `delta` to achieve good results!\n * @param data1 - First spectrum data\n * @param data2 - Second spectrum data\n * @param options - Options\n */\nexport function xyAlign(data1, data2, options = {}) {\n    const { delta = 1, common = true, x = 'x1' } = options;\n    const result = {\n        x: [],\n        y1: [],\n        y2: [],\n    };\n    let i = 0;\n    let j = 0;\n    const length1 = data1.x.length;\n    const length2 = data2.x.length;\n    while (i < length1 && j < length2) {\n        let maxDiff = 0;\n        if (typeof delta === 'function') {\n            const mean = (data1.x[i] + data2.x[j]) / 2; // is this a good thing to do?\n            maxDiff = delta(mean);\n        }\n        else {\n            maxDiff = delta;\n        }\n        const difference = data1.x[i] - data2.x[j];\n        if (Math.abs(difference) > maxDiff) {\n            if (difference > 0) {\n                if (!common) {\n                    result.x.push(data2.x[j]);\n                    result.y1.push(0);\n                    result.y2.push(data2.y[j]);\n                    if (j === length2 - 1) {\n                        while (i < length1) {\n                            result.x.push(data1.x[i]);\n                            result.y1.push(data1.y[i]);\n                            result.y2.push(0);\n                            i++;\n                        }\n                    }\n                }\n                j++;\n            }\n            else {\n                if (!common) {\n                    result.x.push(data1.x[i]);\n                    result.y1.push(data1.y[i]);\n                    result.y2.push(0);\n                    if (i === length1 - 1) {\n                        while (j < length2) {\n                            result.x.push(data2.x[j]);\n                            result.y1.push(0);\n                            result.y2.push(data2.y[j]);\n                            j++;\n                        }\n                    }\n                }\n                i++;\n            }\n        }\n        else {\n            const weightedX = (data1.x[i] * data1.y[i] + data2.x[j] * data2.y[j]) /\n                (data1.y[i] + data2.y[j]);\n            switch (x) {\n                case 'x1':\n                    result.x.push(data1.x[i]);\n                    break;\n                case 'x2':\n                    result.x.push(data2.x[j]);\n                    break;\n                case 'weighted':\n                    result.x.push(weightedX);\n                    break;\n                default:\n                    throw new Error(`unknown x option value: ${String(x)}`);\n            }\n            result.y1.push(data1.y[i]);\n            result.y2.push(data2.y[j]);\n            i++;\n            j++;\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=xyAlign.js.map","import { xyJoinX } from \"../xy/index.js\";\nimport { getSlots } from \"./utils/getSlots.js\";\n/**\n * Aligns data, can be used for spectra\n * @param data - data\n * @param options - Options\n */\nexport function xyArrayAlign(data, options = {}) {\n    const { delta = 1, requiredY = false } = options;\n    data = data.map((spectrum) => xyJoinX(spectrum, { delta }));\n    const slots = getSlots(data, { delta });\n    const x = Float64Array.from(slots.map((slot) => slot.average));\n    const ys = Array.from(data, () => new Float64Array(x.length));\n    const positions = new Uint32Array(data.length);\n    for (let i = 0; i < slots.length; i++) {\n        const slot = slots[i];\n        for (let j = 0; j < data.length; j++) {\n            const spectrum = data[j];\n            while (positions[j] < spectrum.x.length &&\n                spectrum.x[positions[j]] <= slot.to) {\n                ys[j][i] += spectrum.y[positions[j]];\n                positions[j]++;\n            }\n        }\n    }\n    if (requiredY)\n        return filterRequiredY(x, ys);\n    return { x, ys };\n}\nfunction filterRequiredY(x, ys) {\n    const newX = [];\n    const newYs = Array.from(ys, () => []);\n    for (let i = 0; i < x.length; i++) {\n        if (ys.every((y) => y[i] !== 0)) {\n            newX.push(x[i]);\n            for (let j = 0; j < ys.length; j++) {\n                newYs[j].push(ys[j][i]);\n            }\n        }\n    }\n    return { x: newX, ys: newYs };\n}\n//# sourceMappingURL=xyArrayAlign.js.map","import { getSlotsToFirst } from \"./utils/getSlotsToFirst.js\";\n/**\n * We align all the data/spectra to the first array of X.\n * The alignment is based on the X values of the first spectrum and the `delta` error allowed.\n * If some x values are missing in the first spectrum we will add them\n * @param data - data\n * @param options - options\n */\nexport function xyArrayAlignToFirst(data, options = {}) {\n    const { delta = 1 } = options;\n    const slots = getSlotsToFirst(data, { delta });\n    const x = Float64Array.from(slots.map((slot) => slot.value));\n    const ys = Array.from(data, () => new Float64Array(x.length));\n    const positions = new Uint32Array(data.length);\n    for (let i = 0; i < slots.length; i++) {\n        const slot = slots[i];\n        for (let j = 0; j < data.length; j++) {\n            const spectrum = data[j];\n            while (positions[j] < spectrum.x.length &&\n                spectrum.x[positions[j]] < slot.to) {\n                ys[j][i] += spectrum.y[positions[j]];\n                positions[j]++;\n            }\n        }\n    }\n    return { x, ys };\n}\n//# sourceMappingURL=xyArrayAlignToFirst.js.map","import { xyArrayWeightedMerge } from \"../xyArrayWeightedMerge.js\";\n/**\n * GetSlotsToFirst.\n * @param data - data.\n * @param options - Options.\n */\nexport function getSlotsToFirst(data, options = {}) {\n    const { delta = 1 } = options;\n    const deltaIsFunction = typeof delta === 'function';\n    const firstXs = data[0].x;\n    const slots = [];\n    // we first create the slots based on the first spectrum\n    for (const element of firstXs) {\n        const currentDelta = deltaIsFunction ? delta(element) : delta;\n        slots.push({\n            from: element - currentDelta,\n            to: element + currentDelta,\n            value: element,\n        });\n    }\n    const otherXs = xyArrayWeightedMerge(data.slice(1), options).x;\n    let currentPosition = 0;\n    for (const slot of slots) {\n        while (otherXs[currentPosition] < slot.to &&\n            currentPosition < otherXs.length) {\n            if (otherXs[currentPosition] < slot.from) {\n                const currentDelta = deltaIsFunction\n                    ? delta(otherXs[currentPosition])\n                    : delta;\n                slots.push({\n                    from: otherXs[currentPosition] - currentDelta,\n                    to: otherXs[currentPosition] + currentDelta,\n                    value: otherXs[currentPosition],\n                });\n            }\n            currentPosition++;\n        }\n    }\n    for (let i = currentPosition; i < otherXs.length; i++) {\n        const currentDelta = deltaIsFunction ? delta(otherXs[i]) : delta;\n        slots.push({\n            from: otherXs[i] - currentDelta,\n            to: otherXs[i] + currentDelta,\n            value: otherXs[i],\n        });\n    }\n    slots.sort((a, b) => a.value - b.value);\n    // we prevent slots overlap in the first spectrum\n    for (let i = 0; i < slots.length - 1; i++) {\n        if (slots[i].to > slots[i + 1].from) {\n            const middle = (slots[i].value + slots[i + 1].value) / 2;\n            slots[i].to = middle;\n            slots[i + 1].from = middle;\n        }\n    }\n    return slots;\n}\n//# sourceMappingURL=getSlotsToFirst.js.map","import { xyJoinX } from \"../xy/index.js\";\nimport { getSlots } from \"./utils/getSlots.js\";\n/**\n * Merge DataXY\n * We have an array of DataXY and the goal is to merge all the values that are the closest possible\n * @param data - data\n * @param options - Options\n */\nexport function xyArrayMerge(data, options = {}) {\n    const { delta = 1 } = options;\n    // We start by checking that the data/spectra don't have peaks too close and we simplify them.\n    data = data.map((spectrum) => xyJoinX(spectrum, { delta }));\n    // At first, we will calculate the X values (simple mean).\n    const slots = getSlots(data, { delta });\n    const x = Float64Array.from(slots.map((slot) => slot.average));\n    const y = new Float64Array(x.length);\n    const positions = new Uint32Array(data.length);\n    for (let i = 0; i < slots.length; i++) {\n        const slot = slots[i];\n        for (let j = 0; j < data.length; j++) {\n            const spectrum = data[j];\n            while (positions[j] < spectrum.x.length &&\n                spectrum.x[positions[j]] <= slot.to) {\n                y[i] += spectrum.y[positions[j]];\n                positions[j]++;\n            }\n        }\n    }\n    return { x, y };\n}\n//# sourceMappingURL=xyArrayMerge.js.map","import { xMean } from \"../x/index.js\";\n/**\n * Finds the covariance of the points.\n * @param data\n * @param options\n * @returns the covariance\n */\nexport function xyCovariance(data, options = {}) {\n    const { x, y } = data;\n    const { unbiased = true } = options;\n    const meanX = xMean(x);\n    const meanY = xMean(y);\n    let error = 0;\n    for (let i = 0; i < x.length; i++) {\n        error += (x[i] - meanX) * (y[i] - meanY);\n    }\n    if (unbiased) {\n        return error / (x.length - 1);\n    }\n    else {\n        return error / x.length;\n    }\n}\n//# sourceMappingURL=xyCovariance.js.map","import { xEnsureFloat64 } from \"../x/index.js\";\nexport function xyEnsureFloat64(data) {\n    return {\n        x: xEnsureFloat64(data.x),\n        y: xEnsureFloat64(data.y),\n    };\n}\n//# sourceMappingURL=xyEnsureFloat64.js.map","import { xIsMonotonic } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Filters x,y values to allow strictly growing values in x-axis.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array).\n */\nexport function xyEnsureGrowingX(data) {\n    xyCheck(data);\n    if (xIsMonotonic(data.x) === 1)\n        return data;\n    const x = Array.from(data.x);\n    const y = Array.from(data.y);\n    let prevX = Number.NEGATIVE_INFINITY;\n    let currentIndex = 0;\n    for (let index = 0; index < x.length; index++) {\n        if (prevX < x[index]) {\n            if (currentIndex < index) {\n                x[currentIndex] = x[index];\n                y[currentIndex] = y[index];\n            }\n            currentIndex++;\n            prevX = x[index];\n        }\n    }\n    x.length = currentIndex;\n    y.length = currentIndex;\n    return { x, y };\n}\n//# sourceMappingURL=xyEnsureGrowingX.js.map","import { zonesNormalize } from \"../zones/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Extract zones from a XY data.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns - Array of points\n */\nexport function xyExtract(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    let { zones } = options;\n    zones = zonesNormalize(zones);\n    if (x === undefined ||\n        y === undefined ||\n        !Array.isArray(zones) ||\n        zones.length === 0) {\n        return data;\n    }\n    const newX = [];\n    const newY = [];\n    let currentZone = zones[0];\n    let position = 0;\n    loop: for (let i = 0; i < x.length; i++) {\n        while (currentZone.to < x[i]) {\n            position++;\n            currentZone = zones[position];\n            if (!currentZone) {\n                i = x.length;\n                break loop;\n            }\n        }\n        if (x[i] >= currentZone.from) {\n            newX.push(x[i]);\n            newY.push(y[i]);\n        }\n    }\n    return { x: newX, y: newY };\n}\n//# sourceMappingURL=xyExtract.js.map","/**\n * Filter an array x/y based on various criteria x points are expected to be sorted\n * @param data - object containing 2 properties x and y\n * @param options - options\n * @returns filtered array\n */\nexport function xyFilter(data, options = {}) {\n    const { x, y } = data;\n    const { filter } = options;\n    const newX = [];\n    const newY = [];\n    for (let i = 0; i < x.length; i++) {\n        if (!filter || filter(x[i], y[i])) {\n            newX.push(x[i]);\n            newY.push(y[i]);\n        }\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\n//# sourceMappingURL=xyFilter.js.map","import { xMinMaxValues } from \"../x/index.js\";\n/**\n * Filter an array x/y based on various criteria x points are expected to be sorted\n * @param data - object containing 2 properties x and y\n * @param minRelativeYValue - the minimum relative value compare to the Y max value\n * @returns filtered data\n */\nexport function xyFilterMinYValue(data, minRelativeYValue) {\n    if (minRelativeYValue === undefined)\n        return data;\n    const { x, y } = data;\n    const { min, max } = xMinMaxValues(y);\n    const threshold = max * minRelativeYValue;\n    if (min >= threshold)\n        return data;\n    const newX = [];\n    const newY = [];\n    for (let i = 0; i < x.length; i++) {\n        if (y[i] >= threshold) {\n            newX.push(x[i]);\n            newY.push(y[i]);\n        }\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\n//# sourceMappingURL=xyFilterMinYValue.js.map","import { xSortDescending } from \"../x/index.js\";\n/**\n * Filter an array x/y based on various criteria x points are expected to be sorted\n * @param data - object containing 2 properties x and y\n * @param nbPeaks\n * @returns filtered data\n */\nexport function xyFilterTopYValues(data, nbPeaks) {\n    if (nbPeaks === undefined)\n        return data;\n    if (nbPeaks > data.x.length)\n        return data;\n    const { x, y } = data;\n    const newX = [];\n    const newY = [];\n    const descending = xSortDescending(y.slice());\n    const threshold = descending[nbPeaks - 1];\n    let nbThreshold = 0;\n    for (let i = 0; i < nbPeaks; i++) {\n        if (descending[i] === threshold) {\n            nbThreshold++;\n        }\n    }\n    for (let i = 0; i < x.length; i++) {\n        if (y[i] > threshold) {\n            newX.push(x[i]);\n            newY.push(y[i]);\n        }\n        else if (y[i] === threshold) {\n            nbThreshold--;\n            if (nbThreshold >= 0) {\n                newX.push(x[i]);\n                newY.push(y[i]);\n            }\n        }\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\n//# sourceMappingURL=xyFilterTopYValues.js.map","import { zonesNormalize } from \"../zones/index.js\";\n/**\n * Filter an array x/y based on various criteria x points are expected to be sorted\n * @param data - object containing 2 properties x and y\n * @param options - options\n * @returns filtered array\n */\nexport function xyFilterX(data, options = {}) {\n    const { x, y } = data;\n    if (x.length === 0) {\n        return {\n            x: Array.from(x),\n            y: Array.from(y),\n        };\n    }\n    const { from = x[0], to = x.at(-1), zones = [{ from, to }], exclusions = [], } = options;\n    const normalizedZones = zonesNormalize(zones, { from, to, exclusions });\n    let currentZoneIndex = 0;\n    const newX = [];\n    const newY = [];\n    let position = 0;\n    while (position < x.length) {\n        if (x[position] <= normalizedZones[currentZoneIndex].to &&\n            x[position] >= normalizedZones[currentZoneIndex].from) {\n            newX.push(x[position]);\n            newY.push(y[position]);\n        }\n        else if (x[position] > normalizedZones[currentZoneIndex].to) {\n            currentZoneIndex++;\n            if (!normalizedZones[currentZoneIndex])\n                break;\n        }\n        position++;\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\n//# sourceMappingURL=xyFilterX.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * Filter out all the points for which x <= 0. Useful to display log scale data\n * @param data - data\n * @returns - An object with the filtered data\n */\nexport function xyFilterXPositive(data) {\n    xyCheck(data);\n    const { x, y } = data;\n    const newX = [];\n    const newY = [];\n    if (x === undefined || y === undefined) {\n        return { x: newX, y: newY };\n    }\n    for (let i = 0; i < x.length; i++) {\n        if (x[i] > 0) {\n            newX.push(x[i]);\n            newY.push(y[i]);\n        }\n    }\n    return { x: newX, y: newY };\n}\n//# sourceMappingURL=xyFilterXPositive.js.map","import { xFindClosestIndex } from \"../x/index.js\";\n/**\n * Finds the closest point\n * @param data - x array should be sorted and ascending\n * @param target - target to search\n * @returns - closest point\n */\nexport function xyFindClosestPoint(\n/** points */\ndata, target) {\n    const { x, y } = data;\n    const index = xFindClosestIndex(x, target);\n    return {\n        x: x[index],\n        y: y[index],\n    };\n}\n//# sourceMappingURL=xyFindClosestPoint.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * Returns the numberMaxPoints points with the bigger y.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param numberMaxPoints - Number of points to keep\n * @returns - The points filtered to keep the `numberMaxPoints` most intense points of the input.\n */\nexport function xyGetNMaxY(data, numberMaxPoints) {\n    xyCheck(data);\n    if (data.x.length <= numberMaxPoints) {\n        return data;\n    }\n    else {\n        const newX = new Float64Array(numberMaxPoints);\n        const newY = new Float64Array(numberMaxPoints);\n        const floatY = Float64Array.from(data.y);\n        floatY.sort();\n        floatY.reverse();\n        const threshold = floatY[numberMaxPoints - 1];\n        let index = 0;\n        for (let i = 0; i < data.x.length; i++) {\n            if (data.y[i] >= threshold) {\n                newX[index] = data.x[i];\n                newY[index] = data.y[i];\n                index++;\n            }\n            if (index === numberMaxPoints) {\n                return { x: newX, y: newY };\n            }\n        }\n        return data;\n    }\n}\n//# sourceMappingURL=xyGetNMaxY.js.map","/**\n * Order object of array, x has to be monotone. Ensure x is growing\n * @param data - Object of kind {x:[], y:[]}.\n */\nexport function xyGrowingX(data) {\n    const { x, y } = data;\n    if (x.length !== y.length) {\n        throw new TypeError('length of x and y must be identical');\n    }\n    if (x.length < 2 || x[0] < x.at(-1))\n        return data;\n    return {\n        x: x.toReversed(),\n        y: y.toReversed(),\n    };\n}\n//# sourceMappingURL=xyGrowingX.js.map","import { xGetFromToIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Generate a X / Y of the xyIntegral\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n * @returns - An object with the xyIntegration function\n */\nexport function xyIntegral(data, options = {}) {\n    const { reverse = false } = options;\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let xyIntegration = 0;\n    const currentxyIntegral = {\n        x: new Float64Array(toIndex - fromIndex + 1),\n        y: new Float64Array(toIndex - fromIndex + 1),\n    };\n    let index = 0;\n    if (reverse) {\n        currentxyIntegral.y[index] = 0;\n        currentxyIntegral.x[index++] = x[toIndex];\n        for (let i = toIndex; i > fromIndex; i--) {\n            xyIntegration += ((x[i] - x[i - 1]) * (y[i - 1] + y[i])) / 2;\n            currentxyIntegral.x[index] = x[i - 1];\n            currentxyIntegral.y[index++] = xyIntegration;\n        }\n        currentxyIntegral.x.reverse();\n        currentxyIntegral.y.reverse();\n    }\n    else {\n        currentxyIntegral.y[index] = 0;\n        currentxyIntegral.x[index++] = x[fromIndex];\n        for (let i = fromIndex; i < toIndex; i++) {\n            xyIntegration += ((x[i + 1] - x[i]) * (y[i + 1] + y[i])) / 2;\n            currentxyIntegral.x[index] = x[i + 1];\n            currentxyIntegral.y[index++] = xyIntegration;\n        }\n    }\n    return currentxyIntegral;\n}\n//# sourceMappingURL=xyIntegral.js.map","import { xGetFromToIndex } from \"../x/xGetFromToIndex.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Computes the weighted mean value of an array of values.\n * @param data - array of DataXY\n * @param options - options\n */\nexport function xyMassCenter(data, options = {}) {\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let sumYs = 0;\n    let sumProducts = 0;\n    for (let i = fromIndex; i <= toIndex; i++) {\n        sumProducts += x[i] * y[i];\n        sumYs += y[i];\n    }\n    if (sumYs === 0) {\n        throw new Error('Sum of Ys can not be zero.');\n    }\n    return sumProducts / sumYs;\n}\n//# sourceMappingURL=xyMassCenter.js.map","import { xFindClosestIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * We will calculate a vector containing center of mass of DataXY as well as center of mass of both parts, etc.\n * This approach allows to efficiently represent spectra like XPS, NMR, etc. It should provide an extremely efficient\n * way to store and search similar spectra.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options\n * @returns - Array of centers of mass\n */\nexport function xyMassCenterVector(data, options = {}) {\n    xyCheck(data, { minLength: 2 });\n    const { depth = 5 } = options;\n    const { weightedIntegral, integral } = getWeightedIntegral(data);\n    const results = new Float64Array((1 << depth) - 1);\n    const endIndexes = new Int32Array((1 << depth) - 1);\n    endIndexes[0] = data.x.length - 1;\n    const beginIndexes = new Int32Array((1 << depth) - 1);\n    beginIndexes[0] = -1;\n    let index = 0;\n    for (let i = 0; i < depth; i++) {\n        for (let j = 0; j < 1 << i; j++) {\n            const currentBeginIndex = beginIndexes[index];\n            const currentEndIndex = endIndexes[index];\n            const currentIntegration = currentBeginIndex === -1\n                ? integral[currentEndIndex]\n                : integral[currentEndIndex] - integral[currentBeginIndex];\n            // we need to solve the issue of null integration (rather in simulated spectra).\n            let x = 0;\n            if (currentIntegration !== 0) {\n                x =\n                    currentBeginIndex === -1\n                        ? weightedIntegral[currentEndIndex] / currentIntegration\n                        : (weightedIntegral[currentEndIndex] -\n                            weightedIntegral[currentBeginIndex]) /\n                            currentIntegration;\n            }\n            else {\n                x = (data.x[currentEndIndex] + data.x[currentBeginIndex]) / 2;\n            }\n            results[index++] = x;\n            // we can now prepare the next level\n            if (i < depth - 1) {\n                const nextIndex = (1 << (i + 1)) + j * 2 - 1;\n                let middleIndex = xFindClosestIndex(data.x, x);\n                if (middleIndex === currentBeginIndex) {\n                    middleIndex++;\n                }\n                beginIndexes[nextIndex] = currentBeginIndex;\n                endIndexes[nextIndex] = middleIndex;\n                if (middleIndex === currentEndIndex) {\n                    middleIndex--;\n                }\n                beginIndexes[nextIndex + 1] = middleIndex;\n                endIndexes[nextIndex + 1] = currentEndIndex;\n            }\n        }\n    }\n    return results;\n}\nfunction getWeightedIntegral(data) {\n    const { x, y } = data;\n    const weightedIntegral = new Float64Array(x.length);\n    const integral = new Float64Array(x.length);\n    // the first point, no points before\n    const firstIntegration = (x[1] - x[0]) * y[0];\n    let totalIntegration = firstIntegration;\n    integral[0] = totalIntegration;\n    let totalWeightedIntegral = firstIntegration * x[0];\n    weightedIntegral[0] = totalWeightedIntegral;\n    for (let i = 1; i < x.length - 1; i++) {\n        const currentIntegration = ((x[i + 1] - x[i - 1]) * y[i]) / 2;\n        const currentX = x[i];\n        totalIntegration += currentIntegration;\n        integral[i] = totalIntegration;\n        totalWeightedIntegral += currentIntegration * currentX;\n        weightedIntegral[i] = totalWeightedIntegral;\n    }\n    // the last point, no points after\n    const lastIntegration = (x.at(-1) - x.at(-2)) * y.at(-1);\n    totalIntegration += lastIntegration;\n    integral[x.length - 1] = totalIntegration;\n    totalWeightedIntegral += lastIntegration * x.at(-1);\n    weightedIntegral[x.length - 1] = totalWeightedIntegral;\n    return { integral, weightedIntegral };\n}\n//# sourceMappingURL=xyMassCenterVector.js.map","import { xFindClosestIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Find the closest maximum going up hill\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns - An object with the x/y value\n */\nexport function xyMaxClosestYPoint(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const { target } = options;\n    let { targetIndex } = options;\n    if (targetIndex === undefined) {\n        if (target !== undefined) {\n            targetIndex = xFindClosestIndex(x, target);\n        }\n        else {\n            targetIndex = 0;\n        }\n    }\n    let previousIndex = Number.MIN_SAFE_INTEGER;\n    let currentIndex = targetIndex;\n    let xyMaxY = y[targetIndex];\n    while (currentIndex !== previousIndex) {\n        previousIndex = currentIndex;\n        if (currentIndex > 0 && y[currentIndex - 1] > xyMaxY) {\n            currentIndex--;\n        }\n        else if (currentIndex < x.length - 1 && y[currentIndex + 1] > xyMaxY) {\n            currentIndex++;\n        }\n        xyMaxY = y[currentIndex];\n    }\n    return {\n        x: x[currentIndex],\n        y: y[currentIndex],\n        index: currentIndex,\n    };\n}\n//# sourceMappingURL=xyMaxClosestYPoint.js.map","/**\n * Merge abscissas values on similar ordinates and weight the group of abscissas\n * @param data - object containing 2 properties x and y\n * @param options - options\n * @returns array of merged and weighted points\n */\nexport function xyMaxMerge(data, options = {}) {\n    const { x, y } = data;\n    const { groupWidth = 0.001 } = options;\n    const merged = { x: [], y: [] };\n    const maxAbscissa = { x: [], y: [] };\n    let size = 0;\n    let index = 0;\n    while (index < x.length) {\n        if (size === 0 || x[index] - merged.x[size - 1] > groupWidth) {\n            maxAbscissa.x.push(x[index]);\n            maxAbscissa.y.push(y[index]);\n            merged.x.push(x[index]);\n            merged.y.push(y[index]);\n            index++;\n            size++;\n        }\n        else {\n            if (y[index] > maxAbscissa.y[size - 1]) {\n                maxAbscissa.x[size - 1] = x[index];\n                maxAbscissa.y[size - 1] = y[index];\n            }\n            merged.x[size - 1] = x[index];\n            merged.y[size - 1] += y[index];\n            index++;\n        }\n    }\n    merged.x = maxAbscissa.x.slice();\n    return merged;\n}\n//# sourceMappingURL=xyMaxMerge.js.map","import { xGetFromToIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Finds the max value in a zone\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n * @returns - Max y on the specified range\n */\nexport function xyMaxY(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let currentxyMaxY = y[fromIndex];\n    for (let i = fromIndex; i <= toIndex; i++) {\n        if (y[i] > currentxyMaxY)\n            currentxyMaxY = y[i];\n    }\n    return currentxyMaxY;\n}\n//# sourceMappingURL=xyMaxY.js.map","import { xGetFromToIndex } from \"../x/xGetFromToIndex.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Finds all the max values\n * If the values are equal the middle\n * of the equal part will be the position of the signal!\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Object with from and to properties\n * @returns - Array of points\n */\nexport function xyMaximaY(data, options = {}) {\n    xyCheck(data, { minLength: 2 });\n    const { x, y } = data;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    const maxima = [];\n    let startEqualIndex = -1;\n    for (let i = fromIndex + 1; i < toIndex; i++) {\n        if (y[i - 1] < y[i] && y[i + 1] < y[i]) {\n            maxima.push({ x: x[i], y: y[i], index: i });\n        }\n        else if (y[i - 1] < y[i] && y[i + 1] === y[i]) {\n            startEqualIndex = i;\n        }\n        else if (y[i - 1] === y[i] && y[i + 1] < y[i]) {\n            const index = Math.floor((i + startEqualIndex) / 2);\n            maxima.push({ x: x[index], y: y[index], index });\n        }\n    }\n    return maxima;\n}\n//# sourceMappingURL=xyMaximaY.js.map","/**\n * Computes the weighted median of the x values, using the y values as weights.\n * This is the x value that splits the total weight (sum of y) into two equal halves.\n * If the cumulative weight lands exactly at 50%, the result is the average of the two surrounding x values.\n * @param data - x should be sorted in increasing order, y values are used as weights and should be non-negative.\n * @returns The weighted median x value, or NaN if the data is empty.\n */\nexport function xyMedian(data) {\n    const { x, y } = data;\n    let sumY = 0;\n    let cumSumY = 0;\n    let i;\n    if (x.length === 0) {\n        return Number.NaN;\n    }\n    if (x.length === 1) {\n        return x[0];\n    }\n    for (i = 0; i < y.length; i++) {\n        sumY += y[i];\n    }\n    for (i = 0; i < y.length; i++) {\n        cumSumY += y[i];\n        if (cumSumY > sumY / 2) {\n            return x[i];\n        }\n        else if (cumSumY === sumY / 2) {\n            return 0.5 * (x[i] + x[i + 1]);\n        }\n    }\n    return Number.NaN;\n}\n//# sourceMappingURL=xyMedian.js.map","import { xMedian } from \"../x/xMedian.js\";\n/**\n * Computes the median of Y values in a sliding window around each point.\n * @param data - Object with x and y arrays of the same length.\n * @param options - Options for the median computation.\n * @returns A new DataXY with the same x values and smoothed y values.\n */\nexport function xyMedianY(data, options = {}) {\n    const { windowSize = 5 } = options;\n    const { x, y } = data;\n    const halfWindow = Math.floor(windowSize / 2);\n    const result = new Float64Array(y.length);\n    for (let i = 0; i < y.length; i++) {\n        const fromIndex = Math.max(0, i - halfWindow);\n        const toIndex = Math.min(y.length, i + halfWindow + 1);\n        const window = ArrayBuffer.isView(y)\n            ? y.subarray(fromIndex, toIndex)\n            : y.slice(fromIndex, toIndex);\n        result[i] = xMedian(window, { exact: false });\n    }\n    return { x, y: result };\n}\n//# sourceMappingURL=xyMedianY.js.map","import { xFindClosestIndex } from \"../x/xFindClosestIndex.js\";\nimport { xMedian } from \"../x/xMedian.js\";\n/**\n * Computes the median of Y values in a sliding window around each target x position.\n * For each value in xValues, the closest index in data.x is found and the median\n * of the surrounding y values (within the window) is returned.\n * @param data - Object with x (sorted in increasing order) and y arrays of the same length.\n * @param xValues - Array of x positions at which to compute the median.\n * @param options - Options for the median computation.\n * @returns A new DataXY with x = xValues and y = computed medians.\n */\nexport function xyMedianYAtXs(data, xValues, options = {}) {\n    const { windowSize = 5 } = options;\n    const { x, y } = data;\n    const halfWindow = Math.floor(windowSize / 2);\n    const result = new Float64Array(xValues.length);\n    for (let i = 0; i < xValues.length; i++) {\n        const centerIndex = xFindClosestIndex(x, xValues[i]);\n        const fromIndex = Math.max(0, centerIndex - halfWindow);\n        const toIndex = Math.min(y.length, centerIndex + halfWindow + 1);\n        const window = ArrayBuffer.isView(y)\n            ? y.subarray(fromIndex, toIndex)\n            : y.slice(fromIndex, toIndex);\n        result[i] = xMedian(window, { exact: false });\n    }\n    return { x: xValues, y: result };\n}\n//# sourceMappingURL=xyMedianYAtXs.js.map","/**\n * Merge abscissa values if the ordinate value is in a list of centroids\n * @param data - object containing 2 properties x and y\n * @param centroids - centroids\n * @param options - options\n * @returns merged points\n */\nexport function xyMergeByCentroids(data, centroids, options = {}) {\n    const { window = 0.01 } = options;\n    const mergedPoints = {\n        x: Float64Array.from(centroids),\n        y: new Float64Array(centroids.length).fill(0),\n    };\n    let originalIndex = 0;\n    let mergedIndex = 0;\n    while (originalIndex < data.x.length && mergedIndex < centroids.length) {\n        const diff = data.x[originalIndex] - centroids[mergedIndex];\n        if (Math.abs(diff) < window) {\n            mergedPoints.y[mergedIndex] += data.y[originalIndex++];\n        }\n        else if (diff < 0) {\n            originalIndex++;\n        }\n        else {\n            mergedIndex++;\n        }\n    }\n    return mergedPoints;\n}\n//# sourceMappingURL=xyMergeByCentroids.js.map","import { xFindClosestIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Find the closest minimum going down hill\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n * @returns - An object with the x/y value\n */\nexport function xyMinClosestYPoint(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const { target } = options;\n    let { targetIndex } = options;\n    if (targetIndex === undefined) {\n        if (target !== undefined) {\n            targetIndex = xFindClosestIndex(x, target);\n        }\n        else {\n            targetIndex = 0;\n        }\n    }\n    let previousIndex = Number.MIN_SAFE_INTEGER;\n    let currentIndex = targetIndex;\n    let minY = y[targetIndex];\n    while (currentIndex !== previousIndex) {\n        previousIndex = currentIndex;\n        if (currentIndex > 0 && y[currentIndex - 1] < minY) {\n            currentIndex--;\n        }\n        else if (currentIndex < x.length - 1 && y[currentIndex + 1] < minY) {\n            currentIndex++;\n        }\n        minY = y[currentIndex];\n    }\n    return {\n        x: x[currentIndex],\n        y: y[currentIndex],\n        index: currentIndex,\n    };\n}\n//# sourceMappingURL=xyMinClosestYPoint.js.map","import { xGetFromToIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Finds the min y value in a range and return a {x,y} point\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - Options\n */\nexport function xyMinYPoint(data, options = {}) {\n    xyCheck(data, { minLength: 1 });\n    const { x, y } = data;\n    if (x.length === 1)\n        return { x: x[0], y: y[0], index: 0 };\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    let current = {\n        x: x[fromIndex],\n        y: y[fromIndex],\n        index: fromIndex,\n    };\n    for (let i = fromIndex; i <= toIndex; i++) {\n        if (y[i] < current.y)\n            current = { x: x[i], y: y[i], index: i };\n    }\n    return current;\n}\n//# sourceMappingURL=xyMinYPoint.js.map","import { xGetFromToIndex } from \"../x/xGetFromToIndex.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Finds all the min values\n * If the values are equal the middle\n * of the equal part will be the position of the signal!\n * @param data - Object that contains property X (an ordered increasing array) and y (an arraY)\n * @param options - Object with from and to properties\n * @returns - Array of points.\n */\nexport function xyMinimaY(data, options = {}) {\n    xyCheck(data, { minLength: 2 });\n    const { x, y } = data;\n    const { fromIndex, toIndex } = xGetFromToIndex(x, options);\n    const maxima = [];\n    let startEqualIndex = -1;\n    for (let i = fromIndex + 1; i < toIndex; i++) {\n        if (y[i - 1] > y[i] && y[i + 1] > y[i]) {\n            maxima.push({ x: x[i], y: y[i], index: i });\n        }\n        else if (y[i - 1] > y[i] && y[i + 1] === y[i]) {\n            startEqualIndex = i;\n        }\n        else if (y[i - 1] === y[i] && y[i + 1] > y[i]) {\n            const index = Math.floor((i + startEqualIndex) / 2);\n            maxima.push({ x: x[index], y: y[index], index });\n        }\n    }\n    return maxima;\n}\n//# sourceMappingURL=xyMinimaY.js.map","import { xyObjectMaxXPoint } from \"./xyObjectMaxXPoint.js\";\nimport { xyObjectMinXPoint } from \"./xyObjectMinXPoint.js\";\n/**\n * Filter the array by taking the higher points (max y value) and only.\n * Keep one per slot. There are 2 different slots, the smallest one will have the\n * new property `close` to true\n * @param points - array of all the points\n * @param options - Options\n * @returns - copy of points with 'close' property\n */\nexport function xyObjectBestPoints(points, options = {}) {\n    const { from = xyObjectMinXPoint(points).x, to = xyObjectMaxXPoint(points).x, limit = 20, threshold = 0.01, numberCloseSlots = 50, numberSlots = 10, } = options;\n    const slot = (to - from) / numberSlots;\n    const closeSlot = (to - from) / numberCloseSlots;\n    const selected = points\n        .filter((point) => point.x >= from && point.x <= to)\n        .map((point) => {\n        return {\n            point,\n        };\n    });\n    selected.sort((a, b) => {\n        return b.point.y - a.point.y;\n    });\n    const toReturn = [];\n    if (selected.length === 0)\n        return [];\n    const minY = selected[0].point.y * threshold;\n    peakLoop: for (const item of selected) {\n        if (item.point.y < minY) {\n            break;\n        }\n        let close = false;\n        for (const existing of toReturn) {\n            if (Math.abs(existing.x - item.point.x) < closeSlot) {\n                continue peakLoop;\n            }\n            if (Math.abs(existing.x - item.point.x) < slot) {\n                close = true;\n            }\n        }\n        const newPeak = { ...item.point, close };\n        toReturn.push(newPeak);\n        if (toReturn.length === limit)\n            break;\n    }\n    toReturn.sort((a, b) => a.x - b.x);\n    return toReturn;\n}\n//# sourceMappingURL=xyObjectBestPoints.js.map","/**\n * xyObjectJoinX.\n * @param points - Array of growing points {x,y}.\n * @param options - Options.\n */\nexport function xyObjectJoinX(points, options = {}) {\n    const { xError = Number.EPSILON } = options;\n    // when we join we will use the center of mass\n    const result = [];\n    let current = {\n        x: Number.MIN_SAFE_INTEGER,\n        y: 0,\n    };\n    for (const point of points) {\n        if (point.x - current.x <= xError) {\n            // weighted sum\n            if (current.y !== 0 || point.y !== 0) {\n                current.x =\n                    (point.y / (current.y + point.y)) * (point.x - current.x) + current.x;\n                current.y += point.y;\n            }\n        }\n        else {\n            current = {\n                x: point.x,\n                y: point.y,\n            };\n            result.push(current);\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=xyObjectJoinX.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Finds the max y value and return a {x,y,index} point\n * @param points - Object that contains property x (an ordered increasing array) and y (an array)\n * @returns max point\n */\nexport function xyObjectMaxYPoint(points = []) {\n    xyObjectCheck(points);\n    if (points.length === 0)\n        return { x: 0, y: 0 };\n    let current = {\n        x: points[0].x,\n        y: points[0].y,\n        index: 0,\n    };\n    for (let i = 1; i < points.length; i++) {\n        if (points[i].y > current.y) {\n            current = {\n                x: points[i].x,\n                y: points[i].y,\n                index: i,\n            };\n        }\n    }\n    return current;\n}\n//# sourceMappingURL=xyObjectMaxYPoint.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Returns all min and max values of an array of points.\n * @param points - Array of points {x,y}.\n * @returns - Object with the 4 extrema.\n */\nexport function xyObjectMinMaxValues(points) {\n    xyObjectCheck(points, { minLength: 1 });\n    let minX = points[0].x;\n    let maxX = minX;\n    let minY = points[0].y;\n    let maxY = minY;\n    for (const point of points) {\n        if (point.x < minX)\n            minX = point.x;\n        if (point.x > maxX)\n            maxX = point.x;\n        if (point.y < minY)\n            minY = point.y;\n        if (point.y > maxY)\n            maxY = point.y;\n    }\n    return { minX, maxX, minY, maxY };\n}\n//# sourceMappingURL=xyObjectMinMaxValues.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Finds the min y value and return a {x,y,index} point\n * @param points - Object that contains property x (an ordered increasing array) and y (an array)\n */\nexport function xyObjectMinYPoint(points = []) {\n    xyObjectCheck(points);\n    if (points.length === 0)\n        return { x: 0, y: 0 };\n    let current = {\n        x: points[0].x,\n        y: points[0].y,\n        index: 0,\n    };\n    for (let i = 1; i < points.length; i++) {\n        if (points[i].y < current.y) {\n            current = {\n                x: points[i].x,\n                y: points[i].y,\n                index: i,\n            };\n        }\n    }\n    return current;\n}\n//# sourceMappingURL=xyObjectMinYPoint.js.map","import { xNormed } from \"../x/xNormed.js\";\n/**\n * Resize the Y values of the points to be normalized.\n * @param points - array of points {x,y}\n * @param options\n * @returns - array of points {x,y} with normalized Y values\n */\nexport function xyObjectNormedY(points, options) {\n    points = structuredClone(points);\n    const ys = points.map((point) => point.y);\n    const normalizedYs = xNormed(ys, options);\n    for (let i = 0; i < points.length; i++) {\n        points[i].y = normalizedYs[i];\n    }\n    return points;\n}\n//# sourceMappingURL=xyObjectNormedY.js.map","/**\n * Sorts an array of points in-place.\n * @param points - array of points {x,y}\n * @returns - sorted array of points {x,y}\n */\nexport function xyObjectSortX(points) {\n    points.sort((a, b) => a.x - b.x);\n    return points;\n}\n//# sourceMappingURL=xyObjectSortX.js.map","import { xyObjectCheck } from \"./xyObjectCheck.js\";\n/**\n * Calculate the sum of Y values.\n * @param points - Object that contains property x and y (an array)\n */\nexport function xyObjectSumY(points = []) {\n    xyObjectCheck(points);\n    let sum = 0;\n    for (const point of points) {\n        sum += point.y;\n    }\n    return sum;\n}\n//# sourceMappingURL=xyObjectSumY.js.map","/**\n * xyObjectToXY.\n * @param points - Array of points {x,y}.\n */\nexport function xyObjectToXY(points) {\n    return {\n        x: points.map((entry) => entry.x),\n        y: points.map((entry) => entry.y),\n    };\n}\n//# sourceMappingURL=xyObjectToXY.js.map","import { xFindClosestIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Returns an information about a signal.\n *\n *\n * We expect ordered data and equidistant X axis\n * You can use the method helper if required:\n * ML.ArrayPoints.uniqueX\n * ML.ArrayPoints.sortX\n * ML.ArrayPoints.equallySpaced\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns - Information about signal\n */\nexport function xyPeakInfo(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    if (x === undefined || y === undefined || x.length < 3) {\n        return;\n    }\n    const { target } = options;\n    let { targetIndex } = options;\n    if (targetIndex === undefined && target !== undefined) {\n        targetIndex = xFindClosestIndex(x, target);\n    }\n    if (targetIndex === undefined) {\n        throw new Error('must specify target or targetIndex');\n    }\n    let i = targetIndex;\n    let currentDiff = y[i] - y[i + 1];\n    const multiplier = currentDiff < 0 ? -1 : 1;\n    currentDiff *= multiplier;\n    while (i < x.length - 1) {\n        i++;\n        const newDiff = (y[i] - y[i + 1]) * multiplier;\n        if (newDiff < currentDiff)\n            break;\n        currentDiff = newDiff;\n    }\n    const after = { x: x[i], y: y[i] };\n    i = targetIndex;\n    currentDiff = (y[i] - y[i - 1]) * multiplier;\n    while (i > 1) {\n        i--;\n        const newDiff = (y[i] - y[i - 1]) * multiplier;\n        if (newDiff < currentDiff)\n            break;\n        currentDiff = newDiff;\n    }\n    const before = { x: x[i], y: y[i] };\n    return {\n        inflectionBefore: before,\n        inflectionAfter: after,\n        extrema: { x: x[targetIndex], y: y[targetIndex] },\n        inflectionMiddle: {\n            x: (before.x + after.x) / 2,\n            y: (before.y + after.y) / 2,\n        },\n        width: Math.abs(before.x - after.x),\n    };\n}\n//# sourceMappingURL=xyPeakInfo.js.map","import { xGetTargetIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Find the closest minimum going down hill\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns - An object with the x/y value\n */\nexport function xyRealMaxYPoint(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const targetIndex = xGetTargetIndex(x, options);\n    // interpolation to a sin() function\n    if (y[targetIndex - 1] > 0 &&\n        y[targetIndex + 1] > 0 &&\n        y[targetIndex] >= y[targetIndex - 1] &&\n        y[targetIndex] >= y[targetIndex + 1]) {\n        const alpha = 20 * Math.log10(y[targetIndex - 1]);\n        const beta = 20 * Math.log10(y[targetIndex]);\n        const gamma = 20 * Math.log10(y[targetIndex + 1]);\n        const p = (0.5 * (alpha - gamma)) / (alpha - 2 * beta + gamma);\n        return {\n            x: x[targetIndex] + (x[targetIndex] - x[targetIndex - 1]) * p,\n            y: y[targetIndex] - 0.25 * (y[targetIndex - 1] - y[targetIndex + 1]) * p,\n            index: targetIndex,\n        };\n    }\n    else {\n        return {\n            x: x[targetIndex],\n            y: y[targetIndex],\n            index: targetIndex,\n        };\n    }\n}\n//# sourceMappingURL=xyRealMaxYPoint.js.map","import { xGetTargetIndex } from \"../x/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * xyRealMinYPoint.\n * @param data - Data.\n * @param options - Options.\n */\nexport function xyRealMinYPoint(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const targetIndex = xGetTargetIndex(x, options);\n    // interpolation to a sin() function\n    if (y[targetIndex - 1] < 0 &&\n        y[targetIndex + 1] < 0 &&\n        y[targetIndex] <= y[targetIndex - 1] &&\n        y[targetIndex] <= y[targetIndex + 1]) {\n        const alpha = 20 * Math.log10(-y[targetIndex - 1]);\n        const beta = 20 * Math.log10(-y[targetIndex]);\n        const gamma = 20 * Math.log10(-y[targetIndex + 1]);\n        const p = (0.5 * (alpha - gamma)) / (alpha - 2 * beta + gamma);\n        return {\n            x: x[targetIndex] + (x[targetIndex] - x[targetIndex - 1]) * p,\n            y: y[targetIndex] - 0.25 * (y[targetIndex - 1] - y[targetIndex + 1]) * p,\n            index: targetIndex,\n        };\n    }\n    else {\n        return {\n            x: x[targetIndex],\n            y: y[targetIndex],\n            index: targetIndex,\n        };\n    }\n}\n//# sourceMappingURL=xyRealMinYPoint.js.map","import { zonesNormalize } from \"../zones/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\nimport { getInternalZones, notEnoughPoints } from \"./xyReduce.js\";\n/**\n * Reduce the number of points while keeping visually the same noise. Practical to\n * display many spectra as SVG. This algorithm is designed for non-continuous data.\n * We are expecting peaks to be only positive and the x values to be ordered.\n * SHOULD NOT BE USED FOR DATA PROCESSING !!!\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns Object with x and y arrays\n */\nexport function xyReduceNonContinuous(data, options = {}) {\n    xyCheck(data);\n    if (data.x.length < 2) {\n        // todo we should check that the single point is really in the range and the zones\n        return {\n            x: Float64Array.from(data.x),\n            y: Float64Array.from(data.y),\n        };\n    }\n    const { x, y } = data;\n    const { from = x[0], to = x.at(-1), maxApproximateNbPoints = 4001, } = options;\n    let { zones = [] } = options;\n    zones = zonesNormalize(zones, { from, to });\n    if (zones.length === 0)\n        zones = [{ from, to }]; // we take everything\n    const { internalZones, totalPoints } = getInternalZones(zones, x);\n    // we calculate the number of points per zone that we should keep\n    if (totalPoints <= maxApproximateNbPoints) {\n        return notEnoughPoints(x, y, internalZones, totalPoints);\n    }\n    const deltaX = (to - from) / (maxApproximateNbPoints - 1);\n    const newX = [];\n    const newY = [];\n    for (const internalZone of internalZones) {\n        const maxNbPoints = Math.ceil((internalZone.to - internalZone.from) / deltaX) + 1;\n        const fromIndex = internalZone.fromIndex;\n        const toIndex = internalZone.toIndex;\n        if (toIndex - fromIndex + 1 <= maxNbPoints) {\n            // we keep all the points\n            for (let i = fromIndex; i <= toIndex; i++) {\n                newX.push(x[i]);\n                newY.push(y[i]);\n            }\n        }\n        else {\n            // we need to reduce the number of points\n            let currentX = x[fromIndex];\n            let currentY = y[fromIndex];\n            let lastX = currentX + deltaX;\n            newX.push(currentX);\n            newY.push(currentY);\n            for (let i = fromIndex; i <= toIndex; i++) {\n                if (x[i] > lastX) {\n                    // next slot\n                    currentX = x[i];\n                    currentY = y[i];\n                    newX.push(currentX);\n                    newY.push(currentY);\n                    lastX += deltaX;\n                }\n                if (y[i] > currentY) {\n                    currentY = y[i];\n                    newY[newY.length - 1] = currentY;\n                }\n            }\n        }\n    }\n    return {\n        x: newX,\n        y: newY,\n    };\n}\n//# sourceMappingURL=xyReduceNonContinuous.js.map","import { xRolling, xRollingAverage } from \"../x/index.js\";\n/**\n * This function calculates a rolling average.\n * This methods will recalculate the x values by using xRollingAverage\n * @param data - array of points {x,y}\n * @param fct - callback function that from an array returns a value.\n * @param options - options\n */\nexport function xyRolling(data, fct, options = {}) {\n    let { x, y } = data;\n    y = xRolling(y, fct, options);\n    if (x.length !== y.length) {\n        x = xRollingAverage(x, options);\n    }\n    return { x, y };\n}\n//# sourceMappingURL=xyRolling.js.map","/**\n *\n * Dong, Jian, et al. \"An algorithm of filtering noises in multi-beam data based on rolling circle transform.\" 2019 2nd International Conference on Sustainable Energy, Environment and Information Engineering (SEEIE 2019). Atlantis Press, 2019.\n * DONG Jian, PENG Rencan, ZHANG Lihua, WANG Zhijun. An Algorithm of Filtering Noises in Multi-beam Data Based on Rolling Circle Transform[J]. Geomatics and Information Science of Wuhan University, 2016, 41(1): 86-92. DOI: 10.13203/j.whugis20130757\n * @param data\n * @param options\n */\nimport { xFindClosestIndex } from \"../x/xFindClosestIndex.js\";\nexport function xyRollingCircleTransform(data, options = {}) {\n    const { x } = data;\n    let { y } = data;\n    const { radius = 1, position = 'top', shifted = true } = options;\n    if (position !== 'top' && position !== 'bottom') {\n        throw new Error(`Invalid position: ${String(position)}`);\n    }\n    if (position === 'bottom') {\n        y = y.slice();\n        for (let i = 0; i < y.length; i++) {\n            y[i] = -y[i];\n        }\n    }\n    if (x.length === 0 || y.length === 0) {\n        return new Float64Array();\n    }\n    const yCenters = new Float64Array(x.length);\n    for (let i = 0; i < x.length; i++) {\n        const x0 = x[i]; // x center of the current circle\n        const fromX = xFindClosestIndex(x, x0 - radius);\n        const toX = xFindClosestIndex(x, x0 + radius);\n        // for the circle radius we need to evaluate the minimal vertical shift\n        const y0 = y[i] + radius; // y center of the circle on top of peak\n        let yShift = y0; // this is the minimal possible shift\n        for (let j = fromX; j <= toX; j++) {\n            const currentX = x[j];\n            if (currentX < x0 - radius || currentX > x0 + radius) {\n                continue;\n            }\n            const currentMinYShift = y[j] + Math.sqrt(radius ** 2 - (currentX - x0) ** 2);\n            if (currentMinYShift > yShift) {\n                yShift = currentMinYShift;\n            }\n        }\n        yCenters[i] = yShift;\n    }\n    if (!shifted) {\n        for (let i = 0; i < yCenters.length; i++) {\n            yCenters[i] -= radius;\n        }\n    }\n    if (position === 'bottom') {\n        for (let i = 0; i < yCenters.length; i++) {\n            yCenters[i] = -yCenters[i];\n        }\n    }\n    return yCenters;\n}\n//# sourceMappingURL=xyRollingCircleTransform.js.map","import { zonesNormalize } from \"../zones/index.js\";\nimport { xyCheck } from \"./xyCheck.js\";\n/**\n * Set a value (default 0) to specific zones.\n * @param data - Object that contains property x (an ordered increasing array) and y (an array)\n * @param options - options\n * @returns - Array of points\n */\nexport function xySetYValue(data, options = {}) {\n    xyCheck(data);\n    const { x, y } = data;\n    const { value = 0 } = options;\n    let { zones } = options;\n    if (!Array.isArray(zones) || zones.length === 0) {\n        return data;\n    }\n    zones = zonesNormalize(zones);\n    const newX = x.slice();\n    const newY = y.slice();\n    let currentZone = zones[0];\n    let position = 0;\n    loop: for (let i = 0; i < x.length; i++) {\n        while (currentZone.to < x[i]) {\n            position++;\n            currentZone = zones[position];\n            if (!currentZone) {\n                i = x.length;\n                break loop;\n            }\n        }\n        if (x[i] >= currentZone.from) {\n            newY[i] = value;\n        }\n    }\n    return { x: newX, y: newY };\n}\n//# sourceMappingURL=xySetYValue.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * Convert a DataXY to an array of array containing x,y.\n * @param data - array of points {x,y}\n */\nexport function xyToXYArray(data) {\n    xyCheck(data);\n    const { x, y } = data;\n    const objectArray = [];\n    for (let i = 0; i < x.length; i++) {\n        objectArray.push([x[i], y[i]]);\n    }\n    return objectArray;\n}\n//# sourceMappingURL=xyToXYArray.js.map","import { xyCheck } from \"./xyCheck.js\";\n/**\n * xyToXYObject.\n * @param data - Array of points {x,y}.\n */\nexport function xyToXYObject(data) {\n    xyCheck(data);\n    const { x, y } = data;\n    const objectArray = [];\n    for (let i = 0; i < x.length; i++) {\n        objectArray.push({ x: x[i], y: y[i] });\n    }\n    return objectArray;\n}\n//# sourceMappingURL=xyToXYObject.js.map","/**\n * Merge abscissas values on similar ordinates and weight the group of abscissas\n * @param data - object containing 2 properties x and y\n * @param options - options\n * @returns array of merged and weighted points\n */\nexport function xyWeightedMerge(data, options = {}) {\n    const { x, y } = data;\n    const { groupWidth = 0.001 } = options;\n    const merged = { x: [], y: [] };\n    const weightedAbscissa = { x: [], y: [] };\n    let size = 0;\n    let index = 0;\n    while (index < x.length) {\n        if (size === 0 || x[index] - merged.x[size - 1] > groupWidth) {\n            weightedAbscissa.x.push(x[index] * y[index]);\n            weightedAbscissa.y.push(y[index]);\n            merged.x.push(x[index]);\n            merged.y.push(y[index]);\n            index++;\n            size++;\n        }\n        else {\n            weightedAbscissa.x[size - 1] += x[index] * y[index];\n            weightedAbscissa.y[size - 1] += y[index];\n            merged.x[size - 1] = x[index];\n            merged.y[size - 1] += y[index];\n            index++;\n        }\n    }\n    for (let i = 0; i < merged.x.length; i++) {\n        merged.x[i] = weightedAbscissa.x[i] / weightedAbscissa.y[i];\n    }\n    return merged;\n}\n//# sourceMappingURL=xyWeightedMerge.js.map","import { createFromToArray } from \"../utils/createFromToArray.js\";\nimport { zonesNormalize } from \"./zonesNormalize.js\";\nimport { zonesWithPoints } from \"./zonesWithPoints.js\";\n/**\n * Function that returns a Number array of equally spaced numberOfPoints x values\n * distributed across the specified zones.\n * @param zones - array of from/to zones where x values should be distributed\n * @param numberOfPoints - total number of points to distribute across all zones\n * @param options - options\n * @returns array of equally spaced x values distributed across zones\n */\nexport function zonesToXEquallySpaced(zones, numberOfPoints, options = {}) {\n    if (!zones || zones.length === 0) {\n        throw new RangeError('zones array must not be empty');\n    }\n    if (numberOfPoints < 1) {\n        throw new RangeError(\"'numberOfPoints' must be greater than 0\");\n    }\n    const from = options.from ?? zones[0].from;\n    //@ts-expect-error zones is tested before\n    const to = options.to ?? zones.at(-1).to;\n    if (from > to) {\n        throw new RangeError('from should be less than or equal to to');\n    }\n    const normalizedZones = zonesNormalize(zones, { from, to, exclusions: [] });\n    const zonesWithPointsRes = zonesWithPoints(normalizedZones, numberOfPoints, {\n        from,\n        to,\n    }).filter((zone) => zone.numberOfPoints);\n    let xResult = [];\n    for (const zone of zonesWithPointsRes) {\n        if (!zone.numberOfPoints) {\n            zone.numberOfPoints = 0;\n        }\n        const zoneXValues = Array.from(createFromToArray({\n            from: zone.from,\n            to: zone.to,\n            length: zone.numberOfPoints,\n            includeFrom: false,\n            includeTo: false,\n        }));\n        xResult = xResult.concat(zoneXValues);\n    }\n    return new Float64Array(xResult);\n}\n//# sourceMappingURL=zonesToXEquallySpaced.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Computes the sum of the given values.\n */\nexport default function sum(input) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    let sumValue = 0;\n    for (const value of input) {\n        sumValue += value;\n    }\n    return sumValue;\n}\n//# sourceMappingURL=index.js.map","/**\n * Class allowing to manage a Serie\n */\nexport class Series {\n  constructor(array, dimension, options = {}) {\n    let { meta = {} } = options;\n    if (new.target === Series) {\n      throw new Error('You need to create either a 1D or 2D series');\n    }\n    this.data = array;\n    this.dimension = dimension;\n    this.meta = meta;\n    this.name = '';\n  }\n\n  getData() {\n    return this.data;\n  }\n\n  is1D() {\n    return this.dimension === 1;\n  }\n\n  is2D() {\n    return this.dimension === 2;\n  }\n\n  toJSON() {\n    return {\n      data: this.data,\n      meta: this.meta,\n    };\n  }\n\n  /**\n   * Specify an array of index to keep\n   * @param {Array} array\n   */\n  keep(array) {\n    const newData = [];\n    for (let i of array) {\n      newData.push(this.data[i]);\n    }\n    this.data = newData;\n    return this;\n  }\n}\n","import { Series } from './Series';\n\n/**\n * Class allowing to manage a Serie\n */\nexport class Series1D extends Series {\n  constructor(array) {\n    super(array, 1);\n  }\n}\n","import { Series } from './Series';\n\n/**\n * Class allowing to manage a 2D Serie\n */\nexport class Series2D extends Series {\n  constructor(array) {\n    super(array, 2);\n  }\n}\n","import { isAnyArray } from 'is-any-array';\n\nimport { Series1D } from './Series1D';\nimport { Series2D } from './Series2D';\n\nexport function seriesFromArray(array) {\n  // need to check if it is a 1D or 2D array (or 3D ?)\n  if (!isAnyArray(array)) {\n    throw new TypeError(\n      'seriesFromArray requires as parameter an array of numbers or array',\n    );\n  }\n\n  if (array.length === 0 || typeof array[0] === 'number') {\n    return new Series1D(array);\n  }\n\n  if (!isAnyArray(array[0])) {\n    throw new TypeError(\n      'seriesFromArray requires as parameter an array of numbers or array',\n    );\n  }\n\n  return new Series2D(array);\n}\n","import arrayMean from 'ml-array-mean';\n\nimport { seriesFromArray } from '../seriesFromArray';\n\nexport function meanFilter(chromatogram, seriesName, options = {}) {\n  const { factor = 2 } = options;\n\n  let series = chromatogram.getSeries(seriesName);\n  let filtered = [];\n  for (let i = 0; i < series.data.length; i++) {\n    filtered.push(applyFilter(series.data[i], factor));\n  }\n\n  return seriesFromArray(filtered);\n}\n\nfunction applyFilter(series, factor) {\n  let filtered = [[], []];\n  if (series[1].length === 0) return filtered;\n  const meanIntensity = factor * arrayMean(series[1]);\n  for (let i = 0; i < series[0].length; i++) {\n    if (series[1][i] > meanIntensity) {\n      filtered[0].push(series[0][i]);\n      filtered[1].push(series[1][i]);\n    }\n  }\n  return filtered;\n}\n","import sum from 'ml-array-sum';\n/**\n * Computes the mean of the given values.\n */\nexport default function mean(array) {\n    return sum(array) / array.length;\n}\n//# sourceMappingURL=index.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Computes the maximum of the given values.\n *\n * @param input\n * @param options\n */\nexport default function max(input, options = {}) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    const { fromIndex = 0, toIndex = input.length } = options;\n    if (fromIndex < 0 ||\n        fromIndex >= input.length ||\n        !Number.isInteger(fromIndex)) {\n        throw new Error('fromIndex must be a positive integer smaller than length');\n    }\n    if (toIndex <= fromIndex ||\n        toIndex > input.length ||\n        !Number.isInteger(toIndex)) {\n        throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n    }\n    let maxValue = input[fromIndex];\n    for (let i = fromIndex + 1; i < toIndex; i++) {\n        if (input[i] > maxValue)\n            maxValue = input[i];\n    }\n    return maxValue;\n}\n//# sourceMappingURL=index.js.map","import arrayMax from 'ml-array-max';\n\nimport { seriesFromArray } from '../seriesFromArray';\n\nexport function percentageFilter(chromatogram, seriesName, options = {}) {\n  const { percentage = 0.1 } = options;\n\n  let series = chromatogram.getSeries(seriesName);\n  let filtered = [];\n\n  for (let i = 0; i < series.data.length; i++) {\n    filtered.push(applyFilter(series.data[i], percentage));\n  }\n\n  return seriesFromArray(filtered);\n}\n\nfunction applyFilter(series, percentage) {\n  let basePeak;\n  try {\n    basePeak = arrayMax(series[1]);\n  } catch {\n    basePeak = 0;\n  }\n  let filtered = [[], []];\n  for (let i = 0; i < series[0].length; i++) {\n    if (series[1][i] > percentage * basePeak) {\n      filtered[0].push(series[0][i]);\n      filtered[1].push(series[1][i]);\n    }\n  }\n  return filtered;\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.atomSorter = atomSorter;\n/**\n * Implementation of the Hill system for sorting atoms\n * https://en.wikipedia.org/wiki/Chemical_formula#Hill_system\n * @param a - first atom to compare\n * @param b - second atom to compare\n * @returns A value suitable for use in Array.prototype.sort.\n */\nfunction atomSorter(a, b) {\n    if (a === b)\n        return 0;\n    if (a === 'C')\n        return -1;\n    if (b === 'C')\n        return 1;\n    if (a === 'H')\n        return -1;\n    if (b === 'H')\n        return 1;\n    if (a < b)\n        return -1;\n    return 1;\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elementsAndIsotopes = void 0;\nexports.elementsAndIsotopes = [\n    {\n        number: 1,\n        isotopes: [\n            { nominal: 1, mass: 1.00782503223, abundance: 0.999885 },\n            { nominal: 2, mass: 2.01410177812, abundance: 0.000115 },\n            { nominal: 3, mass: 3.0160492779 },\n            { nominal: 4, mass: 4.02643 },\n            { nominal: 5, mass: 5.035311 },\n            { nominal: 6, mass: 6.04496 },\n            { nominal: 7, mass: 7.0527 },\n        ],\n        symbol: 'H',\n        mass: 1.0079407540557772,\n        name: 'Hydrogen',\n        monoisotopicMass: 1.00782503223,\n    },\n    {\n        number: 2,\n        isotopes: [\n            { nominal: 3, mass: 3.0160293201, abundance: 0.00000134 },\n            { nominal: 4, mass: 4.00260325413, abundance: 0.99999866 },\n            { nominal: 5, mass: 5.012057 },\n            { nominal: 6, mass: 6.018885891 },\n            { nominal: 7, mass: 7.0279907 },\n            { nominal: 8, mass: 8.03393439 },\n            { nominal: 9, mass: 9.043946 },\n            { nominal: 10, mass: 10.05279 },\n        ],\n        symbol: 'He',\n        mass: 4.002601932120929,\n        name: 'Helium',\n        monoisotopicMass: 4.00260325413,\n    },\n    {\n        number: 3,\n        isotopes: [\n            { nominal: 3, mass: 3.0308 },\n            { nominal: 4, mass: 4.02719 },\n            { nominal: 5, mass: 5.012538 },\n            { nominal: 6, mass: 6.0151228874, abundance: 0.0759 },\n            { nominal: 7, mass: 7.0160034366, abundance: 0.9241 },\n            { nominal: 8, mass: 8.022486246 },\n            { nominal: 9, mass: 9.02679019 },\n            { nominal: 10, mass: 10.035483 },\n            { nominal: 11, mass: 11.04372358 },\n            { nominal: 12, mass: 12.052517 },\n            { nominal: 13, mass: 13.06263 },\n        ],\n        symbol: 'Li',\n        mass: 6.94003660291572,\n        name: 'Lithium',\n        monoisotopicMass: 7.0160034366,\n    },\n    {\n        number: 4,\n        isotopes: [\n            { nominal: 5, mass: 5.0399 },\n            { nominal: 6, mass: 6.0197264 },\n            { nominal: 7, mass: 7.016928717 },\n            { nominal: 8, mass: 8.005305102 },\n            { nominal: 9, mass: 9.012183065, abundance: 1 },\n            { nominal: 10, mass: 10.013534695 },\n            { nominal: 11, mass: 11.02166108 },\n            { nominal: 12, mass: 12.0269221 },\n            { nominal: 13, mass: 13.036135 },\n            { nominal: 14, mass: 14.04289 },\n            { nominal: 15, mass: 15.05342 },\n            { nominal: 16, mass: 16.06167 },\n        ],\n        symbol: 'Be',\n        mass: 9.012183065,\n        name: 'Beryllium',\n        monoisotopicMass: 9.012183065,\n    },\n    {\n        number: 5,\n        isotopes: [\n            { nominal: 6, mass: 6.0508 },\n            { nominal: 7, mass: 7.029712 },\n            { nominal: 8, mass: 8.0246073 },\n            { nominal: 9, mass: 9.01332965 },\n            { nominal: 10, mass: 10.01293695, abundance: 0.199 },\n            { nominal: 11, mass: 11.00930536, abundance: 0.801 },\n            { nominal: 12, mass: 12.0143527 },\n            { nominal: 13, mass: 13.0177802 },\n            { nominal: 14, mass: 14.025404 },\n            { nominal: 15, mass: 15.031088 },\n            { nominal: 16, mass: 16.039842 },\n            { nominal: 17, mass: 17.04699 },\n            { nominal: 18, mass: 18.05566 },\n            { nominal: 19, mass: 19.0631 },\n            { nominal: 20, mass: 20.07207 },\n            { nominal: 21, mass: 21.08129 },\n        ],\n        symbol: 'B',\n        mass: 10.811028046410001,\n        name: 'Boron',\n        monoisotopicMass: 11.00930536,\n    },\n    {\n        number: 6,\n        isotopes: [\n            { nominal: 8, mass: 8.037643 },\n            { nominal: 9, mass: 9.0310372 },\n            { nominal: 10, mass: 10.01685331 },\n            { nominal: 11, mass: 11.0114336 },\n            { nominal: 12, mass: 12, abundance: 0.9893 },\n            { nominal: 13, mass: 13.00335483507, abundance: 0.0107 },\n            { nominal: 14, mass: 14.0032419884 },\n            { nominal: 15, mass: 15.01059926 },\n            { nominal: 16, mass: 16.0147013 },\n            { nominal: 17, mass: 17.022577 },\n            { nominal: 18, mass: 18.026751 },\n            { nominal: 19, mass: 19.0348 },\n            { nominal: 20, mass: 20.04032 },\n            { nominal: 21, mass: 21.049 },\n            { nominal: 22, mass: 22.05753 },\n            { nominal: 23, mass: 23.0689 },\n        ],\n        symbol: 'C',\n        mass: 12.010735896735248,\n        name: 'Carbon',\n        monoisotopicMass: 12,\n    },\n    {\n        number: 7,\n        isotopes: [\n            { nominal: 10, mass: 10.04165 },\n            { nominal: 11, mass: 11.026091 },\n            { nominal: 12, mass: 12.0186132 },\n            { nominal: 13, mass: 13.00573861 },\n            { nominal: 14, mass: 14.00307400443, abundance: 0.99636 },\n            { nominal: 15, mass: 15.00010889888, abundance: 0.00364 },\n            { nominal: 16, mass: 16.0061019 },\n            { nominal: 17, mass: 17.008449 },\n            { nominal: 18, mass: 18.014078 },\n            { nominal: 19, mass: 19.017022 },\n            { nominal: 20, mass: 20.023366 },\n            { nominal: 21, mass: 21.02711 },\n            { nominal: 22, mass: 22.03439 },\n            { nominal: 23, mass: 23.04114 },\n            { nominal: 24, mass: 24.05039 },\n            { nominal: 25, mass: 25.0601 },\n        ],\n        symbol: 'N',\n        mass: 14.006703211445798,\n        name: 'Nitrogen',\n        monoisotopicMass: 14.00307400443,\n    },\n    {\n        number: 8,\n        isotopes: [\n            { nominal: 12, mass: 12.034262 },\n            { nominal: 13, mass: 13.024815 },\n            { nominal: 14, mass: 14.00859636 },\n            { nominal: 15, mass: 15.00306562 },\n            { nominal: 16, mass: 15.99491461957, abundance: 0.99757 },\n            { nominal: 17, mass: 16.9991317565, abundance: 0.00038 },\n            { nominal: 18, mass: 17.99915961286, abundance: 0.00205 },\n            { nominal: 19, mass: 19.003578 },\n            { nominal: 20, mass: 20.00407535 },\n            { nominal: 21, mass: 21.008655 },\n            { nominal: 22, mass: 22.009966 },\n            { nominal: 23, mass: 23.015696 },\n            { nominal: 24, mass: 24.01986 },\n            { nominal: 25, mass: 25.02936 },\n            { nominal: 26, mass: 26.03729 },\n            { nominal: 27, mass: 27.04772 },\n            { nominal: 28, mass: 28.05591 },\n        ],\n        symbol: 'O',\n        mass: 15.999404924318277,\n        name: 'Oxygen',\n        monoisotopicMass: 15.99491461957,\n    },\n    {\n        number: 9,\n        isotopes: [\n            { nominal: 14, mass: 14.034315 },\n            { nominal: 15, mass: 15.018043 },\n            { nominal: 16, mass: 16.0114657 },\n            { nominal: 17, mass: 17.00209524 },\n            { nominal: 18, mass: 18.00093733 },\n            { nominal: 19, mass: 18.99840316273, abundance: 1 },\n            { nominal: 20, mass: 19.999981252 },\n            { nominal: 21, mass: 20.9999489 },\n            { nominal: 22, mass: 22.002999 },\n            { nominal: 23, mass: 23.003557 },\n            { nominal: 24, mass: 24.008115 },\n            { nominal: 25, mass: 25.012199 },\n            { nominal: 26, mass: 26.020038 },\n            { nominal: 27, mass: 27.02644 },\n            { nominal: 28, mass: 28.03534 },\n            { nominal: 29, mass: 29.04254 },\n            { nominal: 30, mass: 30.05165 },\n            { nominal: 31, mass: 31.05971 },\n        ],\n        symbol: 'F',\n        mass: 18.99840316273,\n        name: 'Fluorine',\n        monoisotopicMass: 18.99840316273,\n    },\n    {\n        number: 10,\n        isotopes: [\n            { nominal: 16, mass: 16.02575 },\n            { nominal: 17, mass: 17.01771396 },\n            { nominal: 18, mass: 18.0057087 },\n            { nominal: 19, mass: 19.00188091 },\n            { nominal: 20, mass: 19.9924401762, abundance: 0.9048 },\n            { nominal: 21, mass: 20.993846685, abundance: 0.0027 },\n            { nominal: 22, mass: 21.991385114, abundance: 0.0925 },\n            { nominal: 23, mass: 22.99446691 },\n            { nominal: 24, mass: 23.99361065 },\n            { nominal: 25, mass: 24.997789 },\n            { nominal: 26, mass: 26.000515 },\n            { nominal: 27, mass: 27.007553 },\n            { nominal: 28, mass: 28.01212 },\n            { nominal: 29, mass: 29.01975 },\n            { nominal: 30, mass: 30.02473 },\n            { nominal: 31, mass: 31.0331 },\n            { nominal: 32, mass: 32.03972 },\n            { nominal: 33, mass: 33.04938 },\n            { nominal: 34, mass: 34.05673 },\n        ],\n        symbol: 'Ne',\n        mass: 20.18004638052026,\n        name: 'Neon',\n        monoisotopicMass: 19.9924401762,\n    },\n    {\n        number: 11,\n        isotopes: [\n            { nominal: 18, mass: 18.02688 },\n            { nominal: 19, mass: 19.01388 },\n            { nominal: 20, mass: 20.0073544 },\n            { nominal: 21, mass: 20.99765469 },\n            { nominal: 22, mass: 21.99443741 },\n            { nominal: 23, mass: 22.989769282, abundance: 1 },\n            { nominal: 24, mass: 23.99096295 },\n            { nominal: 25, mass: 24.989954 },\n            { nominal: 26, mass: 25.9926346 },\n            { nominal: 27, mass: 26.9940765 },\n            { nominal: 28, mass: 27.998939 },\n            { nominal: 29, mass: 29.0028771 },\n            { nominal: 30, mass: 30.0090979 },\n            { nominal: 31, mass: 31.013163 },\n            { nominal: 32, mass: 32.02019 },\n            { nominal: 33, mass: 33.02573 },\n            { nominal: 34, mass: 34.03359 },\n            { nominal: 35, mass: 35.04062 },\n            { nominal: 36, mass: 36.04929 },\n            { nominal: 37, mass: 37.05705 },\n        ],\n        symbol: 'Na',\n        mass: 22.989769282,\n        name: 'Sodium',\n        monoisotopicMass: 22.989769282,\n    },\n    {\n        number: 12,\n        isotopes: [\n            { nominal: 19, mass: 19.034169 },\n            { nominal: 20, mass: 20.01885 },\n            { nominal: 21, mass: 21.011716 },\n            { nominal: 22, mass: 21.99957065 },\n            { nominal: 23, mass: 22.99412421 },\n            { nominal: 24, mass: 23.985041697, abundance: 0.7899 },\n            { nominal: 25, mass: 24.985836976, abundance: 0.1 },\n            { nominal: 26, mass: 25.982592968, abundance: 0.1101 },\n            { nominal: 27, mass: 26.984340624 },\n            { nominal: 28, mass: 27.9838767 },\n            { nominal: 29, mass: 28.988617 },\n            { nominal: 30, mass: 29.9904629 },\n            { nominal: 31, mass: 30.996648 },\n            { nominal: 32, mass: 31.9991102 },\n            { nominal: 33, mass: 33.0053271 },\n            { nominal: 34, mass: 34.008935 },\n            { nominal: 35, mass: 35.01679 },\n            { nominal: 36, mass: 36.02188 },\n            { nominal: 37, mass: 37.03037 },\n            { nominal: 38, mass: 38.03658 },\n            { nominal: 39, mass: 39.04538 },\n            { nominal: 40, mass: 40.05218 },\n        ],\n        symbol: 'Mg',\n        mass: 24.3050516198371,\n        name: 'Magnesium',\n        monoisotopicMass: 23.985041697,\n    },\n    {\n        number: 13,\n        isotopes: [\n            { nominal: 21, mass: 21.02897 },\n            { nominal: 22, mass: 22.01954 },\n            { nominal: 23, mass: 23.00724435 },\n            { nominal: 24, mass: 23.9999489 },\n            { nominal: 25, mass: 24.9904281 },\n            { nominal: 26, mass: 25.986891904 },\n            { nominal: 27, mass: 26.98153853, abundance: 1 },\n            { nominal: 28, mass: 27.98191021 },\n            { nominal: 29, mass: 28.9804565 },\n            { nominal: 30, mass: 29.98296 },\n            { nominal: 31, mass: 30.983945 },\n            { nominal: 32, mass: 31.988085 },\n            { nominal: 33, mass: 32.990909 },\n            { nominal: 34, mass: 33.996705 },\n            { nominal: 35, mass: 34.999764 },\n            { nominal: 36, mass: 36.00639 },\n            { nominal: 37, mass: 37.01053 },\n            { nominal: 38, mass: 38.0174 },\n            { nominal: 39, mass: 39.02254 },\n            { nominal: 40, mass: 40.03003 },\n            { nominal: 41, mass: 41.03638 },\n            { nominal: 42, mass: 42.04384 },\n            { nominal: 43, mass: 43.05147 },\n        ],\n        symbol: 'Al',\n        mass: 26.98153853,\n        name: 'Aluminium',\n        monoisotopicMass: 26.98153853,\n    },\n    {\n        number: 14,\n        isotopes: [\n            { nominal: 22, mass: 22.03579 },\n            { nominal: 23, mass: 23.02544 },\n            { nominal: 24, mass: 24.011535 },\n            { nominal: 25, mass: 25.004109 },\n            { nominal: 26, mass: 25.99233384 },\n            { nominal: 27, mass: 26.98670481 },\n            { nominal: 28, mass: 27.97692653465, abundance: 0.92223 },\n            { nominal: 29, mass: 28.9764946649, abundance: 0.04685 },\n            { nominal: 30, mass: 29.973770136, abundance: 0.03092 },\n            { nominal: 31, mass: 30.975363194 },\n            { nominal: 32, mass: 31.97415154 },\n            { nominal: 33, mass: 32.97797696 },\n            { nominal: 34, mass: 33.978576 },\n            { nominal: 35, mass: 34.984583 },\n            { nominal: 36, mass: 35.986695 },\n            { nominal: 37, mass: 36.992921 },\n            { nominal: 38, mass: 37.995523 },\n            { nominal: 39, mass: 39.002491 },\n            { nominal: 40, mass: 40.00583 },\n            { nominal: 41, mass: 41.01301 },\n            { nominal: 42, mass: 42.01778 },\n            { nominal: 43, mass: 43.0248 },\n            { nominal: 44, mass: 44.03061 },\n            { nominal: 45, mass: 45.03995 },\n        ],\n        symbol: 'Si',\n        mass: 28.085498705705955,\n        name: 'Silicon',\n        monoisotopicMass: 27.97692653465,\n    },\n    {\n        number: 15,\n        isotopes: [\n            { nominal: 24, mass: 24.03577 },\n            { nominal: 25, mass: 25.02119 },\n            { nominal: 26, mass: 26.01178 },\n            { nominal: 27, mass: 26.999224 },\n            { nominal: 28, mass: 27.9923266 },\n            { nominal: 29, mass: 28.98180079 },\n            { nominal: 30, mass: 29.97831375 },\n            { nominal: 31, mass: 30.97376199842, abundance: 1 },\n            { nominal: 32, mass: 31.973907643 },\n            { nominal: 33, mass: 32.9717257 },\n            { nominal: 34, mass: 33.97364589 },\n            { nominal: 35, mass: 34.9733141 },\n            { nominal: 36, mass: 35.97826 },\n            { nominal: 37, mass: 36.979607 },\n            { nominal: 38, mass: 37.984252 },\n            { nominal: 39, mass: 38.986227 },\n            { nominal: 40, mass: 39.99133 },\n            { nominal: 41, mass: 40.994654 },\n            { nominal: 42, mass: 42.00108 },\n            { nominal: 43, mass: 43.00502 },\n            { nominal: 44, mass: 44.01121 },\n            { nominal: 45, mass: 45.01645 },\n            { nominal: 46, mass: 46.02446 },\n            { nominal: 47, mass: 47.03139 },\n        ],\n        symbol: 'P',\n        mass: 30.97376199842,\n        name: 'Phosphorus',\n        monoisotopicMass: 30.97376199842,\n    },\n    {\n        number: 16,\n        isotopes: [\n            { nominal: 26, mass: 26.02907 },\n            { nominal: 27, mass: 27.01828 },\n            { nominal: 28, mass: 28.00437 },\n            { nominal: 29, mass: 28.996611 },\n            { nominal: 30, mass: 29.98490703 },\n            { nominal: 31, mass: 30.97955701 },\n            { nominal: 32, mass: 31.9720711744, abundance: 0.9499 },\n            { nominal: 33, mass: 32.9714589098, abundance: 0.0075 },\n            { nominal: 34, mass: 33.967867004, abundance: 0.0425 },\n            { nominal: 35, mass: 34.96903231 },\n            { nominal: 36, mass: 35.96708071, abundance: 0.0001 },\n            { nominal: 37, mass: 36.97112551 },\n            { nominal: 38, mass: 37.9711633 },\n            { nominal: 39, mass: 38.975134 },\n            { nominal: 40, mass: 39.9754826 },\n            { nominal: 41, mass: 40.9795935 },\n            { nominal: 42, mass: 41.9810651 },\n            { nominal: 43, mass: 42.9869076 },\n            { nominal: 44, mass: 43.9901188 },\n            { nominal: 45, mass: 44.99572 },\n            { nominal: 46, mass: 46.00004 },\n            { nominal: 47, mass: 47.00795 },\n            { nominal: 48, mass: 48.0137 },\n            { nominal: 49, mass: 49.02276 },\n        ],\n        symbol: 'S',\n        mass: 32.06478740612706,\n        name: 'Sulfur',\n        monoisotopicMass: 31.9720711744,\n    },\n    {\n        number: 17,\n        isotopes: [\n            { nominal: 28, mass: 28.02954 },\n            { nominal: 29, mass: 29.01478 },\n            { nominal: 30, mass: 30.00477 },\n            { nominal: 31, mass: 30.992414 },\n            { nominal: 32, mass: 31.98568464 },\n            { nominal: 33, mass: 32.97745199 },\n            { nominal: 34, mass: 33.973762485 },\n            { nominal: 35, mass: 34.968852682, abundance: 0.7576 },\n            { nominal: 36, mass: 35.968306809 },\n            { nominal: 37, mass: 36.965902602, abundance: 0.2424 },\n            { nominal: 38, mass: 37.96801044 },\n            { nominal: 39, mass: 38.9680082 },\n            { nominal: 40, mass: 39.970415 },\n            { nominal: 41, mass: 40.970685 },\n            { nominal: 42, mass: 41.97325 },\n            { nominal: 43, mass: 42.97389 },\n            { nominal: 44, mass: 43.97787 },\n            { nominal: 45, mass: 44.98029 },\n            { nominal: 46, mass: 45.98517 },\n            { nominal: 47, mass: 46.98916 },\n            { nominal: 48, mass: 47.99564 },\n            { nominal: 49, mass: 49.00123 },\n            { nominal: 50, mass: 50.00905 },\n            { nominal: 51, mass: 51.01554 },\n        ],\n        symbol: 'Cl',\n        mass: 35.452937582608,\n        name: 'Chlorine',\n        monoisotopicMass: 34.968852682,\n    },\n    {\n        number: 18,\n        isotopes: [\n            { nominal: 30, mass: 30.02307 },\n            { nominal: 31, mass: 31.01212 },\n            { nominal: 32, mass: 31.9976378 },\n            { nominal: 33, mass: 32.98992555 },\n            { nominal: 34, mass: 33.98027009 },\n            { nominal: 35, mass: 34.97525759 },\n            { nominal: 36, mass: 35.967545105, abundance: 0.003336 },\n            { nominal: 37, mass: 36.96677633 },\n            { nominal: 38, mass: 37.96273211, abundance: 0.000629 },\n            { nominal: 39, mass: 38.964313 },\n            { nominal: 40, mass: 39.9623831237, abundance: 0.996035 },\n            { nominal: 41, mass: 40.96450057 },\n            { nominal: 42, mass: 41.9630457 },\n            { nominal: 43, mass: 42.9656361 },\n            { nominal: 44, mass: 43.9649238 },\n            { nominal: 45, mass: 44.96803973 },\n            { nominal: 46, mass: 45.968083 },\n            { nominal: 47, mass: 46.972935 },\n            { nominal: 48, mass: 47.97591 },\n            { nominal: 49, mass: 48.9819 },\n            { nominal: 50, mass: 49.98613 },\n            { nominal: 51, mass: 50.9937 },\n            { nominal: 52, mass: 51.99896 },\n            { nominal: 53, mass: 53.00729 },\n        ],\n        symbol: 'Ar',\n        mass: 39.947798563582005,\n        name: 'Argon',\n        monoisotopicMass: 39.9623831237,\n    },\n    {\n        number: 19,\n        isotopes: [\n            { nominal: 32, mass: 32.02265 },\n            { nominal: 33, mass: 33.00756 },\n            { nominal: 34, mass: 33.99869 },\n            { nominal: 35, mass: 34.98800541 },\n            { nominal: 36, mass: 35.98130201 },\n            { nominal: 37, mass: 36.97337589 },\n            { nominal: 38, mass: 37.96908112 },\n            { nominal: 39, mass: 38.9637064864, abundance: 0.932581 },\n            { nominal: 40, mass: 39.963998166, abundance: 0.000117 },\n            { nominal: 41, mass: 40.9618252579, abundance: 0.067302 },\n            { nominal: 42, mass: 41.96240231 },\n            { nominal: 43, mass: 42.9607347 },\n            { nominal: 44, mass: 43.96158699 },\n            { nominal: 45, mass: 44.96069149 },\n            { nominal: 46, mass: 45.96198159 },\n            { nominal: 47, mass: 46.9616616 },\n            { nominal: 48, mass: 47.96534119 },\n            { nominal: 49, mass: 48.96821075 },\n            { nominal: 50, mass: 49.97238 },\n            { nominal: 51, mass: 50.975828 },\n            { nominal: 52, mass: 51.98224 },\n            { nominal: 53, mass: 52.98746 },\n            { nominal: 54, mass: 53.99463 },\n            { nominal: 55, mass: 55.00076 },\n            { nominal: 56, mass: 56.00851 },\n        ],\n        symbol: 'K',\n        mass: 39.098300910086,\n        name: 'Potassium',\n        monoisotopicMass: 38.9637064864,\n    },\n    {\n        number: 20,\n        isotopes: [\n            { nominal: 34, mass: 34.01487 },\n            { nominal: 35, mass: 35.00514 },\n            { nominal: 36, mass: 35.993074 },\n            { nominal: 37, mass: 36.98589785 },\n            { nominal: 38, mass: 37.97631922 },\n            { nominal: 39, mass: 38.97071081 },\n            { nominal: 40, mass: 39.962590863, abundance: 0.96941 },\n            { nominal: 41, mass: 40.96227792 },\n            { nominal: 42, mass: 41.95861783, abundance: 0.00647 },\n            { nominal: 43, mass: 42.95876644, abundance: 0.00135 },\n            { nominal: 44, mass: 43.95548156, abundance: 0.02086 },\n            { nominal: 45, mass: 44.95618635 },\n            { nominal: 46, mass: 45.953689, abundance: 0.00004 },\n            { nominal: 47, mass: 46.9545424 },\n            { nominal: 48, mass: 47.95252276, abundance: 0.00187 },\n            { nominal: 49, mass: 48.95566274 },\n            { nominal: 50, mass: 49.9574992 },\n            { nominal: 51, mass: 50.960989 },\n            { nominal: 52, mass: 51.963217 },\n            { nominal: 53, mass: 52.96945 },\n            { nominal: 54, mass: 53.9734 },\n            { nominal: 55, mass: 54.9803 },\n            { nominal: 56, mass: 55.98508 },\n            { nominal: 57, mass: 56.99262 },\n            { nominal: 58, mass: 57.99794 },\n        ],\n        symbol: 'Ca',\n        mass: 40.078022511017735,\n        name: 'Calcium',\n        monoisotopicMass: 39.962590863,\n    },\n    {\n        number: 21,\n        isotopes: [\n            { nominal: 36, mass: 36.01648 },\n            { nominal: 37, mass: 37.00374 },\n            { nominal: 38, mass: 37.99512 },\n            { nominal: 39, mass: 38.984785 },\n            { nominal: 40, mass: 39.9779673 },\n            { nominal: 41, mass: 40.969251105 },\n            { nominal: 42, mass: 41.96551653 },\n            { nominal: 43, mass: 42.9611505 },\n            { nominal: 44, mass: 43.9594029 },\n            { nominal: 45, mass: 44.95590828, abundance: 1 },\n            { nominal: 46, mass: 45.95516826 },\n            { nominal: 47, mass: 46.9524037 },\n            { nominal: 48, mass: 47.9522236 },\n            { nominal: 49, mass: 48.9500146 },\n            { nominal: 50, mass: 49.952176 },\n            { nominal: 51, mass: 50.953592 },\n            { nominal: 52, mass: 51.95688 },\n            { nominal: 53, mass: 52.95909 },\n            { nominal: 54, mass: 53.96393 },\n            { nominal: 55, mass: 54.96782 },\n            { nominal: 56, mass: 55.97345 },\n            { nominal: 57, mass: 56.97777 },\n            { nominal: 58, mass: 57.98403 },\n            { nominal: 59, mass: 58.98894 },\n            { nominal: 60, mass: 59.99565 },\n            { nominal: 61, mass: 61.001 },\n        ],\n        symbol: 'Sc',\n        mass: 44.95590828,\n        name: 'Scandium',\n        monoisotopicMass: 44.95590828,\n    },\n    {\n        number: 22,\n        isotopes: [\n            { nominal: 38, mass: 38.01145 },\n            { nominal: 39, mass: 39.00236 },\n            { nominal: 40, mass: 39.9905 },\n            { nominal: 41, mass: 40.983148 },\n            { nominal: 42, mass: 41.97304903 },\n            { nominal: 43, mass: 42.9685225 },\n            { nominal: 44, mass: 43.95968995 },\n            { nominal: 45, mass: 44.95812198 },\n            { nominal: 46, mass: 45.95262772, abundance: 0.0825 },\n            { nominal: 47, mass: 46.95175879, abundance: 0.0744 },\n            { nominal: 48, mass: 47.94794198, abundance: 0.7372 },\n            { nominal: 49, mass: 48.94786568, abundance: 0.0541 },\n            { nominal: 50, mass: 49.94478689, abundance: 0.0518 },\n            { nominal: 51, mass: 50.94661065 },\n            { nominal: 52, mass: 51.946893 },\n            { nominal: 53, mass: 52.94973 },\n            { nominal: 54, mass: 53.95105 },\n            { nominal: 55, mass: 54.95527 },\n            { nominal: 56, mass: 55.95791 },\n            { nominal: 57, mass: 56.96364 },\n            { nominal: 58, mass: 57.9666 },\n            { nominal: 59, mass: 58.97247 },\n            { nominal: 60, mass: 59.97603 },\n            { nominal: 61, mass: 60.98245 },\n            { nominal: 62, mass: 61.98651 },\n            { nominal: 63, mass: 62.99375 },\n        ],\n        symbol: 'Ti',\n        mass: 47.866744962721995,\n        name: 'Titanium',\n        monoisotopicMass: 47.94794198,\n    },\n    {\n        number: 23,\n        isotopes: [\n            { nominal: 40, mass: 40.01276 },\n            { nominal: 41, mass: 41.00021 },\n            { nominal: 42, mass: 41.99182 },\n            { nominal: 43, mass: 42.980766 },\n            { nominal: 44, mass: 43.97411 },\n            { nominal: 45, mass: 44.9657748 },\n            { nominal: 46, mass: 45.96019878 },\n            { nominal: 47, mass: 46.95490491 },\n            { nominal: 48, mass: 47.9522522 },\n            { nominal: 49, mass: 48.9485118 },\n            { nominal: 50, mass: 49.94715601, abundance: 0.0025 },\n            { nominal: 51, mass: 50.94395704, abundance: 0.9975 },\n            { nominal: 52, mass: 51.94477301 },\n            { nominal: 53, mass: 52.9443367 },\n            { nominal: 54, mass: 53.946439 },\n            { nominal: 55, mass: 54.94724 },\n            { nominal: 56, mass: 55.95048 },\n            { nominal: 57, mass: 56.95252 },\n            { nominal: 58, mass: 57.95672 },\n            { nominal: 59, mass: 58.95939 },\n            { nominal: 60, mass: 59.96431 },\n            { nominal: 61, mass: 60.96725 },\n            { nominal: 62, mass: 61.97265 },\n            { nominal: 63, mass: 62.97639 },\n            { nominal: 64, mass: 63.98264 },\n            { nominal: 65, mass: 64.9875 },\n            { nominal: 66, mass: 65.99398 },\n        ],\n        symbol: 'V',\n        mass: 50.941465037425004,\n        name: 'Vanadium',\n        monoisotopicMass: 50.94395704,\n    },\n    {\n        number: 24,\n        isotopes: [\n            { nominal: 42, mass: 42.0067 },\n            { nominal: 43, mass: 42.99753 },\n            { nominal: 44, mass: 43.98536 },\n            { nominal: 45, mass: 44.97905 },\n            { nominal: 46, mass: 45.968359 },\n            { nominal: 47, mass: 46.9628974 },\n            { nominal: 48, mass: 47.9540291 },\n            { nominal: 49, mass: 48.9513333 },\n            { nominal: 50, mass: 49.94604183, abundance: 0.04345 },\n            { nominal: 51, mass: 50.94476502 },\n            { nominal: 52, mass: 51.94050623, abundance: 0.83789 },\n            { nominal: 53, mass: 52.94064815, abundance: 0.09501 },\n            { nominal: 54, mass: 53.93887916, abundance: 0.02365 },\n            { nominal: 55, mass: 54.94083843 },\n            { nominal: 56, mass: 55.9406531 },\n            { nominal: 57, mass: 56.943613 },\n            { nominal: 58, mass: 57.94435 },\n            { nominal: 59, mass: 58.94859 },\n            { nominal: 60, mass: 59.95008 },\n            { nominal: 61, mass: 60.95442 },\n            { nominal: 62, mass: 61.9561 },\n            { nominal: 63, mass: 62.96165 },\n            { nominal: 64, mass: 63.96408 },\n            { nominal: 65, mass: 64.96996 },\n            { nominal: 66, mass: 65.97366 },\n            { nominal: 67, mass: 66.98016 },\n            { nominal: 68, mass: 67.98403 },\n        ],\n        symbol: 'Cr',\n        mass: 51.9961317554337,\n        name: 'Chromium',\n        monoisotopicMass: 51.94050623,\n    },\n    {\n        number: 25,\n        isotopes: [\n            { nominal: 44, mass: 44.00715 },\n            { nominal: 45, mass: 44.99449 },\n            { nominal: 46, mass: 45.98609 },\n            { nominal: 47, mass: 46.975775 },\n            { nominal: 48, mass: 47.96852 },\n            { nominal: 49, mass: 48.959595 },\n            { nominal: 50, mass: 49.95423778 },\n            { nominal: 51, mass: 50.94820847 },\n            { nominal: 52, mass: 51.9455639 },\n            { nominal: 53, mass: 52.94128889 },\n            { nominal: 54, mass: 53.9403576 },\n            { nominal: 55, mass: 54.93804391, abundance: 1 },\n            { nominal: 56, mass: 55.93890369 },\n            { nominal: 57, mass: 56.9382861 },\n            { nominal: 58, mass: 57.9400666 },\n            { nominal: 59, mass: 58.9403911 },\n            { nominal: 60, mass: 59.9431366 },\n            { nominal: 61, mass: 60.9444525 },\n            { nominal: 62, mass: 61.94795 },\n            { nominal: 63, mass: 62.9496647 },\n            { nominal: 64, mass: 63.9538494 },\n            { nominal: 65, mass: 64.9560198 },\n            { nominal: 66, mass: 65.960547 },\n            { nominal: 67, mass: 66.96424 },\n            { nominal: 68, mass: 67.96962 },\n            { nominal: 69, mass: 68.97366 },\n            { nominal: 70, mass: 69.97937 },\n            { nominal: 71, mass: 70.98368 },\n        ],\n        symbol: 'Mn',\n        mass: 54.93804391,\n        name: 'Manganese',\n        monoisotopicMass: 54.93804391,\n    },\n    {\n        number: 26,\n        isotopes: [\n            { nominal: 45, mass: 45.01442 },\n            { nominal: 46, mass: 46.00063 },\n            { nominal: 47, mass: 46.99185 },\n            { nominal: 48, mass: 47.98023 },\n            { nominal: 49, mass: 48.973429 },\n            { nominal: 50, mass: 49.962975 },\n            { nominal: 51, mass: 50.956841 },\n            { nominal: 52, mass: 51.9481131 },\n            { nominal: 53, mass: 52.9453064 },\n            { nominal: 54, mass: 53.93960899, abundance: 0.05845 },\n            { nominal: 55, mass: 54.93829199 },\n            { nominal: 56, mass: 55.93493633, abundance: 0.91754 },\n            { nominal: 57, mass: 56.93539284, abundance: 0.02119 },\n            { nominal: 58, mass: 57.93327443, abundance: 0.00282 },\n            { nominal: 59, mass: 58.93487434 },\n            { nominal: 60, mass: 59.9340711 },\n            { nominal: 61, mass: 60.9367462 },\n            { nominal: 62, mass: 61.9367918 },\n            { nominal: 63, mass: 62.9402727 },\n            { nominal: 64, mass: 63.9409878 },\n            { nominal: 65, mass: 64.9450115 },\n            { nominal: 66, mass: 65.94625 },\n            { nominal: 67, mass: 66.95054 },\n            { nominal: 68, mass: 67.95295 },\n            { nominal: 69, mass: 68.95807 },\n            { nominal: 70, mass: 69.96102 },\n            { nominal: 71, mass: 70.96672 },\n            { nominal: 72, mass: 71.96983 },\n            { nominal: 73, mass: 72.97572 },\n            { nominal: 74, mass: 73.97935 },\n        ],\n        symbol: 'Fe',\n        mass: 55.845144433865904,\n        name: 'Iron',\n        monoisotopicMass: 55.93493633,\n    },\n    {\n        number: 27,\n        isotopes: [\n            { nominal: 47, mass: 47.01057 },\n            { nominal: 48, mass: 48.00093 },\n            { nominal: 49, mass: 48.98891 },\n            { nominal: 50, mass: 49.98091 },\n            { nominal: 51, mass: 50.970647 },\n            { nominal: 52, mass: 51.96351 },\n            { nominal: 53, mass: 52.9542041 },\n            { nominal: 54, mass: 53.94845987 },\n            { nominal: 55, mass: 54.9419972 },\n            { nominal: 56, mass: 55.9398388 },\n            { nominal: 57, mass: 56.93629057 },\n            { nominal: 58, mass: 57.9357521 },\n            { nominal: 59, mass: 58.93319429, abundance: 1 },\n            { nominal: 60, mass: 59.9338163 },\n            { nominal: 61, mass: 60.93247662 },\n            { nominal: 62, mass: 61.934059 },\n            { nominal: 63, mass: 62.9336 },\n            { nominal: 64, mass: 63.935811 },\n            { nominal: 65, mass: 64.9364621 },\n            { nominal: 66, mass: 65.939443 },\n            { nominal: 67, mass: 66.9406096 },\n            { nominal: 68, mass: 67.94426 },\n            { nominal: 69, mass: 68.94614 },\n            { nominal: 70, mass: 69.94963 },\n            { nominal: 71, mass: 70.95237 },\n            { nominal: 72, mass: 71.95729 },\n            { nominal: 73, mass: 72.96039 },\n            { nominal: 74, mass: 73.96515 },\n            { nominal: 75, mass: 74.96876 },\n            { nominal: 76, mass: 75.97413 },\n        ],\n        symbol: 'Co',\n        mass: 58.93319429,\n        name: 'Cobalt',\n        monoisotopicMass: 58.93319429,\n    },\n    {\n        number: 28,\n        isotopes: [\n            { nominal: 48, mass: 48.01769 },\n            { nominal: 49, mass: 49.0077 },\n            { nominal: 50, mass: 49.99474 },\n            { nominal: 51, mass: 50.98611 },\n            { nominal: 52, mass: 51.9748 },\n            { nominal: 53, mass: 52.96819 },\n            { nominal: 54, mass: 53.957892 },\n            { nominal: 55, mass: 54.95133063 },\n            { nominal: 56, mass: 55.94212855 },\n            { nominal: 57, mass: 56.93979218 },\n            { nominal: 58, mass: 57.93534241, abundance: 0.68077 },\n            { nominal: 59, mass: 58.9343462 },\n            { nominal: 60, mass: 59.93078588, abundance: 0.26223 },\n            { nominal: 61, mass: 60.93105557, abundance: 0.011399 },\n            { nominal: 62, mass: 61.92834537, abundance: 0.036346 },\n            { nominal: 63, mass: 62.92966963 },\n            { nominal: 64, mass: 63.92796682, abundance: 0.009255 },\n            { nominal: 65, mass: 64.93008517 },\n            { nominal: 66, mass: 65.9291393 },\n            { nominal: 67, mass: 66.9315694 },\n            { nominal: 68, mass: 67.9318688 },\n            { nominal: 69, mass: 68.9356103 },\n            { nominal: 70, mass: 69.9364313 },\n            { nominal: 71, mass: 70.940519 },\n            { nominal: 72, mass: 71.9417859 },\n            { nominal: 73, mass: 72.9462067 },\n            { nominal: 74, mass: 73.94798 },\n            { nominal: 75, mass: 74.9525 },\n            { nominal: 76, mass: 75.95533 },\n            { nominal: 77, mass: 76.96055 },\n            { nominal: 78, mass: 77.96336 },\n            { nominal: 79, mass: 78.97025 },\n        ],\n        symbol: 'Ni',\n        mass: 58.69334710994765,\n        name: 'Nickel',\n        monoisotopicMass: 57.93534241,\n    },\n    {\n        number: 29,\n        isotopes: [\n            { nominal: 52, mass: 51.99671 },\n            { nominal: 53, mass: 52.98459 },\n            { nominal: 54, mass: 53.97666 },\n            { nominal: 55, mass: 54.96604 },\n            { nominal: 56, mass: 55.95895 },\n            { nominal: 57, mass: 56.9492125 },\n            { nominal: 58, mass: 57.94453305 },\n            { nominal: 59, mass: 58.93949748 },\n            { nominal: 60, mass: 59.9373645 },\n            { nominal: 61, mass: 60.9334576 },\n            { nominal: 62, mass: 61.93259541 },\n            { nominal: 63, mass: 62.92959772, abundance: 0.6915 },\n            { nominal: 64, mass: 63.92976434 },\n            { nominal: 65, mass: 64.9277897, abundance: 0.3085 },\n            { nominal: 66, mass: 65.92886903 },\n            { nominal: 67, mass: 66.9277303 },\n            { nominal: 68, mass: 67.9296109 },\n            { nominal: 69, mass: 68.9294293 },\n            { nominal: 70, mass: 69.9323921 },\n            { nominal: 71, mass: 70.9326768 },\n            { nominal: 72, mass: 71.9358203 },\n            { nominal: 73, mass: 72.9366744 },\n            { nominal: 74, mass: 73.9398749 },\n            { nominal: 75, mass: 74.9415226 },\n            { nominal: 76, mass: 75.945275 },\n            { nominal: 77, mass: 76.94792 },\n            { nominal: 78, mass: 77.95223 },\n            { nominal: 79, mass: 78.95502 },\n            { nominal: 80, mass: 79.96089 },\n            { nominal: 81, mass: 80.96587 },\n            { nominal: 82, mass: 81.97244 },\n        ],\n        symbol: 'Cu',\n        mass: 63.54603994583,\n        name: 'Copper',\n        monoisotopicMass: 62.92959772,\n    },\n    {\n        number: 30,\n        isotopes: [\n            { nominal: 54, mass: 53.99204 },\n            { nominal: 55, mass: 54.98398 },\n            { nominal: 56, mass: 55.97254 },\n            { nominal: 57, mass: 56.96506 },\n            { nominal: 58, mass: 57.954591 },\n            { nominal: 59, mass: 58.94931266 },\n            { nominal: 60, mass: 59.9418421 },\n            { nominal: 61, mass: 60.939507 },\n            { nominal: 62, mass: 61.93433397 },\n            { nominal: 63, mass: 62.9332115 },\n            { nominal: 64, mass: 63.92914201, abundance: 0.4917 },\n            { nominal: 65, mass: 64.92924077 },\n            { nominal: 66, mass: 65.92603381, abundance: 0.2773 },\n            { nominal: 67, mass: 66.92712775, abundance: 0.0404 },\n            { nominal: 68, mass: 67.92484455, abundance: 0.1845 },\n            { nominal: 69, mass: 68.9265507 },\n            { nominal: 70, mass: 69.9253192, abundance: 0.0061 },\n            { nominal: 71, mass: 70.9277196 },\n            { nominal: 72, mass: 71.9268428 },\n            { nominal: 73, mass: 72.9295826 },\n            { nominal: 74, mass: 73.9294073 },\n            { nominal: 75, mass: 74.9328402 },\n            { nominal: 76, mass: 75.933115 },\n            { nominal: 77, mass: 76.9368872 },\n            { nominal: 78, mass: 77.9382892 },\n            { nominal: 79, mass: 78.9426381 },\n            { nominal: 80, mass: 79.9445529 },\n            { nominal: 81, mass: 80.9504026 },\n            { nominal: 82, mass: 81.95426 },\n            { nominal: 83, mass: 82.96056 },\n            { nominal: 84, mass: 83.96521 },\n            { nominal: 85, mass: 84.97226 },\n        ],\n        symbol: 'Zn',\n        mass: 65.37778252952499,\n        name: 'Zinc',\n        monoisotopicMass: 63.92914201,\n    },\n    {\n        number: 31,\n        isotopes: [\n            { nominal: 56, mass: 55.99536 },\n            { nominal: 57, mass: 56.9832 },\n            { nominal: 58, mass: 57.97478 },\n            { nominal: 59, mass: 58.96353 },\n            { nominal: 60, mass: 59.95729 },\n            { nominal: 61, mass: 60.949399 },\n            { nominal: 62, mass: 61.94419025 },\n            { nominal: 63, mass: 62.9392942 },\n            { nominal: 64, mass: 63.9368404 },\n            { nominal: 65, mass: 64.93273459 },\n            { nominal: 66, mass: 65.9315894 },\n            { nominal: 67, mass: 66.9282025 },\n            { nominal: 68, mass: 67.9279805 },\n            { nominal: 69, mass: 68.9255735, abundance: 0.60108 },\n            { nominal: 70, mass: 69.9260219 },\n            { nominal: 71, mass: 70.92470258, abundance: 0.39892 },\n            { nominal: 72, mass: 71.92636747 },\n            { nominal: 73, mass: 72.9251747 },\n            { nominal: 74, mass: 73.9269457 },\n            { nominal: 75, mass: 74.9265002 },\n            { nominal: 76, mass: 75.9288276 },\n            { nominal: 77, mass: 76.9291543 },\n            { nominal: 78, mass: 77.9316088 },\n            { nominal: 79, mass: 78.9328523 },\n            { nominal: 80, mass: 79.9364208 },\n            { nominal: 81, mass: 80.9381338 },\n            { nominal: 82, mass: 81.9431765 },\n            { nominal: 83, mass: 82.9471203 },\n            { nominal: 84, mass: 83.95246 },\n            { nominal: 85, mass: 84.95699 },\n            { nominal: 86, mass: 85.96301 },\n            { nominal: 87, mass: 86.96824 },\n        ],\n        symbol: 'Ga',\n        mass: 69.7230660725936,\n        name: 'Gallium',\n        monoisotopicMass: 68.9255735,\n    },\n    {\n        number: 32,\n        isotopes: [\n            { nominal: 58, mass: 57.99172 },\n            { nominal: 59, mass: 58.98249 },\n            { nominal: 60, mass: 59.97036 },\n            { nominal: 61, mass: 60.96379 },\n            { nominal: 62, mass: 61.95502 },\n            { nominal: 63, mass: 62.949628 },\n            { nominal: 64, mass: 63.9416899 },\n            { nominal: 65, mass: 64.9393681 },\n            { nominal: 66, mass: 65.9338621 },\n            { nominal: 67, mass: 66.9327339 },\n            { nominal: 68, mass: 67.9280953 },\n            { nominal: 69, mass: 68.9279645 },\n            { nominal: 70, mass: 69.92424875, abundance: 0.2057 },\n            { nominal: 71, mass: 70.92495233 },\n            { nominal: 72, mass: 71.922075826, abundance: 0.2745 },\n            { nominal: 73, mass: 72.923458956, abundance: 0.0775 },\n            { nominal: 74, mass: 73.921177761, abundance: 0.365 },\n            { nominal: 75, mass: 74.92285837 },\n            { nominal: 76, mass: 75.921402726, abundance: 0.0773 },\n            { nominal: 77, mass: 76.923549843 },\n            { nominal: 78, mass: 77.9228529 },\n            { nominal: 79, mass: 78.92536 },\n            { nominal: 80, mass: 79.9253508 },\n            { nominal: 81, mass: 80.9288329 },\n            { nominal: 82, mass: 81.929774 },\n            { nominal: 83, mass: 82.9345391 },\n            { nominal: 84, mass: 83.9375751 },\n            { nominal: 85, mass: 84.9429697 },\n            { nominal: 86, mass: 85.94658 },\n            { nominal: 87, mass: 86.95268 },\n            { nominal: 88, mass: 87.95691 },\n            { nominal: 89, mass: 88.96379 },\n            { nominal: 90, mass: 89.96863 },\n        ],\n        symbol: 'Ge',\n        mass: 72.6275501646868,\n        name: 'Germanium',\n        monoisotopicMass: 73.921177761,\n    },\n    {\n        number: 33,\n        isotopes: [\n            { nominal: 60, mass: 59.99388 },\n            { nominal: 61, mass: 60.98112 },\n            { nominal: 62, mass: 61.97361 },\n            { nominal: 63, mass: 62.9639 },\n            { nominal: 64, mass: 63.95743 },\n            { nominal: 65, mass: 64.949611 },\n            { nominal: 66, mass: 65.9441488 },\n            { nominal: 67, mass: 66.93925111 },\n            { nominal: 68, mass: 67.9367741 },\n            { nominal: 69, mass: 68.932246 },\n            { nominal: 70, mass: 69.930926 },\n            { nominal: 71, mass: 70.9271138 },\n            { nominal: 72, mass: 71.9267523 },\n            { nominal: 73, mass: 72.9238291 },\n            { nominal: 74, mass: 73.9239286 },\n            { nominal: 75, mass: 74.92159457, abundance: 1 },\n            { nominal: 76, mass: 75.92239202 },\n            { nominal: 77, mass: 76.9206476 },\n            { nominal: 78, mass: 77.921828 },\n            { nominal: 79, mass: 78.9209484 },\n            { nominal: 80, mass: 79.9224746 },\n            { nominal: 81, mass: 80.9221323 },\n            { nominal: 82, mass: 81.9247412 },\n            { nominal: 83, mass: 82.9252069 },\n            { nominal: 84, mass: 83.9293033 },\n            { nominal: 85, mass: 84.9321637 },\n            { nominal: 86, mass: 85.9367015 },\n            { nominal: 87, mass: 86.9402917 },\n            { nominal: 88, mass: 87.94555 },\n            { nominal: 89, mass: 88.94976 },\n            { nominal: 90, mass: 89.95563 },\n            { nominal: 91, mass: 90.96039 },\n            { nominal: 92, mass: 91.96674 },\n        ],\n        symbol: 'As',\n        mass: 74.92159457,\n        name: 'Arsenic',\n        monoisotopicMass: 74.92159457,\n    },\n    {\n        number: 34,\n        isotopes: [\n            { nominal: 64, mass: 63.97109 },\n            { nominal: 65, mass: 64.9644 },\n            { nominal: 66, mass: 65.95559 },\n            { nominal: 67, mass: 66.949994 },\n            { nominal: 68, mass: 67.94182524 },\n            { nominal: 69, mass: 68.9394148 },\n            { nominal: 70, mass: 69.9335155 },\n            { nominal: 71, mass: 70.9322094 },\n            { nominal: 72, mass: 71.9271405 },\n            { nominal: 73, mass: 72.9267549 },\n            { nominal: 74, mass: 73.922475934, abundance: 0.0089 },\n            { nominal: 75, mass: 74.92252287 },\n            { nominal: 76, mass: 75.919213704, abundance: 0.0937 },\n            { nominal: 77, mass: 76.919914154, abundance: 0.0763 },\n            { nominal: 78, mass: 77.91730928, abundance: 0.2377 },\n            { nominal: 79, mass: 78.91849929 },\n            { nominal: 80, mass: 79.9165218, abundance: 0.4961 },\n            { nominal: 81, mass: 80.917993 },\n            { nominal: 82, mass: 81.9166995, abundance: 0.0873 },\n            { nominal: 83, mass: 82.9191186 },\n            { nominal: 84, mass: 83.9184668 },\n            { nominal: 85, mass: 84.9222608 },\n            { nominal: 86, mass: 85.9243117 },\n            { nominal: 87, mass: 86.9286886 },\n            { nominal: 88, mass: 87.9314175 },\n            { nominal: 89, mass: 88.9366691 },\n            { nominal: 90, mass: 89.9401 },\n            { nominal: 91, mass: 90.94596 },\n            { nominal: 92, mass: 91.94984 },\n            { nominal: 93, mass: 92.95629 },\n            { nominal: 94, mass: 93.96049 },\n            { nominal: 95, mass: 94.9673 },\n        ],\n        symbol: 'Se',\n        mass: 78.95938855701361,\n        name: 'Selenium',\n        monoisotopicMass: 79.9165218,\n    },\n    {\n        number: 35,\n        isotopes: [\n            { nominal: 67, mass: 66.96465 },\n            { nominal: 68, mass: 67.95873 },\n            { nominal: 69, mass: 68.950497 },\n            { nominal: 70, mass: 69.944792 },\n            { nominal: 71, mass: 70.9393422 },\n            { nominal: 72, mass: 71.9365886 },\n            { nominal: 73, mass: 72.9316715 },\n            { nominal: 74, mass: 73.9299102 },\n            { nominal: 75, mass: 74.9258105 },\n            { nominal: 76, mass: 75.924542 },\n            { nominal: 77, mass: 76.9213792 },\n            { nominal: 78, mass: 77.9211459 },\n            { nominal: 79, mass: 78.9183376, abundance: 0.5069 },\n            { nominal: 80, mass: 79.9185298 },\n            { nominal: 81, mass: 80.9162897, abundance: 0.4931 },\n            { nominal: 82, mass: 81.9168032 },\n            { nominal: 83, mass: 82.9151756 },\n            { nominal: 84, mass: 83.916496 },\n            { nominal: 85, mass: 84.9156458 },\n            { nominal: 86, mass: 85.9188054 },\n            { nominal: 87, mass: 86.920674 },\n            { nominal: 88, mass: 87.9240833 },\n            { nominal: 89, mass: 88.9267046 },\n            { nominal: 90, mass: 89.9312928 },\n            { nominal: 91, mass: 90.9343986 },\n            { nominal: 92, mass: 91.9396316 },\n            { nominal: 93, mass: 92.94313 },\n            { nominal: 94, mass: 93.9489 },\n            { nominal: 95, mass: 94.95301 },\n            { nominal: 96, mass: 95.95903 },\n            { nominal: 97, mass: 96.96344 },\n            { nominal: 98, mass: 97.96946 },\n        ],\n        symbol: 'Br',\n        mass: 79.90352778050999,\n        name: 'Bromine',\n        monoisotopicMass: 78.9183376,\n    },\n    {\n        number: 36,\n        isotopes: [\n            { nominal: 69, mass: 68.96518 },\n            { nominal: 70, mass: 69.95604 },\n            { nominal: 71, mass: 70.95027 },\n            { nominal: 72, mass: 71.9420924 },\n            { nominal: 73, mass: 72.9392892 },\n            { nominal: 74, mass: 73.933084 },\n            { nominal: 75, mass: 74.9309457 },\n            { nominal: 76, mass: 75.9259103 },\n            { nominal: 77, mass: 76.92467 },\n            { nominal: 78, mass: 77.92036494, abundance: 0.00355 },\n            { nominal: 79, mass: 78.9200829 },\n            { nominal: 80, mass: 79.91637808, abundance: 0.02286 },\n            { nominal: 81, mass: 80.9165912 },\n            { nominal: 82, mass: 81.91348273, abundance: 0.11593 },\n            { nominal: 83, mass: 82.91412716, abundance: 0.115 },\n            { nominal: 84, mass: 83.9114977282, abundance: 0.56987 },\n            { nominal: 85, mass: 84.9125273 },\n            { nominal: 86, mass: 85.9106106269, abundance: 0.17279 },\n            { nominal: 87, mass: 86.91335476 },\n            { nominal: 88, mass: 87.9144479 },\n            { nominal: 89, mass: 88.9178355 },\n            { nominal: 90, mass: 89.9195279 },\n            { nominal: 91, mass: 90.9238063 },\n            { nominal: 92, mass: 91.9261731 },\n            { nominal: 93, mass: 92.9311472 },\n            { nominal: 94, mass: 93.93414 },\n            { nominal: 95, mass: 94.939711 },\n            { nominal: 96, mass: 95.943017 },\n            { nominal: 97, mass: 96.94909 },\n            { nominal: 98, mass: 97.95243 },\n            { nominal: 99, mass: 98.95839 },\n            { nominal: 100, mass: 99.96237 },\n            { nominal: 101, mass: 100.96873 },\n        ],\n        symbol: 'Kr',\n        mass: 83.7979999953261,\n        name: 'Krypton',\n        monoisotopicMass: 83.9114977282,\n    },\n    {\n        number: 37,\n        isotopes: [\n            { nominal: 71, mass: 70.96532 },\n            { nominal: 72, mass: 71.95908 },\n            { nominal: 73, mass: 72.95053 },\n            { nominal: 74, mass: 73.9442659 },\n            { nominal: 75, mass: 74.9385732 },\n            { nominal: 76, mass: 75.935073 },\n            { nominal: 77, mass: 76.9304016 },\n            { nominal: 78, mass: 77.9281419 },\n            { nominal: 79, mass: 78.9239899 },\n            { nominal: 80, mass: 79.9225164 },\n            { nominal: 81, mass: 80.9189939 },\n            { nominal: 82, mass: 81.918209 },\n            { nominal: 83, mass: 82.9151142 },\n            { nominal: 84, mass: 83.9143752 },\n            { nominal: 85, mass: 84.9117897379, abundance: 0.7217 },\n            { nominal: 86, mass: 85.91116743 },\n            { nominal: 87, mass: 86.909180531, abundance: 0.2783 },\n            { nominal: 88, mass: 87.91131559 },\n            { nominal: 89, mass: 88.9122783 },\n            { nominal: 90, mass: 89.9147985 },\n            { nominal: 91, mass: 90.9165372 },\n            { nominal: 92, mass: 91.9197284 },\n            { nominal: 93, mass: 92.9220393 },\n            { nominal: 94, mass: 93.9263948 },\n            { nominal: 95, mass: 94.92926 },\n            { nominal: 96, mass: 95.9341334 },\n            { nominal: 97, mass: 96.9371771 },\n            { nominal: 98, mass: 97.9416869 },\n            { nominal: 99, mass: 98.94503 },\n            { nominal: 100, mass: 99.95003 },\n            { nominal: 101, mass: 100.95404 },\n            { nominal: 102, mass: 101.95952 },\n            { nominal: 103, mass: 102.96392 },\n        ],\n        symbol: 'Rb',\n        mass: 85.46766359561973,\n        name: 'Rubidium',\n        monoisotopicMass: 84.9117897379,\n    },\n    {\n        number: 38,\n        isotopes: [\n            { nominal: 73, mass: 72.9657 },\n            { nominal: 74, mass: 73.95617 },\n            { nominal: 75, mass: 74.94995 },\n            { nominal: 76, mass: 75.941763 },\n            { nominal: 77, mass: 76.9379455 },\n            { nominal: 78, mass: 77.93218 },\n            { nominal: 79, mass: 78.9297077 },\n            { nominal: 80, mass: 79.9245175 },\n            { nominal: 81, mass: 80.9232114 },\n            { nominal: 82, mass: 81.9183999 },\n            { nominal: 83, mass: 82.9175544 },\n            { nominal: 84, mass: 83.9134191, abundance: 0.0056 },\n            { nominal: 85, mass: 84.912932 },\n            { nominal: 86, mass: 85.9092606, abundance: 0.0986 },\n            { nominal: 87, mass: 86.9088775, abundance: 0.07 },\n            { nominal: 88, mass: 87.9056125, abundance: 0.8258 },\n            { nominal: 89, mass: 88.9074511 },\n            { nominal: 90, mass: 89.90773 },\n            { nominal: 91, mass: 90.9101954 },\n            { nominal: 92, mass: 91.9110382 },\n            { nominal: 93, mass: 92.9140242 },\n            { nominal: 94, mass: 93.9153556 },\n            { nominal: 95, mass: 94.9193529 },\n            { nominal: 96, mass: 95.9217066 },\n            { nominal: 97, mass: 96.926374 },\n            { nominal: 98, mass: 97.9286888 },\n            { nominal: 99, mass: 98.9328907 },\n            { nominal: 100, mass: 99.93577 },\n            { nominal: 101, mass: 100.940352 },\n            { nominal: 102, mass: 101.943791 },\n            { nominal: 103, mass: 102.94909 },\n            { nominal: 104, mass: 103.95265 },\n            { nominal: 105, mass: 104.95855 },\n            { nominal: 106, mass: 105.96265 },\n            { nominal: 107, mass: 106.96897 },\n        ],\n        symbol: 'Sr',\n        mass: 87.61664446962,\n        name: 'Strontium',\n        monoisotopicMass: 87.9056125,\n    },\n    {\n        number: 39,\n        isotopes: [\n            { nominal: 76, mass: 75.95856 },\n            { nominal: 77, mass: 76.949781 },\n            { nominal: 78, mass: 77.94361 },\n            { nominal: 79, mass: 78.93735 },\n            { nominal: 80, mass: 79.9343561 },\n            { nominal: 81, mass: 80.9294556 },\n            { nominal: 82, mass: 81.9269314 },\n            { nominal: 83, mass: 82.922485 },\n            { nominal: 84, mass: 83.9206721 },\n            { nominal: 85, mass: 84.916433 },\n            { nominal: 86, mass: 85.914886 },\n            { nominal: 87, mass: 86.9108761 },\n            { nominal: 88, mass: 87.9095016 },\n            { nominal: 89, mass: 88.9058403, abundance: 1 },\n            { nominal: 90, mass: 89.9071439 },\n            { nominal: 91, mass: 90.9072974 },\n            { nominal: 92, mass: 91.9089451 },\n            { nominal: 93, mass: 92.909578 },\n            { nominal: 94, mass: 93.9115906 },\n            { nominal: 95, mass: 94.9128161 },\n            { nominal: 96, mass: 95.9158968 },\n            { nominal: 97, mass: 96.9182741 },\n            { nominal: 98, mass: 97.9223821 },\n            { nominal: 99, mass: 98.924148 },\n            { nominal: 100, mass: 99.927715 },\n            { nominal: 101, mass: 100.9301477 },\n            { nominal: 102, mass: 101.9343277 },\n            { nominal: 103, mass: 102.937243 },\n            { nominal: 104, mass: 103.94196 },\n            { nominal: 105, mass: 104.94544 },\n            { nominal: 106, mass: 105.95056 },\n            { nominal: 107, mass: 106.95452 },\n            { nominal: 108, mass: 107.95996 },\n            { nominal: 109, mass: 108.96436 },\n        ],\n        symbol: 'Y',\n        mass: 88.9058403,\n        name: 'Yttrium',\n        monoisotopicMass: 88.9058403,\n    },\n    {\n        number: 40,\n        isotopes: [\n            { nominal: 78, mass: 77.95566 },\n            { nominal: 79, mass: 78.94948 },\n            { nominal: 80, mass: 79.9404 },\n            { nominal: 81, mass: 80.93731 },\n            { nominal: 82, mass: 81.93135 },\n            { nominal: 83, mass: 82.9292421 },\n            { nominal: 84, mass: 83.9233269 },\n            { nominal: 85, mass: 84.9214444 },\n            { nominal: 86, mass: 85.9162972 },\n            { nominal: 87, mass: 86.914818 },\n            { nominal: 88, mass: 87.9102213 },\n            { nominal: 89, mass: 88.9088814 },\n            { nominal: 90, mass: 89.9046977, abundance: 0.5145 },\n            { nominal: 91, mass: 90.9056396, abundance: 0.1122 },\n            { nominal: 92, mass: 91.9050347, abundance: 0.1715 },\n            { nominal: 93, mass: 92.9064699 },\n            { nominal: 94, mass: 93.9063108, abundance: 0.1738 },\n            { nominal: 95, mass: 94.9080385 },\n            { nominal: 96, mass: 95.9082714, abundance: 0.028 },\n            { nominal: 97, mass: 96.9109512 },\n            { nominal: 98, mass: 97.9127289 },\n            { nominal: 99, mass: 98.916667 },\n            { nominal: 100, mass: 99.9180006 },\n            { nominal: 101, mass: 100.921448 },\n            { nominal: 102, mass: 101.9231409 },\n            { nominal: 103, mass: 102.927191 },\n            { nominal: 104, mass: 103.929436 },\n            { nominal: 105, mass: 104.934008 },\n            { nominal: 106, mass: 105.93676 },\n            { nominal: 107, mass: 106.94174 },\n            { nominal: 108, mass: 107.94487 },\n            { nominal: 109, mass: 108.95041 },\n            { nominal: 110, mass: 109.95396 },\n            { nominal: 111, mass: 110.95968 },\n            { nominal: 112, mass: 111.9637 },\n        ],\n        symbol: 'Zr',\n        mass: 91.22364159706,\n        name: 'Zirconium',\n        monoisotopicMass: 89.9046977,\n    },\n    {\n        number: 41,\n        isotopes: [\n            { nominal: 81, mass: 80.9496 },\n            { nominal: 82, mass: 81.94396 },\n            { nominal: 83, mass: 82.93729 },\n            { nominal: 84, mass: 83.93449 },\n            { nominal: 85, mass: 84.9288458 },\n            { nominal: 86, mass: 85.9257828 },\n            { nominal: 87, mass: 86.9206937 },\n            { nominal: 88, mass: 87.918222 },\n            { nominal: 89, mass: 88.913445 },\n            { nominal: 90, mass: 89.9112584 },\n            { nominal: 91, mass: 90.9069897 },\n            { nominal: 92, mass: 91.9071881 },\n            { nominal: 93, mass: 92.906373, abundance: 1 },\n            { nominal: 94, mass: 93.9072788 },\n            { nominal: 95, mass: 94.9068324 },\n            { nominal: 96, mass: 95.9080973 },\n            { nominal: 97, mass: 96.9080959 },\n            { nominal: 98, mass: 97.9103265 },\n            { nominal: 99, mass: 98.911613 },\n            { nominal: 100, mass: 99.9143276 },\n            { nominal: 101, mass: 100.9153103 },\n            { nominal: 102, mass: 101.9180772 },\n            { nominal: 103, mass: 102.9194572 },\n            { nominal: 104, mass: 103.9228925 },\n            { nominal: 105, mass: 104.9249465 },\n            { nominal: 106, mass: 105.9289317 },\n            { nominal: 107, mass: 106.9315937 },\n            { nominal: 108, mass: 107.9360748 },\n            { nominal: 109, mass: 108.93922 },\n            { nominal: 110, mass: 109.94403 },\n            { nominal: 111, mass: 110.94753 },\n            { nominal: 112, mass: 111.95247 },\n            { nominal: 113, mass: 112.95651 },\n            { nominal: 114, mass: 113.96201 },\n            { nominal: 115, mass: 114.96634 },\n        ],\n        symbol: 'Nb',\n        mass: 92.906373,\n        name: 'Niobium',\n        monoisotopicMass: 92.906373,\n    },\n    {\n        number: 42,\n        isotopes: [\n            { nominal: 83, mass: 82.94988 },\n            { nominal: 84, mass: 83.94149 },\n            { nominal: 85, mass: 84.938261 },\n            { nominal: 86, mass: 85.9311748 },\n            { nominal: 87, mass: 86.9281962 },\n            { nominal: 88, mass: 87.9219678 },\n            { nominal: 89, mass: 88.9194682 },\n            { nominal: 90, mass: 89.9139309 },\n            { nominal: 91, mass: 90.9117453 },\n            { nominal: 92, mass: 91.90680796, abundance: 0.1453 },\n            { nominal: 93, mass: 92.90680958 },\n            { nominal: 94, mass: 93.9050849, abundance: 0.0915 },\n            { nominal: 95, mass: 94.90583877, abundance: 0.1584 },\n            { nominal: 96, mass: 95.90467612, abundance: 0.1667 },\n            { nominal: 97, mass: 96.90601812, abundance: 0.096 },\n            { nominal: 98, mass: 97.90540482, abundance: 0.2439 },\n            { nominal: 99, mass: 98.90770851 },\n            { nominal: 100, mass: 99.9074718, abundance: 0.0982 },\n            { nominal: 101, mass: 100.9103414 },\n            { nominal: 102, mass: 101.9102834 },\n            { nominal: 103, mass: 102.913079 },\n            { nominal: 104, mass: 103.9137344 },\n            { nominal: 105, mass: 104.916969 },\n            { nominal: 106, mass: 105.918259 },\n            { nominal: 107, mass: 106.922106 },\n            { nominal: 108, mass: 107.924033 },\n            { nominal: 109, mass: 108.928424 },\n            { nominal: 110, mass: 109.930704 },\n            { nominal: 111, mass: 110.935654 },\n            { nominal: 112, mass: 111.93831 },\n            { nominal: 113, mass: 112.94335 },\n            { nominal: 114, mass: 113.94653 },\n            { nominal: 115, mass: 114.95196 },\n            { nominal: 116, mass: 115.95545 },\n            { nominal: 117, mass: 116.96117 },\n        ],\n        symbol: 'Mo',\n        mass: 95.959788541188,\n        name: 'Molybdenum',\n        monoisotopicMass: 97.90540482,\n    },\n    {\n        number: 43,\n        isotopes: [\n            { nominal: 85, mass: 84.95058 },\n            { nominal: 86, mass: 85.94493 },\n            { nominal: 87, mass: 86.9380672 },\n            { nominal: 88, mass: 87.93378 },\n            { nominal: 89, mass: 88.9276487 },\n            { nominal: 90, mass: 89.9240739 },\n            { nominal: 91, mass: 90.9184254 },\n            { nominal: 92, mass: 91.9152698 },\n            { nominal: 93, mass: 92.910246 },\n            { nominal: 94, mass: 93.9096536 },\n            { nominal: 95, mass: 94.9076536 },\n            { nominal: 96, mass: 95.907868 },\n            { nominal: 97, mass: 96.9063667 },\n            { nominal: 98, mass: 97.9072124 },\n            { nominal: 99, mass: 98.9062508 },\n            { nominal: 100, mass: 99.9076539 },\n            { nominal: 101, mass: 100.907309 },\n            { nominal: 102, mass: 101.9092097 },\n            { nominal: 103, mass: 102.909176 },\n            { nominal: 104, mass: 103.911425 },\n            { nominal: 105, mass: 104.911655 },\n            { nominal: 106, mass: 105.914358 },\n            { nominal: 107, mass: 106.9154606 },\n            { nominal: 108, mass: 107.9184957 },\n            { nominal: 109, mass: 108.920256 },\n            { nominal: 110, mass: 109.923744 },\n            { nominal: 111, mass: 110.925901 },\n            { nominal: 112, mass: 111.9299458 },\n            { nominal: 113, mass: 112.932569 },\n            { nominal: 114, mass: 113.93691 },\n            { nominal: 115, mass: 114.93998 },\n            { nominal: 116, mass: 115.94476 },\n            { nominal: 117, mass: 116.94806 },\n            { nominal: 118, mass: 117.95299 },\n            { nominal: 119, mass: 118.95666 },\n            { nominal: 120, mass: 119.96187 },\n        ],\n        symbol: 'Tc',\n        mass: null,\n        name: 'Technetium',\n    },\n    {\n        number: 44,\n        isotopes: [\n            { nominal: 87, mass: 86.95069 },\n            { nominal: 88, mass: 87.9416 },\n            { nominal: 89, mass: 88.93762 },\n            { nominal: 90, mass: 89.9303444 },\n            { nominal: 91, mass: 90.9267419 },\n            { nominal: 92, mass: 91.9202344 },\n            { nominal: 93, mass: 92.9171044 },\n            { nominal: 94, mass: 93.9113429 },\n            { nominal: 95, mass: 94.910406 },\n            { nominal: 96, mass: 95.90759025, abundance: 0.0554 },\n            { nominal: 97, mass: 96.9075471 },\n            { nominal: 98, mass: 97.9052868, abundance: 0.0187 },\n            { nominal: 99, mass: 98.9059341, abundance: 0.1276 },\n            { nominal: 100, mass: 99.9042143, abundance: 0.126 },\n            { nominal: 101, mass: 100.9055769, abundance: 0.1706 },\n            { nominal: 102, mass: 101.9043441, abundance: 0.3155 },\n            { nominal: 103, mass: 102.9063186 },\n            { nominal: 104, mass: 103.9054275, abundance: 0.1862 },\n            { nominal: 105, mass: 104.9077476 },\n            { nominal: 106, mass: 105.9073291 },\n            { nominal: 107, mass: 106.909972 },\n            { nominal: 108, mass: 107.910188 },\n            { nominal: 109, mass: 108.913326 },\n            { nominal: 110, mass: 109.9140407 },\n            { nominal: 111, mass: 110.91757 },\n            { nominal: 112, mass: 111.918809 },\n            { nominal: 113, mass: 112.922844 },\n            { nominal: 114, mass: 113.9246136 },\n            { nominal: 115, mass: 114.92882 },\n            { nominal: 116, mass: 115.9312192 },\n            { nominal: 117, mass: 116.9361 },\n            { nominal: 118, mass: 117.93853 },\n            { nominal: 119, mass: 118.94357 },\n            { nominal: 120, mass: 119.94631 },\n            { nominal: 121, mass: 120.95164 },\n            { nominal: 122, mass: 121.95447 },\n            { nominal: 123, mass: 122.95989 },\n            { nominal: 124, mass: 123.96305 },\n        ],\n        symbol: 'Ru',\n        mass: 101.06494013916,\n        name: 'Ruthenium',\n        monoisotopicMass: 101.9043441,\n    },\n    {\n        number: 45,\n        isotopes: [\n            { nominal: 89, mass: 88.95058 },\n            { nominal: 90, mass: 89.94422 },\n            { nominal: 91, mass: 90.93688 },\n            { nominal: 92, mass: 91.9323677 },\n            { nominal: 93, mass: 92.9259128 },\n            { nominal: 94, mass: 93.9217305 },\n            { nominal: 95, mass: 94.9158979 },\n            { nominal: 96, mass: 95.914453 },\n            { nominal: 97, mass: 96.911329 },\n            { nominal: 98, mass: 97.910708 },\n            { nominal: 99, mass: 98.9081282 },\n            { nominal: 100, mass: 99.908117 },\n            { nominal: 101, mass: 100.9061606 },\n            { nominal: 102, mass: 101.9068374 },\n            { nominal: 103, mass: 102.905498, abundance: 1 },\n            { nominal: 104, mass: 103.9066492 },\n            { nominal: 105, mass: 104.9056885 },\n            { nominal: 106, mass: 105.9072868 },\n            { nominal: 107, mass: 106.906748 },\n            { nominal: 108, mass: 107.908714 },\n            { nominal: 109, mass: 108.9087488 },\n            { nominal: 110, mass: 109.911079 },\n            { nominal: 111, mass: 110.9116423 },\n            { nominal: 112, mass: 111.914403 },\n            { nominal: 113, mass: 112.9154393 },\n            { nominal: 114, mass: 113.918718 },\n            { nominal: 115, mass: 114.9203116 },\n            { nominal: 116, mass: 115.924059 },\n            { nominal: 117, mass: 116.9260354 },\n            { nominal: 118, mass: 117.93034 },\n            { nominal: 119, mass: 118.932557 },\n            { nominal: 120, mass: 119.93686 },\n            { nominal: 121, mass: 120.93942 },\n            { nominal: 122, mass: 121.94399 },\n            { nominal: 123, mass: 122.94685 },\n            { nominal: 124, mass: 123.95151 },\n            { nominal: 125, mass: 124.95469 },\n            { nominal: 126, mass: 125.95946 },\n        ],\n        symbol: 'Rh',\n        mass: 102.905498,\n        name: 'Rhodium',\n        monoisotopicMass: 102.905498,\n    },\n    {\n        number: 46,\n        isotopes: [\n            { nominal: 91, mass: 90.95032 },\n            { nominal: 92, mass: 91.94088 },\n            { nominal: 93, mass: 92.93651 },\n            { nominal: 94, mass: 93.9290376 },\n            { nominal: 95, mass: 94.9248898 },\n            { nominal: 96, mass: 95.9182151 },\n            { nominal: 97, mass: 96.916472 },\n            { nominal: 98, mass: 97.9126983 },\n            { nominal: 99, mass: 98.9117748 },\n            { nominal: 100, mass: 99.908505 },\n            { nominal: 101, mass: 100.9082864 },\n            { nominal: 102, mass: 101.9056022, abundance: 0.0102 },\n            { nominal: 103, mass: 102.9060809 },\n            { nominal: 104, mass: 103.9040305, abundance: 0.1114 },\n            { nominal: 105, mass: 104.9050796, abundance: 0.2233 },\n            { nominal: 106, mass: 105.9034804, abundance: 0.2733 },\n            { nominal: 107, mass: 106.9051282 },\n            { nominal: 108, mass: 107.9038916, abundance: 0.2646 },\n            { nominal: 109, mass: 108.9059504 },\n            { nominal: 110, mass: 109.9051722, abundance: 0.1172 },\n            { nominal: 111, mass: 110.90768968 },\n            { nominal: 112, mass: 111.9073297 },\n            { nominal: 113, mass: 112.910261 },\n            { nominal: 114, mass: 113.9103686 },\n            { nominal: 115, mass: 114.913659 },\n            { nominal: 116, mass: 115.914297 },\n            { nominal: 117, mass: 116.9179547 },\n            { nominal: 118, mass: 117.9190667 },\n            { nominal: 119, mass: 118.9233402 },\n            { nominal: 120, mass: 119.9245511 },\n            { nominal: 121, mass: 120.9289503 },\n            { nominal: 122, mass: 121.930632 },\n            { nominal: 123, mass: 122.93514 },\n            { nominal: 124, mass: 123.93714 },\n            { nominal: 125, mass: 124.94179 },\n            { nominal: 126, mass: 125.94416 },\n            { nominal: 127, mass: 126.94907 },\n            { nominal: 128, mass: 127.95183 },\n        ],\n        symbol: 'Pd',\n        mass: 106.41532750734,\n        name: 'Palladium',\n        monoisotopicMass: 105.9034804,\n    },\n    {\n        number: 47,\n        isotopes: [\n            { nominal: 93, mass: 92.95033 },\n            { nominal: 94, mass: 93.94373 },\n            { nominal: 95, mass: 94.93602 },\n            { nominal: 96, mass: 95.930744 },\n            { nominal: 97, mass: 96.92397 },\n            { nominal: 98, mass: 97.92156 },\n            { nominal: 99, mass: 98.9176458 },\n            { nominal: 100, mass: 99.9161154 },\n            { nominal: 101, mass: 100.912684 },\n            { nominal: 102, mass: 101.9117047 },\n            { nominal: 103, mass: 102.9089631 },\n            { nominal: 104, mass: 103.9086239 },\n            { nominal: 105, mass: 104.9065256 },\n            { nominal: 106, mass: 105.9066636 },\n            { nominal: 107, mass: 106.9050916, abundance: 0.51839 },\n            { nominal: 108, mass: 107.9059503 },\n            { nominal: 109, mass: 108.9047553, abundance: 0.48161 },\n            { nominal: 110, mass: 109.9061102 },\n            { nominal: 111, mass: 110.9052959 },\n            { nominal: 112, mass: 111.9070486 },\n            { nominal: 113, mass: 112.906573 },\n            { nominal: 114, mass: 113.908823 },\n            { nominal: 115, mass: 114.908767 },\n            { nominal: 116, mass: 115.9113868 },\n            { nominal: 117, mass: 116.911774 },\n            { nominal: 118, mass: 117.9145955 },\n            { nominal: 119, mass: 118.91557 },\n            { nominal: 120, mass: 119.9187848 },\n            { nominal: 121, mass: 120.920125 },\n            { nominal: 122, mass: 121.923664 },\n            { nominal: 123, mass: 122.925337 },\n            { nominal: 124, mass: 123.92893 },\n            { nominal: 125, mass: 124.93105 },\n            { nominal: 126, mass: 125.93475 },\n            { nominal: 127, mass: 126.93711 },\n            { nominal: 128, mass: 127.94106 },\n            { nominal: 129, mass: 128.94395 },\n            { nominal: 130, mass: 129.9507 },\n        ],\n        symbol: 'Ag',\n        mass: 107.868149634557,\n        name: 'Silver',\n        monoisotopicMass: 106.9050916,\n    },\n    {\n        number: 48,\n        isotopes: [\n            { nominal: 95, mass: 94.94994 },\n            { nominal: 96, mass: 95.94034 },\n            { nominal: 97, mass: 96.9351 },\n            { nominal: 98, mass: 97.927389 },\n            { nominal: 99, mass: 98.9249258 },\n            { nominal: 100, mass: 99.9203488 },\n            { nominal: 101, mass: 100.9185862 },\n            { nominal: 102, mass: 101.914482 },\n            { nominal: 103, mass: 102.9134165 },\n            { nominal: 104, mass: 103.9098564 },\n            { nominal: 105, mass: 104.9094639 },\n            { nominal: 106, mass: 105.9064599, abundance: 0.0125 },\n            { nominal: 107, mass: 106.9066121 },\n            { nominal: 108, mass: 107.9041834, abundance: 0.0089 },\n            { nominal: 109, mass: 108.9049867 },\n            { nominal: 110, mass: 109.90300661, abundance: 0.1249 },\n            { nominal: 111, mass: 110.90418287, abundance: 0.128 },\n            { nominal: 112, mass: 111.90276287, abundance: 0.2413 },\n            { nominal: 113, mass: 112.90440813, abundance: 0.1222 },\n            { nominal: 114, mass: 113.90336509, abundance: 0.2873 },\n            { nominal: 115, mass: 114.90543751 },\n            { nominal: 116, mass: 115.90476315, abundance: 0.0749 },\n            { nominal: 117, mass: 116.907226 },\n            { nominal: 118, mass: 117.906922 },\n            { nominal: 119, mass: 118.909847 },\n            { nominal: 120, mass: 119.9098681 },\n            { nominal: 121, mass: 120.9129637 },\n            { nominal: 122, mass: 121.9134591 },\n            { nominal: 123, mass: 122.9168925 },\n            { nominal: 124, mass: 123.9176574 },\n            { nominal: 125, mass: 124.9212576 },\n            { nominal: 126, mass: 125.9224291 },\n            { nominal: 127, mass: 126.926472 },\n            { nominal: 128, mass: 127.9278129 },\n            { nominal: 129, mass: 128.93182 },\n            { nominal: 130, mass: 129.93394 },\n            { nominal: 131, mass: 130.9406 },\n            { nominal: 132, mass: 131.94604 },\n            { nominal: 133, mass: 132.95285 },\n        ],\n        symbol: 'Cd',\n        mass: 112.411557818268,\n        name: 'Cadmium',\n        monoisotopicMass: 113.90336509,\n    },\n    {\n        number: 49,\n        isotopes: [\n            { nominal: 97, mass: 96.94934 },\n            { nominal: 98, mass: 97.94214 },\n            { nominal: 99, mass: 98.93411 },\n            { nominal: 100, mass: 99.93096 },\n            { nominal: 101, mass: 100.92634 },\n            { nominal: 102, mass: 101.9241071 },\n            { nominal: 103, mass: 102.9198819 },\n            { nominal: 104, mass: 103.9182145 },\n            { nominal: 105, mass: 104.914502 },\n            { nominal: 106, mass: 105.913464 },\n            { nominal: 107, mass: 106.91029 },\n            { nominal: 108, mass: 107.9096935 },\n            { nominal: 109, mass: 108.9071514 },\n            { nominal: 110, mass: 109.90717 },\n            { nominal: 111, mass: 110.9051085 },\n            { nominal: 112, mass: 111.9055377 },\n            { nominal: 113, mass: 112.90406184, abundance: 0.0429 },\n            { nominal: 114, mass: 113.90491791 },\n            { nominal: 115, mass: 114.903878776, abundance: 0.9571 },\n            { nominal: 116, mass: 115.90525999 },\n            { nominal: 117, mass: 116.9045157 },\n            { nominal: 118, mass: 117.9063566 },\n            { nominal: 119, mass: 118.9058507 },\n            { nominal: 120, mass: 119.907967 },\n            { nominal: 121, mass: 120.907851 },\n            { nominal: 122, mass: 121.910281 },\n            { nominal: 123, mass: 122.910434 },\n            { nominal: 124, mass: 123.913182 },\n            { nominal: 125, mass: 124.913605 },\n            { nominal: 126, mass: 125.916507 },\n            { nominal: 127, mass: 126.917446 },\n            { nominal: 128, mass: 127.9204 },\n            { nominal: 129, mass: 128.9218053 },\n            { nominal: 130, mass: 129.924977 },\n            { nominal: 131, mass: 130.9269715 },\n            { nominal: 132, mass: 131.933001 },\n            { nominal: 133, mass: 132.93831 },\n            { nominal: 134, mass: 133.94454 },\n            { nominal: 135, mass: 134.95005 },\n        ],\n        symbol: 'In',\n        mass: 114.81808662944559,\n        name: 'Indium',\n        monoisotopicMass: 114.903878776,\n    },\n    {\n        number: 50,\n        isotopes: [\n            { nominal: 99, mass: 98.94853 },\n            { nominal: 100, mass: 99.9385 },\n            { nominal: 101, mass: 100.93526 },\n            { nominal: 102, mass: 101.93029 },\n            { nominal: 103, mass: 102.928105 },\n            { nominal: 104, mass: 103.9231052 },\n            { nominal: 105, mass: 104.9212684 },\n            { nominal: 106, mass: 105.9169574 },\n            { nominal: 107, mass: 106.9157137 },\n            { nominal: 108, mass: 107.9118943 },\n            { nominal: 109, mass: 108.9112921 },\n            { nominal: 110, mass: 109.907845 },\n            { nominal: 111, mass: 110.9077401 },\n            { nominal: 112, mass: 111.90482387, abundance: 0.0097 },\n            { nominal: 113, mass: 112.9051757 },\n            { nominal: 114, mass: 113.9027827, abundance: 0.0066 },\n            { nominal: 115, mass: 114.903344699, abundance: 0.0034 },\n            { nominal: 116, mass: 115.9017428, abundance: 0.1454 },\n            { nominal: 117, mass: 116.90295398, abundance: 0.0768 },\n            { nominal: 118, mass: 117.90160657, abundance: 0.2422 },\n            { nominal: 119, mass: 118.90331117, abundance: 0.0859 },\n            { nominal: 120, mass: 119.90220163, abundance: 0.3258 },\n            { nominal: 121, mass: 120.9042426 },\n            { nominal: 122, mass: 121.9034438, abundance: 0.0463 },\n            { nominal: 123, mass: 122.9057252 },\n            { nominal: 124, mass: 123.9052766, abundance: 0.0579 },\n            { nominal: 125, mass: 124.9077864 },\n            { nominal: 126, mass: 125.907659 },\n            { nominal: 127, mass: 126.91039 },\n            { nominal: 128, mass: 127.910507 },\n            { nominal: 129, mass: 128.913465 },\n            { nominal: 130, mass: 129.9139738 },\n            { nominal: 131, mass: 130.917045 },\n            { nominal: 132, mass: 131.9178267 },\n            { nominal: 133, mass: 132.9239134 },\n            { nominal: 134, mass: 133.9286821 },\n            { nominal: 135, mass: 134.9349086 },\n            { nominal: 136, mass: 135.93999 },\n            { nominal: 137, mass: 136.94655 },\n            { nominal: 138, mass: 137.95184 },\n        ],\n        symbol: 'Sn',\n        mass: 118.71011259301059,\n        name: 'Tin',\n        monoisotopicMass: 119.90220163,\n    },\n    {\n        number: 51,\n        isotopes: [\n            { nominal: 103, mass: 102.93969 },\n            { nominal: 104, mass: 103.93648 },\n            { nominal: 105, mass: 104.931276 },\n            { nominal: 106, mass: 105.928638 },\n            { nominal: 107, mass: 106.9241506 },\n            { nominal: 108, mass: 107.9222267 },\n            { nominal: 109, mass: 108.9181411 },\n            { nominal: 110, mass: 109.9168543 },\n            { nominal: 111, mass: 110.9132182 },\n            { nominal: 112, mass: 111.9124 },\n            { nominal: 113, mass: 112.909375 },\n            { nominal: 114, mass: 113.90929 },\n            { nominal: 115, mass: 114.906598 },\n            { nominal: 116, mass: 115.9067931 },\n            { nominal: 117, mass: 116.9048415 },\n            { nominal: 118, mass: 117.9055321 },\n            { nominal: 119, mass: 118.9039455 },\n            { nominal: 120, mass: 119.9050794 },\n            { nominal: 121, mass: 120.903812, abundance: 0.5721 },\n            { nominal: 122, mass: 121.9051699 },\n            { nominal: 123, mass: 122.9042132, abundance: 0.4279 },\n            { nominal: 124, mass: 123.905935 },\n            { nominal: 125, mass: 124.905253 },\n            { nominal: 126, mass: 125.907253 },\n            { nominal: 127, mass: 126.9069243 },\n            { nominal: 128, mass: 127.909146 },\n            { nominal: 129, mass: 128.909147 },\n            { nominal: 130, mass: 129.911662 },\n            { nominal: 131, mass: 130.9119888 },\n            { nominal: 132, mass: 131.9145077 },\n            { nominal: 133, mass: 132.9152732 },\n            { nominal: 134, mass: 133.9205357 },\n            { nominal: 135, mass: 134.9251851 },\n            { nominal: 136, mass: 135.9307459 },\n            { nominal: 137, mass: 136.93555 },\n            { nominal: 138, mass: 137.94145 },\n            { nominal: 139, mass: 138.94655 },\n            { nominal: 140, mass: 139.95283 },\n        ],\n        symbol: 'Sb',\n        mass: 121.75978367348,\n        name: 'Antimony',\n        monoisotopicMass: 120.903812,\n    },\n    {\n        number: 52,\n        isotopes: [\n            { nominal: 105, mass: 104.9433 },\n            { nominal: 106, mass: 105.9375 },\n            { nominal: 107, mass: 106.935012 },\n            { nominal: 108, mass: 107.9293805 },\n            { nominal: 109, mass: 108.9273045 },\n            { nominal: 110, mass: 109.9224581 },\n            { nominal: 111, mass: 110.9210006 },\n            { nominal: 112, mass: 111.9167279 },\n            { nominal: 113, mass: 112.915891 },\n            { nominal: 114, mass: 113.912089 },\n            { nominal: 115, mass: 114.911902 },\n            { nominal: 116, mass: 115.90846 },\n            { nominal: 117, mass: 116.908646 },\n            { nominal: 118, mass: 117.905854 },\n            { nominal: 119, mass: 118.9064071 },\n            { nominal: 120, mass: 119.9040593, abundance: 0.0009 },\n            { nominal: 121, mass: 120.904944 },\n            { nominal: 122, mass: 121.9030435, abundance: 0.0255 },\n            { nominal: 123, mass: 122.9042698, abundance: 0.0089 },\n            { nominal: 124, mass: 123.9028171, abundance: 0.0474 },\n            { nominal: 125, mass: 124.9044299, abundance: 0.0707 },\n            { nominal: 126, mass: 125.9033109, abundance: 0.1884 },\n            { nominal: 127, mass: 126.9052257 },\n            { nominal: 128, mass: 127.90446128, abundance: 0.3174 },\n            { nominal: 129, mass: 128.90659646 },\n            { nominal: 130, mass: 129.906222748, abundance: 0.3408 },\n            { nominal: 131, mass: 130.908522213 },\n            { nominal: 132, mass: 131.9085467 },\n            { nominal: 133, mass: 132.9109688 },\n            { nominal: 134, mass: 133.911394 },\n            { nominal: 135, mass: 134.9165557 },\n            { nominal: 136, mass: 135.9201006 },\n            { nominal: 137, mass: 136.9255989 },\n            { nominal: 138, mass: 137.9294722 },\n            { nominal: 139, mass: 138.9353672 },\n            { nominal: 140, mass: 139.939499 },\n            { nominal: 141, mass: 140.9458 },\n            { nominal: 142, mass: 141.95022 },\n            { nominal: 143, mass: 142.95676 },\n        ],\n        symbol: 'Te',\n        mass: 127.6031264846604,\n        name: 'Tellurium',\n        monoisotopicMass: 129.906222748,\n    },\n    {\n        number: 53,\n        isotopes: [\n            { nominal: 107, mass: 106.94678 },\n            { nominal: 108, mass: 107.94348 },\n            { nominal: 109, mass: 108.9380853 },\n            { nominal: 110, mass: 109.935089 },\n            { nominal: 111, mass: 110.9302692 },\n            { nominal: 112, mass: 111.928005 },\n            { nominal: 113, mass: 112.9236501 },\n            { nominal: 114, mass: 113.92185 },\n            { nominal: 115, mass: 114.918048 },\n            { nominal: 116, mass: 115.91681 },\n            { nominal: 117, mass: 116.913648 },\n            { nominal: 118, mass: 117.913074 },\n            { nominal: 119, mass: 118.910074 },\n            { nominal: 120, mass: 119.910087 },\n            { nominal: 121, mass: 120.9074051 },\n            { nominal: 122, mass: 121.9075888 },\n            { nominal: 123, mass: 122.9055885 },\n            { nominal: 124, mass: 123.906209 },\n            { nominal: 125, mass: 124.9046294 },\n            { nominal: 126, mass: 125.9056233 },\n            { nominal: 127, mass: 126.9044719, abundance: 1 },\n            { nominal: 128, mass: 127.9058086 },\n            { nominal: 129, mass: 128.9049837 },\n            { nominal: 130, mass: 129.9066702 },\n            { nominal: 131, mass: 130.9061263 },\n            { nominal: 132, mass: 131.9079935 },\n            { nominal: 133, mass: 132.907797 },\n            { nominal: 134, mass: 133.9097588 },\n            { nominal: 135, mass: 134.9100488 },\n            { nominal: 136, mass: 135.914604 },\n            { nominal: 137, mass: 136.9180282 },\n            { nominal: 138, mass: 137.9227264 },\n            { nominal: 139, mass: 138.926506 },\n            { nominal: 140, mass: 139.93173 },\n            { nominal: 141, mass: 140.93569 },\n            { nominal: 142, mass: 141.9412 },\n            { nominal: 143, mass: 142.94565 },\n            { nominal: 144, mass: 143.95139 },\n            { nominal: 145, mass: 144.95605 },\n        ],\n        symbol: 'I',\n        mass: 126.9044719,\n        name: 'Iodine',\n        monoisotopicMass: 126.9044719,\n    },\n    {\n        number: 54,\n        isotopes: [\n            { nominal: 109, mass: 108.95043 },\n            { nominal: 110, mass: 109.94426 },\n            { nominal: 111, mass: 110.941607 },\n            { nominal: 112, mass: 111.935559 },\n            { nominal: 113, mass: 112.9332217 },\n            { nominal: 114, mass: 113.92798 },\n            { nominal: 115, mass: 114.926294 },\n            { nominal: 116, mass: 115.921581 },\n            { nominal: 117, mass: 116.920359 },\n            { nominal: 118, mass: 117.916179 },\n            { nominal: 119, mass: 118.915411 },\n            { nominal: 120, mass: 119.911784 },\n            { nominal: 121, mass: 120.911453 },\n            { nominal: 122, mass: 121.908368 },\n            { nominal: 123, mass: 122.908482 },\n            { nominal: 124, mass: 123.905892, abundance: 0.000952 },\n            { nominal: 125, mass: 124.9063944 },\n            { nominal: 126, mass: 125.9042983, abundance: 0.00089 },\n            { nominal: 127, mass: 126.9051829 },\n            { nominal: 128, mass: 127.903531, abundance: 0.019102 },\n            { nominal: 129, mass: 128.9047808611, abundance: 0.264006 },\n            { nominal: 130, mass: 129.903509349, abundance: 0.04071 },\n            { nominal: 131, mass: 130.90508406, abundance: 0.212324 },\n            { nominal: 132, mass: 131.9041550856, abundance: 0.269086 },\n            { nominal: 133, mass: 132.9059108 },\n            { nominal: 134, mass: 133.90539466, abundance: 0.104357 },\n            { nominal: 135, mass: 134.9072278 },\n            { nominal: 136, mass: 135.907214484, abundance: 0.088573 },\n            { nominal: 137, mass: 136.91155778 },\n            { nominal: 138, mass: 137.9141463 },\n            { nominal: 139, mass: 138.9187922 },\n            { nominal: 140, mass: 139.9216458 },\n            { nominal: 141, mass: 140.9267872 },\n            { nominal: 142, mass: 141.9299731 },\n            { nominal: 143, mass: 142.9353696 },\n            { nominal: 144, mass: 143.9389451 },\n            { nominal: 145, mass: 144.94472 },\n            { nominal: 146, mass: 145.948518 },\n            { nominal: 147, mass: 146.95426 },\n            { nominal: 148, mass: 147.95813 },\n        ],\n        symbol: 'Xe',\n        mass: 131.29276144779053,\n        name: 'Xenon',\n        monoisotopicMass: 131.9041550856,\n    },\n    {\n        number: 55,\n        isotopes: [\n            { nominal: 112, mass: 111.950309 },\n            { nominal: 113, mass: 112.9444291 },\n            { nominal: 114, mass: 113.941296 },\n            { nominal: 115, mass: 114.93591 },\n            { nominal: 116, mass: 115.93337 },\n            { nominal: 117, mass: 116.928617 },\n            { nominal: 118, mass: 117.92656 },\n            { nominal: 119, mass: 118.922377 },\n            { nominal: 120, mass: 119.920677 },\n            { nominal: 121, mass: 120.917227 },\n            { nominal: 122, mass: 121.916108 },\n            { nominal: 123, mass: 122.912996 },\n            { nominal: 124, mass: 123.9122578 },\n            { nominal: 125, mass: 124.909728 },\n            { nominal: 126, mass: 125.909446 },\n            { nominal: 127, mass: 126.9074174 },\n            { nominal: 128, mass: 127.9077487 },\n            { nominal: 129, mass: 128.9060657 },\n            { nominal: 130, mass: 129.9067093 },\n            { nominal: 131, mass: 130.9054649 },\n            { nominal: 132, mass: 131.9064339 },\n            { nominal: 133, mass: 132.905451961, abundance: 1 },\n            { nominal: 134, mass: 133.906718503 },\n            { nominal: 135, mass: 134.905977 },\n            { nominal: 136, mass: 135.9073114 },\n            { nominal: 137, mass: 136.90708923 },\n            { nominal: 138, mass: 137.9110171 },\n            { nominal: 139, mass: 138.9133638 },\n            { nominal: 140, mass: 139.9172831 },\n            { nominal: 141, mass: 140.9200455 },\n            { nominal: 142, mass: 141.924296 },\n            { nominal: 143, mass: 142.927349 },\n            { nominal: 144, mass: 143.932076 },\n            { nominal: 145, mass: 144.935527 },\n            { nominal: 146, mass: 145.940344 },\n            { nominal: 147, mass: 146.944156 },\n            { nominal: 148, mass: 147.94923 },\n            { nominal: 149, mass: 148.95302 },\n            { nominal: 150, mass: 149.95833 },\n            { nominal: 151, mass: 150.96258 },\n        ],\n        symbol: 'Cs',\n        mass: 132.905451961,\n        name: 'Caesium',\n        monoisotopicMass: 132.905451961,\n    },\n    {\n        number: 56,\n        isotopes: [\n            { nominal: 114, mass: 113.95066 },\n            { nominal: 115, mass: 114.94737 },\n            { nominal: 116, mass: 115.94128 },\n            { nominal: 117, mass: 116.93814 },\n            { nominal: 118, mass: 117.93306 },\n            { nominal: 119, mass: 118.93066 },\n            { nominal: 120, mass: 119.92605 },\n            { nominal: 121, mass: 120.92405 },\n            { nominal: 122, mass: 121.919904 },\n            { nominal: 123, mass: 122.918781 },\n            { nominal: 124, mass: 123.915094 },\n            { nominal: 125, mass: 124.914472 },\n            { nominal: 126, mass: 125.91125 },\n            { nominal: 127, mass: 126.911091 },\n            { nominal: 128, mass: 127.908342 },\n            { nominal: 129, mass: 128.908681 },\n            { nominal: 130, mass: 129.9063207, abundance: 0.00106 },\n            { nominal: 131, mass: 130.906941 },\n            { nominal: 132, mass: 131.9050611, abundance: 0.00101 },\n            { nominal: 133, mass: 132.9060074 },\n            { nominal: 134, mass: 133.90450818, abundance: 0.02417 },\n            { nominal: 135, mass: 134.90568838, abundance: 0.06592 },\n            { nominal: 136, mass: 135.90457573, abundance: 0.07854 },\n            { nominal: 137, mass: 136.90582714, abundance: 0.11232 },\n            { nominal: 138, mass: 137.905247, abundance: 0.71698 },\n            { nominal: 139, mass: 138.9088411 },\n            { nominal: 140, mass: 139.9106057 },\n            { nominal: 141, mass: 140.9144033 },\n            { nominal: 142, mass: 141.9164324 },\n            { nominal: 143, mass: 142.9206253 },\n            { nominal: 144, mass: 143.9229549 },\n            { nominal: 145, mass: 144.9275184 },\n            { nominal: 146, mass: 145.930284 },\n            { nominal: 147, mass: 146.935304 },\n            { nominal: 148, mass: 147.938171 },\n            { nominal: 149, mass: 148.94308 },\n            { nominal: 150, mass: 149.94605 },\n            { nominal: 151, mass: 150.95127 },\n            { nominal: 152, mass: 151.95481 },\n            { nominal: 153, mass: 152.96036 },\n        ],\n        symbol: 'Ba',\n        mass: 137.3268916286322,\n        name: 'Barium',\n        monoisotopicMass: 137.905247,\n    },\n    {\n        number: 57,\n        isotopes: [\n            { nominal: 116, mass: 115.9563 },\n            { nominal: 117, mass: 116.94999 },\n            { nominal: 118, mass: 117.94673 },\n            { nominal: 119, mass: 118.94099 },\n            { nominal: 120, mass: 119.93807 },\n            { nominal: 121, mass: 120.93315 },\n            { nominal: 122, mass: 121.93071 },\n            { nominal: 123, mass: 122.9263 },\n            { nominal: 124, mass: 123.924574 },\n            { nominal: 125, mass: 124.920816 },\n            { nominal: 126, mass: 125.919513 },\n            { nominal: 127, mass: 126.916375 },\n            { nominal: 128, mass: 127.915592 },\n            { nominal: 129, mass: 128.912694 },\n            { nominal: 130, mass: 129.912369 },\n            { nominal: 131, mass: 130.91007 },\n            { nominal: 132, mass: 131.910119 },\n            { nominal: 133, mass: 132.908218 },\n            { nominal: 134, mass: 133.908514 },\n            { nominal: 135, mass: 134.906984 },\n            { nominal: 136, mass: 135.907635 },\n            { nominal: 137, mass: 136.9064504 },\n            { nominal: 138, mass: 137.9071149, abundance: 0.0008881 },\n            { nominal: 139, mass: 138.9063563, abundance: 0.9991119 },\n            { nominal: 140, mass: 139.9094806 },\n            { nominal: 141, mass: 140.910966 },\n            { nominal: 142, mass: 141.9140909 },\n            { nominal: 143, mass: 142.9160795 },\n            { nominal: 144, mass: 143.919646 },\n            { nominal: 145, mass: 144.921808 },\n            { nominal: 146, mass: 145.925875 },\n            { nominal: 147, mass: 146.928418 },\n            { nominal: 148, mass: 147.932679 },\n            { nominal: 149, mass: 148.93535 },\n            { nominal: 150, mass: 149.93947 },\n            { nominal: 151, mass: 150.94232 },\n            { nominal: 152, mass: 151.94682 },\n            { nominal: 153, mass: 152.95036 },\n            { nominal: 154, mass: 153.95517 },\n            { nominal: 155, mass: 154.95901 },\n        ],\n        symbol: 'La',\n        mass: 138.90546887371266,\n        name: 'Lanthanum',\n        monoisotopicMass: 138.9063563,\n    },\n    {\n        number: 58,\n        isotopes: [\n            { nominal: 119, mass: 118.95271 },\n            { nominal: 120, mass: 119.94654 },\n            { nominal: 121, mass: 120.94335 },\n            { nominal: 122, mass: 121.93787 },\n            { nominal: 123, mass: 122.93528 },\n            { nominal: 124, mass: 123.93031 },\n            { nominal: 125, mass: 124.92844 },\n            { nominal: 126, mass: 125.923971 },\n            { nominal: 127, mass: 126.922727 },\n            { nominal: 128, mass: 127.918911 },\n            { nominal: 129, mass: 128.918102 },\n            { nominal: 130, mass: 129.914736 },\n            { nominal: 131, mass: 130.914429 },\n            { nominal: 132, mass: 131.911464 },\n            { nominal: 133, mass: 132.91152 },\n            { nominal: 134, mass: 133.908928 },\n            { nominal: 135, mass: 134.909161 },\n            { nominal: 136, mass: 135.90712921, abundance: 0.00185 },\n            { nominal: 137, mass: 136.90776236 },\n            { nominal: 138, mass: 137.905991, abundance: 0.00251 },\n            { nominal: 139, mass: 138.9066551 },\n            { nominal: 140, mass: 139.9054431, abundance: 0.8845 },\n            { nominal: 141, mass: 140.9082807 },\n            { nominal: 142, mass: 141.9092504, abundance: 0.11114 },\n            { nominal: 143, mass: 142.9123921 },\n            { nominal: 144, mass: 143.9136529 },\n            { nominal: 145, mass: 144.917265 },\n            { nominal: 146, mass: 145.918802 },\n            { nominal: 147, mass: 146.9226899 },\n            { nominal: 148, mass: 147.924424 },\n            { nominal: 149, mass: 148.928427 },\n            { nominal: 150, mass: 149.930384 },\n            { nominal: 151, mass: 150.934272 },\n            { nominal: 152, mass: 151.9366 },\n            { nominal: 153, mass: 152.94093 },\n            { nominal: 154, mass: 153.9438 },\n            { nominal: 155, mass: 154.94855 },\n            { nominal: 156, mass: 155.95183 },\n            { nominal: 157, mass: 156.95705 },\n        ],\n        symbol: 'Ce',\n        mass: 140.1157307378545,\n        name: 'Cerium',\n        monoisotopicMass: 139.9054431,\n    },\n    {\n        number: 59,\n        isotopes: [\n            { nominal: 121, mass: 120.95532 },\n            { nominal: 122, mass: 121.95175 },\n            { nominal: 123, mass: 122.94596 },\n            { nominal: 124, mass: 123.94294 },\n            { nominal: 125, mass: 124.9377 },\n            { nominal: 126, mass: 125.93524 },\n            { nominal: 127, mass: 126.93071 },\n            { nominal: 128, mass: 127.928791 },\n            { nominal: 129, mass: 128.925095 },\n            { nominal: 130, mass: 129.92359 },\n            { nominal: 131, mass: 130.920235 },\n            { nominal: 132, mass: 131.919255 },\n            { nominal: 133, mass: 132.916331 },\n            { nominal: 134, mass: 133.915697 },\n            { nominal: 135, mass: 134.913112 },\n            { nominal: 136, mass: 135.912677 },\n            { nominal: 137, mass: 136.9106792 },\n            { nominal: 138, mass: 137.910754 },\n            { nominal: 139, mass: 138.9089408 },\n            { nominal: 140, mass: 139.9090803 },\n            { nominal: 141, mass: 140.9076576, abundance: 1 },\n            { nominal: 142, mass: 141.9100496 },\n            { nominal: 143, mass: 142.9108228 },\n            { nominal: 144, mass: 143.9133109 },\n            { nominal: 145, mass: 144.9145182 },\n            { nominal: 146, mass: 145.91768 },\n            { nominal: 147, mass: 146.919008 },\n            { nominal: 148, mass: 147.92213 },\n            { nominal: 149, mass: 148.923736 },\n            { nominal: 150, mass: 149.9266765 },\n            { nominal: 151, mass: 150.928309 },\n            { nominal: 152, mass: 151.931553 },\n            { nominal: 153, mass: 152.933904 },\n            { nominal: 154, mass: 153.93753 },\n            { nominal: 155, mass: 154.940509 },\n            { nominal: 156, mass: 155.94464 },\n            { nominal: 157, mass: 156.94789 },\n            { nominal: 158, mass: 157.95241 },\n            { nominal: 159, mass: 158.95589 },\n        ],\n        symbol: 'Pr',\n        mass: 140.9076576,\n        name: 'Praseodymium',\n        monoisotopicMass: 140.9076576,\n    },\n    {\n        number: 60,\n        isotopes: [\n            { nominal: 124, mass: 123.9522 },\n            { nominal: 125, mass: 124.9489 },\n            { nominal: 126, mass: 125.94311 },\n            { nominal: 127, mass: 126.94038 },\n            { nominal: 128, mass: 127.93525 },\n            { nominal: 129, mass: 128.9331 },\n            { nominal: 130, mass: 129.928506 },\n            { nominal: 131, mass: 130.927248 },\n            { nominal: 132, mass: 131.923321 },\n            { nominal: 133, mass: 132.922348 },\n            { nominal: 134, mass: 133.91879 },\n            { nominal: 135, mass: 134.918181 },\n            { nominal: 136, mass: 135.914976 },\n            { nominal: 137, mass: 136.914562 },\n            { nominal: 138, mass: 137.91195 },\n            { nominal: 139, mass: 138.911954 },\n            { nominal: 140, mass: 139.90955 },\n            { nominal: 141, mass: 140.9096147 },\n            { nominal: 142, mass: 141.907729, abundance: 0.27152 },\n            { nominal: 143, mass: 142.90982, abundance: 0.12174 },\n            { nominal: 144, mass: 143.910093, abundance: 0.23798 },\n            { nominal: 145, mass: 144.9125793, abundance: 0.08293 },\n            { nominal: 146, mass: 145.9131226, abundance: 0.17189 },\n            { nominal: 147, mass: 146.9161061 },\n            { nominal: 148, mass: 147.9168993, abundance: 0.05756 },\n            { nominal: 149, mass: 148.9201548 },\n            { nominal: 150, mass: 149.9209022, abundance: 0.05638 },\n            { nominal: 151, mass: 150.9238403 },\n            { nominal: 152, mass: 151.924692 },\n            { nominal: 153, mass: 152.927718 },\n            { nominal: 154, mass: 153.92948 },\n            { nominal: 155, mass: 154.9331357 },\n            { nominal: 156, mass: 155.93508 },\n            { nominal: 157, mass: 156.939386 },\n            { nominal: 158, mass: 157.94197 },\n            { nominal: 159, mass: 158.94653 },\n            { nominal: 160, mass: 159.9494 },\n            { nominal: 161, mass: 160.95428 },\n        ],\n        symbol: 'Nd',\n        mass: 144.241596031827,\n        name: 'Neodymium',\n        monoisotopicMass: 141.907729,\n    },\n    {\n        number: 61,\n        isotopes: [\n            { nominal: 126, mass: 125.95792 },\n            { nominal: 127, mass: 126.95192 },\n            { nominal: 128, mass: 127.9487 },\n            { nominal: 129, mass: 128.94323 },\n            { nominal: 130, mass: 129.94053 },\n            { nominal: 131, mass: 130.93567 },\n            { nominal: 132, mass: 131.93384 },\n            { nominal: 133, mass: 132.929782 },\n            { nominal: 134, mass: 133.928353 },\n            { nominal: 135, mass: 134.924823 },\n            { nominal: 136, mass: 135.923585 },\n            { nominal: 137, mass: 136.92048 },\n            { nominal: 138, mass: 137.919548 },\n            { nominal: 139, mass: 138.9168 },\n            { nominal: 140, mass: 139.91604 },\n            { nominal: 141, mass: 140.913555 },\n            { nominal: 142, mass: 141.91289 },\n            { nominal: 143, mass: 142.9109383 },\n            { nominal: 144, mass: 143.9125964 },\n            { nominal: 145, mass: 144.9127559 },\n            { nominal: 146, mass: 145.9147024 },\n            { nominal: 147, mass: 146.915145 },\n            { nominal: 148, mass: 147.9174819 },\n            { nominal: 149, mass: 148.9183423 },\n            { nominal: 150, mass: 149.920991 },\n            { nominal: 151, mass: 150.9212175 },\n            { nominal: 152, mass: 151.923506 },\n            { nominal: 153, mass: 152.9241567 },\n            { nominal: 154, mass: 153.926472 },\n            { nominal: 155, mass: 154.928137 },\n            { nominal: 156, mass: 155.9311175 },\n            { nominal: 157, mass: 156.9331214 },\n            { nominal: 158, mass: 157.936565 },\n            { nominal: 159, mass: 158.939287 },\n            { nominal: 160, mass: 159.9431 },\n            { nominal: 161, mass: 160.94607 },\n            { nominal: 162, mass: 161.95022 },\n            { nominal: 163, mass: 162.95357 },\n        ],\n        symbol: 'Pm',\n        mass: null,\n        name: 'Promethium',\n    },\n    {\n        number: 62,\n        isotopes: [\n            { nominal: 128, mass: 127.95842 },\n            { nominal: 129, mass: 128.95476 },\n            { nominal: 130, mass: 129.949 },\n            { nominal: 131, mass: 130.94618 },\n            { nominal: 132, mass: 131.94087 },\n            { nominal: 133, mass: 132.93856 },\n            { nominal: 134, mass: 133.93411 },\n            { nominal: 135, mass: 134.93252 },\n            { nominal: 136, mass: 135.928276 },\n            { nominal: 137, mass: 136.926971 },\n            { nominal: 138, mass: 137.923244 },\n            { nominal: 139, mass: 138.922297 },\n            { nominal: 140, mass: 139.918995 },\n            { nominal: 141, mass: 140.9184816 },\n            { nominal: 142, mass: 141.9152044 },\n            { nominal: 143, mass: 142.9146353 },\n            { nominal: 144, mass: 143.9120065, abundance: 0.0307 },\n            { nominal: 145, mass: 144.9134173 },\n            { nominal: 146, mass: 145.913047 },\n            { nominal: 147, mass: 146.9149044, abundance: 0.1499 },\n            { nominal: 148, mass: 147.9148292, abundance: 0.1124 },\n            { nominal: 149, mass: 148.9171921, abundance: 0.1382 },\n            { nominal: 150, mass: 149.9172829, abundance: 0.0738 },\n            { nominal: 151, mass: 150.9199398 },\n            { nominal: 152, mass: 151.9197397, abundance: 0.2675 },\n            { nominal: 153, mass: 152.9221047 },\n            { nominal: 154, mass: 153.9222169, abundance: 0.2275 },\n            { nominal: 155, mass: 154.9246477 },\n            { nominal: 156, mass: 155.925536 },\n            { nominal: 157, mass: 156.9284187 },\n            { nominal: 158, mass: 157.929951 },\n            { nominal: 159, mass: 158.9332172 },\n            { nominal: 160, mass: 159.9353353 },\n            { nominal: 161, mass: 160.9391602 },\n            { nominal: 162, mass: 161.94146 },\n            { nominal: 163, mass: 162.94555 },\n            { nominal: 164, mass: 163.94836 },\n            { nominal: 165, mass: 164.95297 },\n        ],\n        symbol: 'Sm',\n        mass: 150.36635571193,\n        name: 'Samarium',\n        monoisotopicMass: 151.9197397,\n    },\n    {\n        number: 63,\n        isotopes: [\n            { nominal: 130, mass: 129.96369 },\n            { nominal: 131, mass: 130.95784 },\n            { nominal: 132, mass: 131.95467 },\n            { nominal: 133, mass: 132.94929 },\n            { nominal: 134, mass: 133.9464 },\n            { nominal: 135, mass: 134.94187 },\n            { nominal: 136, mass: 135.93962 },\n            { nominal: 137, mass: 136.93546 },\n            { nominal: 138, mass: 137.933709 },\n            { nominal: 139, mass: 138.929792 },\n            { nominal: 140, mass: 139.928088 },\n            { nominal: 141, mass: 140.924932 },\n            { nominal: 142, mass: 141.923442 },\n            { nominal: 143, mass: 142.920299 },\n            { nominal: 144, mass: 143.91882 },\n            { nominal: 145, mass: 144.9162726 },\n            { nominal: 146, mass: 145.917211 },\n            { nominal: 147, mass: 146.9167527 },\n            { nominal: 148, mass: 147.918089 },\n            { nominal: 149, mass: 148.9179378 },\n            { nominal: 150, mass: 149.9197077 },\n            { nominal: 151, mass: 150.9198578, abundance: 0.4781 },\n            { nominal: 152, mass: 151.9217522 },\n            { nominal: 153, mass: 152.921238, abundance: 0.5219 },\n            { nominal: 154, mass: 153.922987 },\n            { nominal: 155, mass: 154.9229011 },\n            { nominal: 156, mass: 155.9247605 },\n            { nominal: 157, mass: 156.9254334 },\n            { nominal: 158, mass: 157.927799 },\n            { nominal: 159, mass: 158.9291001 },\n            { nominal: 160, mass: 159.931851 },\n            { nominal: 161, mass: 160.933664 },\n            { nominal: 162, mass: 161.936989 },\n            { nominal: 163, mass: 162.939196 },\n            { nominal: 164, mass: 163.94274 },\n            { nominal: 165, mass: 164.94559 },\n            { nominal: 166, mass: 165.94962 },\n            { nominal: 167, mass: 166.95289 },\n        ],\n        symbol: 'Eu',\n        mass: 151.96437812637998,\n        name: 'Europium',\n        monoisotopicMass: 152.921238,\n    },\n    {\n        number: 64,\n        isotopes: [\n            { nominal: 133, mass: 132.96133 },\n            { nominal: 134, mass: 133.95566 },\n            { nominal: 135, mass: 134.95245 },\n            { nominal: 136, mass: 135.9473 },\n            { nominal: 137, mass: 136.94502 },\n            { nominal: 138, mass: 137.94025 },\n            { nominal: 139, mass: 138.93813 },\n            { nominal: 140, mass: 139.933674 },\n            { nominal: 141, mass: 140.932126 },\n            { nominal: 142, mass: 141.928116 },\n            { nominal: 143, mass: 142.92675 },\n            { nominal: 144, mass: 143.922963 },\n            { nominal: 145, mass: 144.921713 },\n            { nominal: 146, mass: 145.9183188 },\n            { nominal: 147, mass: 146.9191014 },\n            { nominal: 148, mass: 147.9181215 },\n            { nominal: 149, mass: 148.9193481 },\n            { nominal: 150, mass: 149.9186644 },\n            { nominal: 151, mass: 150.920356 },\n            { nominal: 152, mass: 151.9197995, abundance: 0.002 },\n            { nominal: 153, mass: 152.921758 },\n            { nominal: 154, mass: 153.9208741, abundance: 0.0218 },\n            { nominal: 155, mass: 154.9226305, abundance: 0.148 },\n            { nominal: 156, mass: 155.9221312, abundance: 0.2047 },\n            { nominal: 157, mass: 156.9239686, abundance: 0.1565 },\n            { nominal: 158, mass: 157.9241123, abundance: 0.2484 },\n            { nominal: 159, mass: 158.926397 },\n            { nominal: 160, mass: 159.9270624, abundance: 0.2186 },\n            { nominal: 161, mass: 160.9296775 },\n            { nominal: 162, mass: 161.930993 },\n            { nominal: 163, mass: 162.9341769 },\n            { nominal: 164, mass: 163.93583 },\n            { nominal: 165, mass: 164.93936 },\n            { nominal: 166, mass: 165.94146 },\n            { nominal: 167, mass: 166.94545 },\n            { nominal: 168, mass: 167.94808 },\n            { nominal: 169, mass: 168.9526 },\n        ],\n        symbol: 'Gd',\n        mass: 157.25213064687998,\n        name: 'Gadolinium',\n        monoisotopicMass: 157.9241123,\n    },\n    {\n        number: 65,\n        isotopes: [\n            { nominal: 135, mass: 134.96476 },\n            { nominal: 136, mass: 135.96129 },\n            { nominal: 137, mass: 136.95602 },\n            { nominal: 138, mass: 137.95312 },\n            { nominal: 139, mass: 138.94833 },\n            { nominal: 140, mass: 139.94581 },\n            { nominal: 141, mass: 140.94145 },\n            { nominal: 142, mass: 141.93928 },\n            { nominal: 143, mass: 142.935137 },\n            { nominal: 144, mass: 143.933045 },\n            { nominal: 145, mass: 144.92882 },\n            { nominal: 146, mass: 145.927253 },\n            { nominal: 147, mass: 146.9240548 },\n            { nominal: 148, mass: 147.924282 },\n            { nominal: 149, mass: 148.9232535 },\n            { nominal: 150, mass: 149.9236649 },\n            { nominal: 151, mass: 150.9231096 },\n            { nominal: 152, mass: 151.924083 },\n            { nominal: 153, mass: 152.9234424 },\n            { nominal: 154, mass: 153.924685 },\n            { nominal: 155, mass: 154.923511 },\n            { nominal: 156, mass: 155.9247552 },\n            { nominal: 157, mass: 156.924033 },\n            { nominal: 158, mass: 157.9254209 },\n            { nominal: 159, mass: 158.9253547, abundance: 1 },\n            { nominal: 160, mass: 159.9271756 },\n            { nominal: 161, mass: 160.9275778 },\n            { nominal: 162, mass: 161.929495 },\n            { nominal: 163, mass: 162.9306547 },\n            { nominal: 164, mass: 163.93336 },\n            { nominal: 165, mass: 164.93498 },\n            { nominal: 166, mass: 165.93786 },\n            { nominal: 167, mass: 166.93996 },\n            { nominal: 168, mass: 167.9434 },\n            { nominal: 169, mass: 168.94597 },\n            { nominal: 170, mass: 169.94984 },\n            { nominal: 171, mass: 170.95273 },\n        ],\n        symbol: 'Tb',\n        mass: 158.9253547,\n        name: 'Terbium',\n        monoisotopicMass: 158.9253547,\n    },\n    {\n        number: 66,\n        isotopes: [\n            { nominal: 138, mass: 137.9625 },\n            { nominal: 139, mass: 138.95959 },\n            { nominal: 140, mass: 139.95402 },\n            { nominal: 141, mass: 140.95128 },\n            { nominal: 142, mass: 141.94619 },\n            { nominal: 143, mass: 142.943994 },\n            { nominal: 144, mass: 143.9392695 },\n            { nominal: 145, mass: 144.937474 },\n            { nominal: 146, mass: 145.9328445 },\n            { nominal: 147, mass: 146.9310827 },\n            { nominal: 148, mass: 147.927157 },\n            { nominal: 149, mass: 148.927322 },\n            { nominal: 150, mass: 149.9255933 },\n            { nominal: 151, mass: 150.9261916 },\n            { nominal: 152, mass: 151.9247253 },\n            { nominal: 153, mass: 152.9257724 },\n            { nominal: 154, mass: 153.9244293 },\n            { nominal: 155, mass: 154.925759 },\n            { nominal: 156, mass: 155.9242847, abundance: 0.00056 },\n            { nominal: 157, mass: 156.9254707 },\n            { nominal: 158, mass: 157.9244159, abundance: 0.00095 },\n            { nominal: 159, mass: 158.925747 },\n            { nominal: 160, mass: 159.9252046, abundance: 0.02329 },\n            { nominal: 161, mass: 160.9269405, abundance: 0.18889 },\n            { nominal: 162, mass: 161.9268056, abundance: 0.25475 },\n            { nominal: 163, mass: 162.9287383, abundance: 0.24896 },\n            { nominal: 164, mass: 163.9291819, abundance: 0.2826 },\n            { nominal: 165, mass: 164.9317105 },\n            { nominal: 166, mass: 165.9328139 },\n            { nominal: 167, mass: 166.935661 },\n            { nominal: 168, mass: 167.93713 },\n            { nominal: 169, mass: 168.94031 },\n            { nominal: 170, mass: 169.94239 },\n            { nominal: 171, mass: 170.94612 },\n            { nominal: 172, mass: 171.94846 },\n            { nominal: 173, mass: 172.95283 },\n        ],\n        symbol: 'Dy',\n        mass: 162.499472819424,\n        name: 'Dysprosium',\n        monoisotopicMass: 163.9291819,\n    },\n    {\n        number: 67,\n        isotopes: [\n            { nominal: 140, mass: 139.96859 },\n            { nominal: 141, mass: 140.96311 },\n            { nominal: 142, mass: 141.96001 },\n            { nominal: 143, mass: 142.95486 },\n            { nominal: 144, mass: 143.9521097 },\n            { nominal: 145, mass: 144.9472674 },\n            { nominal: 146, mass: 145.9449935 },\n            { nominal: 147, mass: 146.9401423 },\n            { nominal: 148, mass: 147.937744 },\n            { nominal: 149, mass: 148.933803 },\n            { nominal: 150, mass: 149.933498 },\n            { nominal: 151, mass: 150.9316983 },\n            { nominal: 152, mass: 151.931724 },\n            { nominal: 153, mass: 152.9302064 },\n            { nominal: 154, mass: 153.9306068 },\n            { nominal: 155, mass: 154.929104 },\n            { nominal: 156, mass: 155.929706 },\n            { nominal: 157, mass: 156.928254 },\n            { nominal: 158, mass: 157.928946 },\n            { nominal: 159, mass: 158.9277197 },\n            { nominal: 160, mass: 159.928737 },\n            { nominal: 161, mass: 160.9278615 },\n            { nominal: 162, mass: 161.9291023 },\n            { nominal: 163, mass: 162.928741 },\n            { nominal: 164, mass: 163.9302403 },\n            { nominal: 165, mass: 164.9303288, abundance: 1 },\n            { nominal: 166, mass: 165.9322909 },\n            { nominal: 167, mass: 166.9331385 },\n            { nominal: 168, mass: 167.935522 },\n            { nominal: 169, mass: 168.936878 },\n            { nominal: 170, mass: 169.939625 },\n            { nominal: 171, mass: 170.94147 },\n            { nominal: 172, mass: 171.94473 },\n            { nominal: 173, mass: 172.94702 },\n            { nominal: 174, mass: 173.95095 },\n            { nominal: 175, mass: 174.95362 },\n        ],\n        symbol: 'Ho',\n        mass: 164.9303288,\n        name: 'Holmium',\n        monoisotopicMass: 164.9303288,\n    },\n    {\n        number: 68,\n        isotopes: [\n            { nominal: 142, mass: 141.9701 },\n            { nominal: 143, mass: 142.96662 },\n            { nominal: 144, mass: 143.9607 },\n            { nominal: 145, mass: 144.95805 },\n            { nominal: 146, mass: 145.9524184 },\n            { nominal: 147, mass: 146.949964 },\n            { nominal: 148, mass: 147.944735 },\n            { nominal: 149, mass: 148.942306 },\n            { nominal: 150, mass: 149.937916 },\n            { nominal: 151, mass: 150.937449 },\n            { nominal: 152, mass: 151.935057 },\n            { nominal: 153, mass: 152.93508 },\n            { nominal: 154, mass: 153.9327908 },\n            { nominal: 155, mass: 154.9332159 },\n            { nominal: 156, mass: 155.931067 },\n            { nominal: 157, mass: 156.931949 },\n            { nominal: 158, mass: 157.929893 },\n            { nominal: 159, mass: 158.9306918 },\n            { nominal: 160, mass: 159.929077 },\n            { nominal: 161, mass: 160.9300046 },\n            { nominal: 162, mass: 161.9287884, abundance: 0.00139 },\n            { nominal: 163, mass: 162.9300408 },\n            { nominal: 164, mass: 163.9292088, abundance: 0.01601 },\n            { nominal: 165, mass: 164.9307345 },\n            { nominal: 166, mass: 165.9302995, abundance: 0.33503 },\n            { nominal: 167, mass: 166.9320546, abundance: 0.22869 },\n            { nominal: 168, mass: 167.9323767, abundance: 0.26978 },\n            { nominal: 169, mass: 168.9345968 },\n            { nominal: 170, mass: 169.9354702, abundance: 0.1491 },\n            { nominal: 171, mass: 170.9380357 },\n            { nominal: 172, mass: 171.9393619 },\n            { nominal: 173, mass: 172.9424 },\n            { nominal: 174, mass: 173.94423 },\n            { nominal: 175, mass: 174.94777 },\n            { nominal: 176, mass: 175.94994 },\n            { nominal: 177, mass: 176.95399 },\n        ],\n        symbol: 'Er',\n        mass: 167.259082649669,\n        name: 'Erbium',\n        monoisotopicMass: 165.9302995,\n    },\n    {\n        number: 69,\n        isotopes: [\n            { nominal: 144, mass: 143.97628 },\n            { nominal: 145, mass: 144.97039 },\n            { nominal: 146, mass: 145.96684 },\n            { nominal: 147, mass: 146.9613799 },\n            { nominal: 148, mass: 147.958384 },\n            { nominal: 149, mass: 148.95289 },\n            { nominal: 150, mass: 149.95009 },\n            { nominal: 151, mass: 150.945488 },\n            { nominal: 152, mass: 151.944422 },\n            { nominal: 153, mass: 152.94204 },\n            { nominal: 154, mass: 153.94157 },\n            { nominal: 155, mass: 154.93921 },\n            { nominal: 156, mass: 155.938992 },\n            { nominal: 157, mass: 156.936944 },\n            { nominal: 158, mass: 157.93698 },\n            { nominal: 159, mass: 158.934975 },\n            { nominal: 160, mass: 159.935263 },\n            { nominal: 161, mass: 160.933549 },\n            { nominal: 162, mass: 161.934002 },\n            { nominal: 163, mass: 162.9326592 },\n            { nominal: 164, mass: 163.933544 },\n            { nominal: 165, mass: 164.9324431 },\n            { nominal: 166, mass: 165.933561 },\n            { nominal: 167, mass: 166.9328562 },\n            { nominal: 168, mass: 167.9341774 },\n            { nominal: 169, mass: 168.9342179, abundance: 1 },\n            { nominal: 170, mass: 169.935806 },\n            { nominal: 171, mass: 170.9364339 },\n            { nominal: 172, mass: 171.9384055 },\n            { nominal: 173, mass: 172.9396084 },\n            { nominal: 174, mass: 173.942173 },\n            { nominal: 175, mass: 174.943841 },\n            { nominal: 176, mass: 175.947 },\n            { nominal: 177, mass: 176.94904 },\n            { nominal: 178, mass: 177.95264 },\n            { nominal: 179, mass: 178.95534 },\n        ],\n        symbol: 'Tm',\n        mass: 168.9342179,\n        name: 'Thulium',\n        monoisotopicMass: 168.9342179,\n    },\n    {\n        number: 70,\n        isotopes: [\n            { nominal: 148, mass: 147.96758 },\n            { nominal: 149, mass: 148.96436 },\n            { nominal: 150, mass: 149.95852 },\n            { nominal: 151, mass: 150.9554 },\n            { nominal: 152, mass: 151.95027 },\n            { nominal: 153, mass: 152.94932 },\n            { nominal: 154, mass: 153.946396 },\n            { nominal: 155, mass: 154.945783 },\n            { nominal: 156, mass: 155.942825 },\n            { nominal: 157, mass: 156.942645 },\n            { nominal: 158, mass: 157.9398705 },\n            { nominal: 159, mass: 158.940055 },\n            { nominal: 160, mass: 159.937557 },\n            { nominal: 161, mass: 160.937907 },\n            { nominal: 162, mass: 161.935774 },\n            { nominal: 163, mass: 162.93634 },\n            { nominal: 164, mass: 163.934495 },\n            { nominal: 165, mass: 164.93527 },\n            { nominal: 166, mass: 165.9338747 },\n            { nominal: 167, mass: 166.934953 },\n            { nominal: 168, mass: 167.9338896, abundance: 0.00123 },\n            { nominal: 169, mass: 168.9351825 },\n            { nominal: 170, mass: 169.9347664, abundance: 0.02982 },\n            { nominal: 171, mass: 170.9363302, abundance: 0.1409 },\n            { nominal: 172, mass: 171.9363859, abundance: 0.2168 },\n            { nominal: 173, mass: 172.9382151, abundance: 0.16103 },\n            { nominal: 174, mass: 173.9388664, abundance: 0.32026 },\n            { nominal: 175, mass: 174.9412808 },\n            { nominal: 176, mass: 175.9425764, abundance: 0.12996 },\n            { nominal: 177, mass: 176.9452656 },\n            { nominal: 178, mass: 177.946651 },\n            { nominal: 179, mass: 178.95004 },\n            { nominal: 180, mass: 179.95212 },\n            { nominal: 181, mass: 180.95589 },\n        ],\n        symbol: 'Yb',\n        mass: 173.05415016631702,\n        name: 'Ytterbium',\n        monoisotopicMass: 173.9388664,\n    },\n    {\n        number: 71,\n        isotopes: [\n            { nominal: 150, mass: 149.97355 },\n            { nominal: 151, mass: 150.96768 },\n            { nominal: 152, mass: 151.96412 },\n            { nominal: 153, mass: 152.95875 },\n            { nominal: 154, mass: 153.95736 },\n            { nominal: 155, mass: 154.954321 },\n            { nominal: 156, mass: 155.953033 },\n            { nominal: 157, mass: 156.950127 },\n            { nominal: 158, mass: 157.949316 },\n            { nominal: 159, mass: 158.946636 },\n            { nominal: 160, mass: 159.946033 },\n            { nominal: 161, mass: 160.943572 },\n            { nominal: 162, mass: 161.943283 },\n            { nominal: 163, mass: 162.941179 },\n            { nominal: 164, mass: 163.941339 },\n            { nominal: 165, mass: 164.939407 },\n            { nominal: 166, mass: 165.939859 },\n            { nominal: 167, mass: 166.93827 },\n            { nominal: 168, mass: 167.938736 },\n            { nominal: 169, mass: 168.9376441 },\n            { nominal: 170, mass: 169.938478 },\n            { nominal: 171, mass: 170.937917 },\n            { nominal: 172, mass: 171.9390891 },\n            { nominal: 173, mass: 172.938934 },\n            { nominal: 174, mass: 173.9403409 },\n            { nominal: 175, mass: 174.9407752, abundance: 0.97401 },\n            { nominal: 176, mass: 175.9426897, abundance: 0.02599 },\n            { nominal: 177, mass: 176.9437615 },\n            { nominal: 178, mass: 177.945958 },\n            { nominal: 179, mass: 178.9473309 },\n            { nominal: 180, mass: 179.949888 },\n            { nominal: 181, mass: 180.95191 },\n            { nominal: 182, mass: 181.95504 },\n            { nominal: 183, mass: 182.957363 },\n            { nominal: 184, mass: 183.96091 },\n            { nominal: 185, mass: 184.96362 },\n        ],\n        symbol: 'Lu',\n        mass: 174.96681495785498,\n        name: 'Lutetium',\n        monoisotopicMass: 174.9407752,\n    },\n    {\n        number: 72,\n        isotopes: [\n            { nominal: 153, mass: 152.97069 },\n            { nominal: 154, mass: 153.96486 },\n            { nominal: 155, mass: 154.96311 },\n            { nominal: 156, mass: 155.95935 },\n            { nominal: 157, mass: 156.95824 },\n            { nominal: 158, mass: 157.954801 },\n            { nominal: 159, mass: 158.953996 },\n            { nominal: 160, mass: 159.950691 },\n            { nominal: 161, mass: 160.950278 },\n            { nominal: 162, mass: 161.9472148 },\n            { nominal: 163, mass: 162.947113 },\n            { nominal: 164, mass: 163.944371 },\n            { nominal: 165, mass: 164.944567 },\n            { nominal: 166, mass: 165.94218 },\n            { nominal: 167, mass: 166.9426 },\n            { nominal: 168, mass: 167.940568 },\n            { nominal: 169, mass: 168.941259 },\n            { nominal: 170, mass: 169.939609 },\n            { nominal: 171, mass: 170.940492 },\n            { nominal: 172, mass: 171.93945 },\n            { nominal: 173, mass: 172.940513 },\n            { nominal: 174, mass: 173.9400461, abundance: 0.0016 },\n            { nominal: 175, mass: 174.9415092 },\n            { nominal: 176, mass: 175.9414076, abundance: 0.0526 },\n            { nominal: 177, mass: 176.9432277, abundance: 0.186 },\n            { nominal: 178, mass: 177.9437058, abundance: 0.2728 },\n            { nominal: 179, mass: 178.9458232, abundance: 0.1362 },\n            { nominal: 180, mass: 179.946557, abundance: 0.3508 },\n            { nominal: 181, mass: 180.9491083 },\n            { nominal: 182, mass: 181.9505612 },\n            { nominal: 183, mass: 182.95353 },\n            { nominal: 184, mass: 183.955446 },\n            { nominal: 185, mass: 184.958862 },\n            { nominal: 186, mass: 185.960897 },\n            { nominal: 187, mass: 186.96477 },\n            { nominal: 188, mass: 187.96685 },\n            { nominal: 189, mass: 188.97084 },\n        ],\n        symbol: 'Hf',\n        mass: 178.4849787234,\n        name: 'Hafnium',\n        monoisotopicMass: 179.946557,\n    },\n    {\n        number: 73,\n        isotopes: [\n            { nominal: 155, mass: 154.97424 },\n            { nominal: 156, mass: 155.97203 },\n            { nominal: 157, mass: 156.96818 },\n            { nominal: 158, mass: 157.96654 },\n            { nominal: 159, mass: 158.963023 },\n            { nominal: 160, mass: 159.961488 },\n            { nominal: 161, mass: 160.958452 },\n            { nominal: 162, mass: 161.957294 },\n            { nominal: 163, mass: 162.954337 },\n            { nominal: 164, mass: 163.953534 },\n            { nominal: 165, mass: 164.950781 },\n            { nominal: 166, mass: 165.950512 },\n            { nominal: 167, mass: 166.948093 },\n            { nominal: 168, mass: 167.948047 },\n            { nominal: 169, mass: 168.946011 },\n            { nominal: 170, mass: 169.946175 },\n            { nominal: 171, mass: 170.944476 },\n            { nominal: 172, mass: 171.944895 },\n            { nominal: 173, mass: 172.94375 },\n            { nominal: 174, mass: 173.944454 },\n            { nominal: 175, mass: 174.943737 },\n            { nominal: 176, mass: 175.944857 },\n            { nominal: 177, mass: 176.9444795 },\n            { nominal: 178, mass: 177.945678 },\n            { nominal: 179, mass: 178.9459366 },\n            { nominal: 180, mass: 179.9474648, abundance: 0.0001201 },\n            { nominal: 181, mass: 180.9479958, abundance: 0.9998799 },\n            { nominal: 182, mass: 181.9501519 },\n            { nominal: 183, mass: 182.9513726 },\n            { nominal: 184, mass: 183.954008 },\n            { nominal: 185, mass: 184.955559 },\n            { nominal: 186, mass: 185.958551 },\n            { nominal: 187, mass: 186.960386 },\n            { nominal: 188, mass: 187.963916 },\n            { nominal: 189, mass: 188.96583 },\n            { nominal: 190, mass: 189.96939 },\n            { nominal: 191, mass: 190.97156 },\n            { nominal: 192, mass: 191.97514 },\n        ],\n        symbol: 'Ta',\n        mass: 180.9478756362269,\n        name: 'Tantalum',\n        monoisotopicMass: 180.9479958,\n    },\n    {\n        number: 74,\n        isotopes: [\n            { nominal: 157, mass: 156.97884 },\n            { nominal: 158, mass: 157.97456 },\n            { nominal: 159, mass: 158.97264 },\n            { nominal: 160, mass: 159.96846 },\n            { nominal: 161, mass: 160.9672 },\n            { nominal: 162, mass: 161.963499 },\n            { nominal: 163, mass: 162.962524 },\n            { nominal: 164, mass: 163.958961 },\n            { nominal: 165, mass: 164.958281 },\n            { nominal: 166, mass: 165.955031 },\n            { nominal: 167, mass: 166.954805 },\n            { nominal: 168, mass: 167.951806 },\n            { nominal: 169, mass: 168.951779 },\n            { nominal: 170, mass: 169.949232 },\n            { nominal: 171, mass: 170.949451 },\n            { nominal: 172, mass: 171.947292 },\n            { nominal: 173, mass: 172.947689 },\n            { nominal: 174, mass: 173.946079 },\n            { nominal: 175, mass: 174.946717 },\n            { nominal: 176, mass: 175.945634 },\n            { nominal: 177, mass: 176.946643 },\n            { nominal: 178, mass: 177.945883 },\n            { nominal: 179, mass: 178.947077 },\n            { nominal: 180, mass: 179.9467108, abundance: 0.0012 },\n            { nominal: 181, mass: 180.9481978 },\n            { nominal: 182, mass: 181.94820394, abundance: 0.265 },\n            { nominal: 183, mass: 182.95022275, abundance: 0.1431 },\n            { nominal: 184, mass: 183.95093092, abundance: 0.3064 },\n            { nominal: 185, mass: 184.95341897 },\n            { nominal: 186, mass: 185.9543628, abundance: 0.2843 },\n            { nominal: 187, mass: 186.9571588 },\n            { nominal: 188, mass: 187.9584862 },\n            { nominal: 189, mass: 188.961763 },\n            { nominal: 190, mass: 189.963091 },\n            { nominal: 191, mass: 190.966531 },\n            { nominal: 192, mass: 191.96817 },\n            { nominal: 193, mass: 192.97178 },\n            { nominal: 194, mass: 193.97367 },\n        ],\n        symbol: 'W',\n        mass: 183.841777550513,\n        name: 'Tungsten',\n        monoisotopicMass: 183.95093092,\n    },\n    {\n        number: 75,\n        isotopes: [\n            { nominal: 159, mass: 158.98418 },\n            { nominal: 160, mass: 159.98182 },\n            { nominal: 161, mass: 160.97757 },\n            { nominal: 162, mass: 161.97584 },\n            { nominal: 163, mass: 162.97208 },\n            { nominal: 164, mass: 163.970453 },\n            { nominal: 165, mass: 164.967103 },\n            { nominal: 166, mass: 165.965761 },\n            { nominal: 167, mass: 166.962595 },\n            { nominal: 168, mass: 167.961573 },\n            { nominal: 169, mass: 168.958766 },\n            { nominal: 170, mass: 169.95822 },\n            { nominal: 171, mass: 170.955716 },\n            { nominal: 172, mass: 171.95542 },\n            { nominal: 173, mass: 172.953243 },\n            { nominal: 174, mass: 173.953115 },\n            { nominal: 175, mass: 174.951381 },\n            { nominal: 176, mass: 175.951623 },\n            { nominal: 177, mass: 176.950328 },\n            { nominal: 178, mass: 177.950989 },\n            { nominal: 179, mass: 178.949989 },\n            { nominal: 180, mass: 179.950792 },\n            { nominal: 181, mass: 180.950058 },\n            { nominal: 182, mass: 181.95121 },\n            { nominal: 183, mass: 182.9508196 },\n            { nominal: 184, mass: 183.9525228 },\n            { nominal: 185, mass: 184.9529545, abundance: 0.374 },\n            { nominal: 186, mass: 185.9549856 },\n            { nominal: 187, mass: 186.9557501, abundance: 0.626 },\n            { nominal: 188, mass: 187.9581115 },\n            { nominal: 189, mass: 188.959226 },\n            { nominal: 190, mass: 189.961744 },\n            { nominal: 191, mass: 190.963122 },\n            { nominal: 192, mass: 191.966088 },\n            { nominal: 193, mass: 192.967541 },\n            { nominal: 194, mass: 193.97076 },\n            { nominal: 195, mass: 194.97254 },\n            { nominal: 196, mass: 195.9758 },\n            { nominal: 197, mass: 196.97799 },\n            { nominal: 198, mass: 197.9816 },\n        ],\n        symbol: 'Re',\n        mass: 186.20670454560002,\n        name: 'Rhenium',\n        monoisotopicMass: 186.9557501,\n    },\n    {\n        number: 76,\n        isotopes: [\n            { nominal: 161, mass: 160.98903 },\n            { nominal: 162, mass: 161.98443 },\n            { nominal: 163, mass: 162.98241 },\n            { nominal: 164, mass: 163.97802 },\n            { nominal: 165, mass: 164.9766 },\n            { nominal: 166, mass: 165.972692 },\n            { nominal: 167, mass: 166.971549 },\n            { nominal: 168, mass: 167.967808 },\n            { nominal: 169, mass: 168.967018 },\n            { nominal: 170, mass: 169.963578 },\n            { nominal: 171, mass: 170.963174 },\n            { nominal: 172, mass: 171.960017 },\n            { nominal: 173, mass: 172.959808 },\n            { nominal: 174, mass: 173.957064 },\n            { nominal: 175, mass: 174.956945 },\n            { nominal: 176, mass: 175.954806 },\n            { nominal: 177, mass: 176.954966 },\n            { nominal: 178, mass: 177.953254 },\n            { nominal: 179, mass: 178.953817 },\n            { nominal: 180, mass: 179.952375 },\n            { nominal: 181, mass: 180.953247 },\n            { nominal: 182, mass: 181.95211 },\n            { nominal: 183, mass: 182.953125 },\n            { nominal: 184, mass: 183.9524885, abundance: 0.0002 },\n            { nominal: 185, mass: 184.9540417 },\n            { nominal: 186, mass: 185.953835, abundance: 0.0159 },\n            { nominal: 187, mass: 186.9557474, abundance: 0.0196 },\n            { nominal: 188, mass: 187.9558352, abundance: 0.1324 },\n            { nominal: 189, mass: 188.9581442, abundance: 0.1615 },\n            { nominal: 190, mass: 189.9584437, abundance: 0.2626 },\n            { nominal: 191, mass: 190.9609264 },\n            { nominal: 192, mass: 191.961477, abundance: 0.4078 },\n            { nominal: 193, mass: 192.9641479 },\n            { nominal: 194, mass: 193.9651772 },\n            { nominal: 195, mass: 194.968318 },\n            { nominal: 196, mass: 195.969641 },\n            { nominal: 197, mass: 196.97283 },\n            { nominal: 198, mass: 197.97441 },\n            { nominal: 199, mass: 198.97801 },\n            { nominal: 200, mass: 199.97984 },\n            { nominal: 201, mass: 200.98364 },\n            { nominal: 202, mass: 201.98595 },\n        ],\n        symbol: 'Os',\n        mass: 190.22485962823998,\n        name: 'Osmium',\n        monoisotopicMass: 191.961477,\n    },\n    {\n        number: 77,\n        isotopes: [\n            { nominal: 164, mass: 163.99191 },\n            { nominal: 165, mass: 164.9875 },\n            { nominal: 166, mass: 165.98566 },\n            { nominal: 167, mass: 166.981666 },\n            { nominal: 168, mass: 167.979907 },\n            { nominal: 169, mass: 168.976298 },\n            { nominal: 170, mass: 169.974922 },\n            { nominal: 171, mass: 170.97164 },\n            { nominal: 172, mass: 171.970607 },\n            { nominal: 173, mass: 172.967506 },\n            { nominal: 174, mass: 173.966861 },\n            { nominal: 175, mass: 174.96415 },\n            { nominal: 176, mass: 175.96365 },\n            { nominal: 177, mass: 176.961301 },\n            { nominal: 178, mass: 177.961082 },\n            { nominal: 179, mass: 178.95912 },\n            { nominal: 180, mass: 179.959229 },\n            { nominal: 181, mass: 180.957625 },\n            { nominal: 182, mass: 181.958076 },\n            { nominal: 183, mass: 182.95684 },\n            { nominal: 184, mass: 183.957476 },\n            { nominal: 185, mass: 184.956698 },\n            { nominal: 186, mass: 185.957944 },\n            { nominal: 187, mass: 186.957542 },\n            { nominal: 188, mass: 187.958828 },\n            { nominal: 189, mass: 188.958715 },\n            { nominal: 190, mass: 189.9605412 },\n            { nominal: 191, mass: 190.9605893, abundance: 0.373 },\n            { nominal: 192, mass: 191.9626002 },\n            { nominal: 193, mass: 192.9629216, abundance: 0.627 },\n            { nominal: 194, mass: 193.9650735 },\n            { nominal: 195, mass: 194.9659747 },\n            { nominal: 196, mass: 195.968397 },\n            { nominal: 197, mass: 196.969655 },\n            { nominal: 198, mass: 197.97228 },\n            { nominal: 199, mass: 198.973805 },\n            { nominal: 200, mass: 199.9768 },\n            { nominal: 201, mass: 200.97864 },\n            { nominal: 202, mass: 201.98199 },\n            { nominal: 203, mass: 202.98423 },\n            { nominal: 204, mass: 203.9896 },\n        ],\n        symbol: 'Ir',\n        mass: 192.2160516521,\n        name: 'Iridium',\n        monoisotopicMass: 192.9629216,\n    },\n    {\n        number: 78,\n        isotopes: [\n            { nominal: 166, mass: 165.99486 },\n            { nominal: 167, mass: 166.99269 },\n            { nominal: 168, mass: 167.98813 },\n            { nominal: 169, mass: 168.98657 },\n            { nominal: 170, mass: 169.982496 },\n            { nominal: 171, mass: 170.981245 },\n            { nominal: 172, mass: 171.977351 },\n            { nominal: 173, mass: 172.976443 },\n            { nominal: 174, mass: 173.97282 },\n            { nominal: 175, mass: 174.97241 },\n            { nominal: 176, mass: 175.968938 },\n            { nominal: 177, mass: 176.96847 },\n            { nominal: 178, mass: 177.96565 },\n            { nominal: 179, mass: 178.965359 },\n            { nominal: 180, mass: 179.963032 },\n            { nominal: 181, mass: 180.963098 },\n            { nominal: 182, mass: 181.961172 },\n            { nominal: 183, mass: 182.961597 },\n            { nominal: 184, mass: 183.959915 },\n            { nominal: 185, mass: 184.960614 },\n            { nominal: 186, mass: 185.959351 },\n            { nominal: 187, mass: 186.960617 },\n            { nominal: 188, mass: 187.9593889 },\n            { nominal: 189, mass: 188.960831 },\n            { nominal: 190, mass: 189.9599297, abundance: 0.00012 },\n            { nominal: 191, mass: 190.9616729 },\n            { nominal: 192, mass: 191.9610387, abundance: 0.00782 },\n            { nominal: 193, mass: 192.9629824 },\n            { nominal: 194, mass: 193.9626809, abundance: 0.3286 },\n            { nominal: 195, mass: 194.9647917, abundance: 0.3378 },\n            { nominal: 196, mass: 195.96495209, abundance: 0.2521 },\n            { nominal: 197, mass: 196.96734069 },\n            { nominal: 198, mass: 197.9678949, abundance: 0.07356 },\n            { nominal: 199, mass: 198.9705952 },\n            { nominal: 200, mass: 199.971443 },\n            { nominal: 201, mass: 200.974513 },\n            { nominal: 202, mass: 201.975639 },\n            { nominal: 203, mass: 202.97893 },\n            { nominal: 204, mass: 203.98076 },\n            { nominal: 205, mass: 204.98608 },\n            { nominal: 206, mass: 205.98966 },\n        ],\n        symbol: 'Pt',\n        mass: 195.084456864931,\n        name: 'Platinum',\n        monoisotopicMass: 194.9647917,\n    },\n    {\n        number: 79,\n        isotopes: [\n            { nominal: 169, mass: 168.99808 },\n            { nominal: 170, mass: 169.99597 },\n            { nominal: 171, mass: 170.991876 },\n            { nominal: 172, mass: 171.989942 },\n            { nominal: 173, mass: 172.986241 },\n            { nominal: 174, mass: 173.984717 },\n            { nominal: 175, mass: 174.981304 },\n            { nominal: 176, mass: 175.98025 },\n            { nominal: 177, mass: 176.97687 },\n            { nominal: 178, mass: 177.976032 },\n            { nominal: 179, mass: 178.973174 },\n            { nominal: 180, mass: 179.972523 },\n            { nominal: 181, mass: 180.970079 },\n            { nominal: 182, mass: 181.969618 },\n            { nominal: 183, mass: 182.967591 },\n            { nominal: 184, mass: 183.967452 },\n            { nominal: 185, mass: 184.96579 },\n            { nominal: 186, mass: 185.965953 },\n            { nominal: 187, mass: 186.964543 },\n            { nominal: 188, mass: 187.965349 },\n            { nominal: 189, mass: 188.963948 },\n            { nominal: 190, mass: 189.964698 },\n            { nominal: 191, mass: 190.963702 },\n            { nominal: 192, mass: 191.964814 },\n            { nominal: 193, mass: 192.9641373 },\n            { nominal: 194, mass: 193.9654178 },\n            { nominal: 195, mass: 194.9650352 },\n            { nominal: 196, mass: 195.9665699 },\n            { nominal: 197, mass: 196.96656879, abundance: 1 },\n            { nominal: 198, mass: 197.96824242 },\n            { nominal: 199, mass: 198.96876528 },\n            { nominal: 200, mass: 199.970756 },\n            { nominal: 201, mass: 200.9716575 },\n            { nominal: 202, mass: 201.973856 },\n            { nominal: 203, mass: 202.9751544 },\n            { nominal: 204, mass: 203.97783 },\n            { nominal: 205, mass: 204.97985 },\n            { nominal: 206, mass: 205.98474 },\n            { nominal: 207, mass: 206.9884 },\n            { nominal: 208, mass: 207.99345 },\n            { nominal: 209, mass: 208.99735 },\n            { nominal: 210, mass: 210.0025 },\n        ],\n        symbol: 'Au',\n        mass: 196.96656879,\n        name: 'Gold',\n        monoisotopicMass: 196.96656879,\n    },\n    {\n        number: 80,\n        isotopes: [\n            { nominal: 171, mass: 171.00353 },\n            { nominal: 172, mass: 171.99881 },\n            { nominal: 173, mass: 172.99709 },\n            { nominal: 174, mass: 173.992865 },\n            { nominal: 175, mass: 174.991441 },\n            { nominal: 176, mass: 175.987361 },\n            { nominal: 177, mass: 176.986277 },\n            { nominal: 178, mass: 177.982484 },\n            { nominal: 179, mass: 178.981831 },\n            { nominal: 180, mass: 179.97826 },\n            { nominal: 181, mass: 180.977819 },\n            { nominal: 182, mass: 181.974689 },\n            { nominal: 183, mass: 182.9744448 },\n            { nominal: 184, mass: 183.971714 },\n            { nominal: 185, mass: 184.971899 },\n            { nominal: 186, mass: 185.969362 },\n            { nominal: 187, mass: 186.969814 },\n            { nominal: 188, mass: 187.967567 },\n            { nominal: 189, mass: 188.968195 },\n            { nominal: 190, mass: 189.966323 },\n            { nominal: 191, mass: 190.967157 },\n            { nominal: 192, mass: 191.965635 },\n            { nominal: 193, mass: 192.966653 },\n            { nominal: 194, mass: 193.9654491 },\n            { nominal: 195, mass: 194.966721 },\n            { nominal: 196, mass: 195.9658326, abundance: 0.0015 },\n            { nominal: 197, mass: 196.9672128 },\n            { nominal: 198, mass: 197.9667686, abundance: 0.0997 },\n            { nominal: 199, mass: 198.96828064, abundance: 0.1687 },\n            { nominal: 200, mass: 199.96832659, abundance: 0.231 },\n            { nominal: 201, mass: 200.97030284, abundance: 0.1318 },\n            { nominal: 202, mass: 201.9706434, abundance: 0.2986 },\n            { nominal: 203, mass: 202.9728728 },\n            { nominal: 204, mass: 203.97349398, abundance: 0.0687 },\n            { nominal: 205, mass: 204.9760734 },\n            { nominal: 206, mass: 205.977514 },\n            { nominal: 207, mass: 206.9823 },\n            { nominal: 208, mass: 207.985759 },\n            { nominal: 209, mass: 208.99072 },\n            { nominal: 210, mass: 209.99424 },\n            { nominal: 211, mass: 210.99933 },\n            { nominal: 212, mass: 212.00296 },\n            { nominal: 213, mass: 213.00823 },\n            { nominal: 214, mass: 214.012 },\n            { nominal: 215, mass: 215.0174 },\n            { nominal: 216, mass: 216.02132 },\n        ],\n        symbol: 'Hg',\n        mass: 200.59916703455602,\n        name: 'Mercury',\n        monoisotopicMass: 201.9706434,\n    },\n    {\n        number: 81,\n        isotopes: [\n            { nominal: 176, mass: 176.000624 },\n            { nominal: 177, mass: 176.996431 },\n            { nominal: 178, mass: 177.99485 },\n            { nominal: 179, mass: 178.991111 },\n            { nominal: 180, mass: 179.990057 },\n            { nominal: 181, mass: 180.98626 },\n            { nominal: 182, mass: 181.985713 },\n            { nominal: 183, mass: 182.982193 },\n            { nominal: 184, mass: 183.981886 },\n            { nominal: 185, mass: 184.978789 },\n            { nominal: 186, mass: 185.978651 },\n            { nominal: 187, mass: 186.9759063 },\n            { nominal: 188, mass: 187.976021 },\n            { nominal: 189, mass: 188.973588 },\n            { nominal: 190, mass: 189.973828 },\n            { nominal: 191, mass: 190.9717842 },\n            { nominal: 192, mass: 191.972225 },\n            { nominal: 193, mass: 192.970502 },\n            { nominal: 194, mass: 193.971081 },\n            { nominal: 195, mass: 194.969774 },\n            { nominal: 196, mass: 195.970481 },\n            { nominal: 197, mass: 196.969576 },\n            { nominal: 198, mass: 197.970483 },\n            { nominal: 199, mass: 198.969877 },\n            { nominal: 200, mass: 199.9709633 },\n            { nominal: 201, mass: 200.970822 },\n            { nominal: 202, mass: 201.972102 },\n            { nominal: 203, mass: 202.9723446, abundance: 0.2952 },\n            { nominal: 204, mass: 203.9738639 },\n            { nominal: 205, mass: 204.9744278, abundance: 0.7048 },\n            { nominal: 206, mass: 205.9761106 },\n            { nominal: 207, mass: 206.9774197 },\n            { nominal: 208, mass: 207.982019 },\n            { nominal: 209, mass: 208.9853594 },\n            { nominal: 210, mass: 209.990074 },\n            { nominal: 211, mass: 210.993475 },\n            { nominal: 212, mass: 211.99834 },\n            { nominal: 213, mass: 213.001915 },\n            { nominal: 214, mass: 214.00694 },\n            { nominal: 215, mass: 215.01064 },\n            { nominal: 216, mass: 216.0158 },\n            { nominal: 217, mass: 217.01966 },\n            { nominal: 218, mass: 218.02479 },\n        ],\n        symbol: 'Tl',\n        mass: 204.38341283936,\n        name: 'Thallium',\n        monoisotopicMass: 204.9744278,\n    },\n    {\n        number: 82,\n        isotopes: [\n            { nominal: 178, mass: 178.003831 },\n            { nominal: 179, mass: 179.002201 },\n            { nominal: 180, mass: 179.997928 },\n            { nominal: 181, mass: 180.996653 },\n            { nominal: 182, mass: 181.992672 },\n            { nominal: 183, mass: 182.991872 },\n            { nominal: 184, mass: 183.988136 },\n            { nominal: 185, mass: 184.98761 },\n            { nominal: 186, mass: 185.984238 },\n            { nominal: 187, mass: 186.9839109 },\n            { nominal: 188, mass: 187.980875 },\n            { nominal: 189, mass: 188.980807 },\n            { nominal: 190, mass: 189.978082 },\n            { nominal: 191, mass: 190.978276 },\n            { nominal: 192, mass: 191.975775 },\n            { nominal: 193, mass: 192.976173 },\n            { nominal: 194, mass: 193.974012 },\n            { nominal: 195, mass: 194.974543 },\n            { nominal: 196, mass: 195.972774 },\n            { nominal: 197, mass: 196.9734312 },\n            { nominal: 198, mass: 197.972034 },\n            { nominal: 199, mass: 198.972913 },\n            { nominal: 200, mass: 199.971819 },\n            { nominal: 201, mass: 200.972883 },\n            { nominal: 202, mass: 201.972152 },\n            { nominal: 203, mass: 202.9733911 },\n            { nominal: 204, mass: 203.973044, abundance: 0.014 },\n            { nominal: 205, mass: 204.9744822 },\n            { nominal: 206, mass: 205.9744657, abundance: 0.241 },\n            { nominal: 207, mass: 206.9758973, abundance: 0.221 },\n            { nominal: 208, mass: 207.9766525, abundance: 0.524 },\n            { nominal: 209, mass: 208.9810905 },\n            { nominal: 210, mass: 209.9841889 },\n            { nominal: 211, mass: 210.9887371 },\n            { nominal: 212, mass: 211.9918977 },\n            { nominal: 213, mass: 212.9965629 },\n            { nominal: 214, mass: 213.9998059 },\n            { nominal: 215, mass: 215.00474 },\n            { nominal: 216, mass: 216.00803 },\n            { nominal: 217, mass: 217.01314 },\n            { nominal: 218, mass: 218.01659 },\n            { nominal: 219, mass: 219.02177 },\n            { nominal: 220, mass: 220.02541 },\n        ],\n        symbol: 'Pb',\n        mass: 207.216908063,\n        name: 'Lead',\n        monoisotopicMass: 207.9766525,\n    },\n    {\n        number: 83,\n        isotopes: [\n            { nominal: 184, mass: 184.001275 },\n            { nominal: 185, mass: 184.9976 },\n            { nominal: 186, mass: 185.996644 },\n            { nominal: 187, mass: 186.993147 },\n            { nominal: 188, mass: 187.992287 },\n            { nominal: 189, mass: 188.989195 },\n            { nominal: 190, mass: 189.988622 },\n            { nominal: 191, mass: 190.9857866 },\n            { nominal: 192, mass: 191.985469 },\n            { nominal: 193, mass: 192.98296 },\n            { nominal: 194, mass: 193.982785 },\n            { nominal: 195, mass: 194.9806488 },\n            { nominal: 196, mass: 195.980667 },\n            { nominal: 197, mass: 196.9788651 },\n            { nominal: 198, mass: 197.979206 },\n            { nominal: 199, mass: 198.977673 },\n            { nominal: 200, mass: 199.978131 },\n            { nominal: 201, mass: 200.97701 },\n            { nominal: 202, mass: 201.977734 },\n            { nominal: 203, mass: 202.976893 },\n            { nominal: 204, mass: 203.9778361 },\n            { nominal: 205, mass: 204.9773867 },\n            { nominal: 206, mass: 205.9784993 },\n            { nominal: 207, mass: 206.978471 },\n            { nominal: 208, mass: 207.9797425 },\n            { nominal: 209, mass: 208.9803991, abundance: 1 },\n            { nominal: 210, mass: 209.9841207 },\n            { nominal: 211, mass: 210.9872697 },\n            { nominal: 212, mass: 211.991286 },\n            { nominal: 213, mass: 212.9943851 },\n            { nominal: 214, mass: 213.998712 },\n            { nominal: 215, mass: 215.00177 },\n            { nominal: 216, mass: 216.006306 },\n            { nominal: 217, mass: 217.009372 },\n            { nominal: 218, mass: 218.014188 },\n            { nominal: 219, mass: 219.01748 },\n            { nominal: 220, mass: 220.02235 },\n            { nominal: 221, mass: 221.02587 },\n            { nominal: 222, mass: 222.03078 },\n            { nominal: 223, mass: 223.0345 },\n            { nominal: 224, mass: 224.03947 },\n        ],\n        symbol: 'Bi',\n        mass: 208.9803991,\n        name: 'Bismuth',\n        monoisotopicMass: 208.9803991,\n    },\n    {\n        number: 84,\n        isotopes: [\n            { nominal: 186, mass: 186.004393 },\n            { nominal: 187, mass: 187.003041 },\n            { nominal: 188, mass: 187.999416 },\n            { nominal: 189, mass: 188.998473 },\n            { nominal: 190, mass: 189.995101 },\n            { nominal: 191, mass: 190.9945585 },\n            { nominal: 192, mass: 191.991336 },\n            { nominal: 193, mass: 192.991026 },\n            { nominal: 194, mass: 193.988186 },\n            { nominal: 195, mass: 194.988126 },\n            { nominal: 196, mass: 195.985526 },\n            { nominal: 197, mass: 196.98566 },\n            { nominal: 198, mass: 197.983389 },\n            { nominal: 199, mass: 198.983667 },\n            { nominal: 200, mass: 199.981799 },\n            { nominal: 201, mass: 200.9822598 },\n            { nominal: 202, mass: 201.980758 },\n            { nominal: 203, mass: 202.9814161 },\n            { nominal: 204, mass: 203.98031 },\n            { nominal: 205, mass: 204.981203 },\n            { nominal: 206, mass: 205.980474 },\n            { nominal: 207, mass: 206.9815938 },\n            { nominal: 208, mass: 207.9812461 },\n            { nominal: 209, mass: 208.9824308 },\n            { nominal: 210, mass: 209.9828741 },\n            { nominal: 211, mass: 210.9866536 },\n            { nominal: 212, mass: 211.9888684 },\n            { nominal: 213, mass: 212.9928576 },\n            { nominal: 214, mass: 213.9952017 },\n            { nominal: 215, mass: 214.9994201 },\n            { nominal: 216, mass: 216.0019152 },\n            { nominal: 217, mass: 217.0063182 },\n            { nominal: 218, mass: 218.0089735 },\n            { nominal: 219, mass: 219.013614 },\n            { nominal: 220, mass: 220.016386 },\n            { nominal: 221, mass: 221.021228 },\n            { nominal: 222, mass: 222.02414 },\n            { nominal: 223, mass: 223.02907 },\n            { nominal: 224, mass: 224.03211 },\n            { nominal: 225, mass: 225.03707 },\n            { nominal: 226, mass: 226.04031 },\n            { nominal: 227, mass: 227.04539 },\n        ],\n        symbol: 'Po',\n        mass: null,\n        name: 'Polonium',\n    },\n    {\n        number: 85,\n        isotopes: [\n            { nominal: 191, mass: 191.004148 },\n            { nominal: 192, mass: 192.003152 },\n            { nominal: 193, mass: 192.999927 },\n            { nominal: 194, mass: 193.999236 },\n            { nominal: 195, mass: 194.9962685 },\n            { nominal: 196, mass: 195.9958 },\n            { nominal: 197, mass: 196.993189 },\n            { nominal: 198, mass: 197.992784 },\n            { nominal: 199, mass: 198.9905277 },\n            { nominal: 200, mass: 199.990351 },\n            { nominal: 201, mass: 200.9884171 },\n            { nominal: 202, mass: 201.98863 },\n            { nominal: 203, mass: 202.986943 },\n            { nominal: 204, mass: 203.987251 },\n            { nominal: 205, mass: 204.986076 },\n            { nominal: 206, mass: 205.986657 },\n            { nominal: 207, mass: 206.9858 },\n            { nominal: 208, mass: 207.9866133 },\n            { nominal: 209, mass: 208.9861702 },\n            { nominal: 210, mass: 209.9871479 },\n            { nominal: 211, mass: 210.9874966 },\n            { nominal: 212, mass: 211.9907377 },\n            { nominal: 213, mass: 212.992937 },\n            { nominal: 214, mass: 213.9963721 },\n            { nominal: 215, mass: 214.9986528 },\n            { nominal: 216, mass: 216.0024236 },\n            { nominal: 217, mass: 217.0047192 },\n            { nominal: 218, mass: 218.008695 },\n            { nominal: 219, mass: 219.0111618 },\n            { nominal: 220, mass: 220.015433 },\n            { nominal: 221, mass: 221.018017 },\n            { nominal: 222, mass: 222.022494 },\n            { nominal: 223, mass: 223.025151 },\n            { nominal: 224, mass: 224.029749 },\n            { nominal: 225, mass: 225.03263 },\n            { nominal: 226, mass: 226.03716 },\n            { nominal: 227, mass: 227.04024 },\n            { nominal: 228, mass: 228.04475 },\n            { nominal: 229, mass: 229.04812 },\n        ],\n        symbol: 'At',\n        mass: null,\n        name: 'Astatine',\n    },\n    {\n        number: 86,\n        isotopes: [\n            { nominal: 193, mass: 193.009708 },\n            { nominal: 194, mass: 194.006144 },\n            { nominal: 195, mass: 195.005422 },\n            { nominal: 196, mass: 196.002116 },\n            { nominal: 197, mass: 197.001585 },\n            { nominal: 198, mass: 197.998679 },\n            { nominal: 199, mass: 198.99839 },\n            { nominal: 200, mass: 199.99569 },\n            { nominal: 201, mass: 200.995628 },\n            { nominal: 202, mass: 201.993264 },\n            { nominal: 203, mass: 202.993388 },\n            { nominal: 204, mass: 203.99143 },\n            { nominal: 205, mass: 204.991719 },\n            { nominal: 206, mass: 205.990214 },\n            { nominal: 207, mass: 206.9907303 },\n            { nominal: 208, mass: 207.989635 },\n            { nominal: 209, mass: 208.990415 },\n            { nominal: 210, mass: 209.9896891 },\n            { nominal: 211, mass: 210.9906011 },\n            { nominal: 212, mass: 211.9907039 },\n            { nominal: 213, mass: 212.9938831 },\n            { nominal: 214, mass: 213.995363 },\n            { nominal: 215, mass: 214.9987459 },\n            { nominal: 216, mass: 216.0002719 },\n            { nominal: 217, mass: 217.003928 },\n            { nominal: 218, mass: 218.0056016 },\n            { nominal: 219, mass: 219.0094804 },\n            { nominal: 220, mass: 220.0113941 },\n            { nominal: 221, mass: 221.0155371 },\n            { nominal: 222, mass: 222.0175782 },\n            { nominal: 223, mass: 223.0218893 },\n            { nominal: 224, mass: 224.024096 },\n            { nominal: 225, mass: 225.028486 },\n            { nominal: 226, mass: 226.030861 },\n            { nominal: 227, mass: 227.035304 },\n            { nominal: 228, mass: 228.037835 },\n            { nominal: 229, mass: 229.042257 },\n            { nominal: 230, mass: 230.04514 },\n            { nominal: 231, mass: 231.04987 },\n        ],\n        symbol: 'Rn',\n        mass: null,\n        name: 'Radon',\n    },\n    {\n        number: 87,\n        isotopes: [\n            { nominal: 199, mass: 199.007259 },\n            { nominal: 200, mass: 200.006586 },\n            { nominal: 201, mass: 201.003867 },\n            { nominal: 202, mass: 202.00332 },\n            { nominal: 203, mass: 203.0009407 },\n            { nominal: 204, mass: 204.000652 },\n            { nominal: 205, mass: 204.9985939 },\n            { nominal: 206, mass: 205.998666 },\n            { nominal: 207, mass: 206.996946 },\n            { nominal: 208, mass: 207.997138 },\n            { nominal: 209, mass: 208.995955 },\n            { nominal: 210, mass: 209.996422 },\n            { nominal: 211, mass: 210.995556 },\n            { nominal: 212, mass: 211.9962257 },\n            { nominal: 213, mass: 212.996186 },\n            { nominal: 214, mass: 213.9989713 },\n            { nominal: 215, mass: 215.0003418 },\n            { nominal: 216, mass: 216.0031899 },\n            { nominal: 217, mass: 217.0046323 },\n            { nominal: 218, mass: 218.0075787 },\n            { nominal: 219, mass: 219.0092524 },\n            { nominal: 220, mass: 220.0123277 },\n            { nominal: 221, mass: 221.0142552 },\n            { nominal: 222, mass: 222.017552 },\n            { nominal: 223, mass: 223.019736 },\n            { nominal: 224, mass: 224.023398 },\n            { nominal: 225, mass: 225.025573 },\n            { nominal: 226, mass: 226.029566 },\n            { nominal: 227, mass: 227.031869 },\n            { nominal: 228, mass: 228.035823 },\n            { nominal: 229, mass: 229.038298 },\n            { nominal: 230, mass: 230.042416 },\n            { nominal: 231, mass: 231.045158 },\n            { nominal: 232, mass: 232.04937 },\n            { nominal: 233, mass: 233.05264 },\n        ],\n        symbol: 'Fr',\n        mass: null,\n        name: 'Francium',\n    },\n    {\n        number: 88,\n        isotopes: [\n            { nominal: 201, mass: 201.01271 },\n            { nominal: 202, mass: 202.00976 },\n            { nominal: 203, mass: 203.009304 },\n            { nominal: 204, mass: 204.006492 },\n            { nominal: 205, mass: 205.006268 },\n            { nominal: 206, mass: 206.003828 },\n            { nominal: 207, mass: 207.003799 },\n            { nominal: 208, mass: 208.001841 },\n            { nominal: 209, mass: 209.00199 },\n            { nominal: 210, mass: 210.000494 },\n            { nominal: 211, mass: 211.0008932 },\n            { nominal: 212, mass: 211.999787 },\n            { nominal: 213, mass: 213.000384 },\n            { nominal: 214, mass: 214.0000997 },\n            { nominal: 215, mass: 215.0027204 },\n            { nominal: 216, mass: 216.0035334 },\n            { nominal: 217, mass: 217.0063207 },\n            { nominal: 218, mass: 218.007141 },\n            { nominal: 219, mass: 219.0100855 },\n            { nominal: 220, mass: 220.0110259 },\n            { nominal: 221, mass: 221.0139177 },\n            { nominal: 222, mass: 222.0153748 },\n            { nominal: 223, mass: 223.0185023 },\n            { nominal: 224, mass: 224.020212 },\n            { nominal: 225, mass: 225.0236119 },\n            { nominal: 226, mass: 226.0254103 },\n            { nominal: 227, mass: 227.0291783 },\n            { nominal: 228, mass: 228.0310707 },\n            { nominal: 229, mass: 229.034942 },\n            { nominal: 230, mass: 230.037055 },\n            { nominal: 231, mass: 231.041027 },\n            { nominal: 232, mass: 232.0434753 },\n            { nominal: 233, mass: 233.047582 },\n            { nominal: 234, mass: 234.050342 },\n            { nominal: 235, mass: 235.05497 },\n        ],\n        symbol: 'Ra',\n        mass: null,\n        name: 'Radium',\n    },\n    {\n        number: 89,\n        isotopes: [\n            { nominal: 206, mass: 206.014452 },\n            { nominal: 207, mass: 207.011966 },\n            { nominal: 208, mass: 208.01155 },\n            { nominal: 209, mass: 209.009495 },\n            { nominal: 210, mass: 210.009436 },\n            { nominal: 211, mass: 211.007732 },\n            { nominal: 212, mass: 212.007813 },\n            { nominal: 213, mass: 213.006609 },\n            { nominal: 214, mass: 214.006918 },\n            { nominal: 215, mass: 215.006475 },\n            { nominal: 216, mass: 216.008743 },\n            { nominal: 217, mass: 217.009344 },\n            { nominal: 218, mass: 218.011642 },\n            { nominal: 219, mass: 219.012421 },\n            { nominal: 220, mass: 220.0147549 },\n            { nominal: 221, mass: 221.015592 },\n            { nominal: 222, mass: 222.0178442 },\n            { nominal: 223, mass: 223.0191377 },\n            { nominal: 224, mass: 224.0217232 },\n            { nominal: 225, mass: 225.02323 },\n            { nominal: 226, mass: 226.0260984 },\n            { nominal: 227, mass: 227.0277523 },\n            { nominal: 228, mass: 228.0310215 },\n            { nominal: 229, mass: 229.032956 },\n            { nominal: 230, mass: 230.036327 },\n            { nominal: 231, mass: 231.038393 },\n            { nominal: 232, mass: 232.042034 },\n            { nominal: 233, mass: 233.044346 },\n            { nominal: 234, mass: 234.048139 },\n            { nominal: 235, mass: 235.05084 },\n            { nominal: 236, mass: 236.054988 },\n            { nominal: 237, mass: 237.05827 },\n        ],\n        symbol: 'Ac',\n        mass: null,\n        name: 'Actinium',\n    },\n    {\n        number: 90,\n        isotopes: [\n            { nominal: 208, mass: 208.0179 },\n            { nominal: 209, mass: 209.017753 },\n            { nominal: 210, mass: 210.015094 },\n            { nominal: 211, mass: 211.014929 },\n            { nominal: 212, mass: 212.012988 },\n            { nominal: 213, mass: 213.013009 },\n            { nominal: 214, mass: 214.0115 },\n            { nominal: 215, mass: 215.0117248 },\n            { nominal: 216, mass: 216.011056 },\n            { nominal: 217, mass: 217.013117 },\n            { nominal: 218, mass: 218.013276 },\n            { nominal: 219, mass: 219.015537 },\n            { nominal: 220, mass: 220.015748 },\n            { nominal: 221, mass: 221.018184 },\n            { nominal: 222, mass: 222.018469 },\n            { nominal: 223, mass: 223.0208119 },\n            { nominal: 224, mass: 224.021464 },\n            { nominal: 225, mass: 225.0239514 },\n            { nominal: 226, mass: 226.0249034 },\n            { nominal: 227, mass: 227.0277042 },\n            { nominal: 228, mass: 228.0287413 },\n            { nominal: 229, mass: 229.0317627 },\n            { nominal: 230, mass: 230.0331341 },\n            { nominal: 231, mass: 231.0363046 },\n            { nominal: 232, mass: 232.0380558, abundance: 1 },\n            { nominal: 233, mass: 233.0415823 },\n            { nominal: 234, mass: 234.0436014 },\n            { nominal: 235, mass: 235.047255 },\n            { nominal: 236, mass: 236.049657 },\n            { nominal: 237, mass: 237.053629 },\n            { nominal: 238, mass: 238.0565 },\n            { nominal: 239, mass: 239.06077 },\n        ],\n        symbol: 'Th',\n        mass: 232.0380558,\n        name: 'Thorium',\n        monoisotopicMass: 232.0380558,\n    },\n    {\n        number: 91,\n        isotopes: [\n            { nominal: 212, mass: 212.023203 },\n            { nominal: 213, mass: 213.021109 },\n            { nominal: 214, mass: 214.020918 },\n            { nominal: 215, mass: 215.019183 },\n            { nominal: 216, mass: 216.019109 },\n            { nominal: 217, mass: 217.018325 },\n            { nominal: 218, mass: 218.020059 },\n            { nominal: 219, mass: 219.019904 },\n            { nominal: 220, mass: 220.021705 },\n            { nominal: 221, mass: 221.021875 },\n            { nominal: 222, mass: 222.023784 },\n            { nominal: 223, mass: 223.023963 },\n            { nominal: 224, mass: 224.0256176 },\n            { nominal: 225, mass: 225.026131 },\n            { nominal: 226, mass: 226.027948 },\n            { nominal: 227, mass: 227.0288054 },\n            { nominal: 228, mass: 228.0310517 },\n            { nominal: 229, mass: 229.0320972 },\n            { nominal: 230, mass: 230.034541 },\n            { nominal: 231, mass: 231.0358842, abundance: 1 },\n            { nominal: 232, mass: 232.0385917 },\n            { nominal: 233, mass: 233.0402472 },\n            { nominal: 234, mass: 234.0433072 },\n            { nominal: 235, mass: 235.045399 },\n            { nominal: 236, mass: 236.048668 },\n            { nominal: 237, mass: 237.051023 },\n            { nominal: 238, mass: 238.054637 },\n            { nominal: 239, mass: 239.05726 },\n            { nominal: 240, mass: 240.06098 },\n            { nominal: 241, mass: 241.06408 },\n        ],\n        symbol: 'Pa',\n        mass: 231.0358842,\n        name: 'Protactinium',\n        monoisotopicMass: 231.0358842,\n    },\n    {\n        number: 92,\n        isotopes: [\n            { nominal: 217, mass: 217.02466 },\n            { nominal: 218, mass: 218.023523 },\n            { nominal: 219, mass: 219.024999 },\n            { nominal: 220, mass: 220.02462 },\n            { nominal: 221, mass: 221.02628 },\n            { nominal: 222, mass: 222.026 },\n            { nominal: 223, mass: 223.027739 },\n            { nominal: 224, mass: 224.027605 },\n            { nominal: 225, mass: 225.029391 },\n            { nominal: 226, mass: 226.029339 },\n            { nominal: 227, mass: 227.031157 },\n            { nominal: 228, mass: 228.031371 },\n            { nominal: 229, mass: 229.0335063 },\n            { nominal: 230, mass: 230.0339401 },\n            { nominal: 231, mass: 231.0362939 },\n            { nominal: 232, mass: 232.0371563 },\n            { nominal: 233, mass: 233.0396355 },\n            { nominal: 234, mass: 234.0409523, abundance: 0.000054 },\n            { nominal: 235, mass: 235.0439301, abundance: 0.007204 },\n            { nominal: 236, mass: 236.0455682 },\n            { nominal: 237, mass: 237.0487304 },\n            { nominal: 238, mass: 238.0507884, abundance: 0.992742 },\n            { nominal: 239, mass: 239.0542935 },\n            { nominal: 240, mass: 240.0565934 },\n            { nominal: 241, mass: 241.06033 },\n            { nominal: 242, mass: 242.06293 },\n            { nominal: 243, mass: 243.06699 },\n        ],\n        symbol: 'U',\n        mass: 238.0289104616574,\n        name: 'Uranium',\n        monoisotopicMass: 238.0507884,\n    },\n    {\n        number: 93,\n        isotopes: [\n            { nominal: 219, mass: 219.03143 },\n            { nominal: 220, mass: 220.03254 },\n            { nominal: 221, mass: 221.03204 },\n            { nominal: 222, mass: 222.0333 },\n            { nominal: 223, mass: 223.03285 },\n            { nominal: 224, mass: 224.03422 },\n            { nominal: 225, mass: 225.033911 },\n            { nominal: 226, mass: 226.035188 },\n            { nominal: 227, mass: 227.034957 },\n            { nominal: 228, mass: 228.036067 },\n            { nominal: 229, mass: 229.036264 },\n            { nominal: 230, mass: 230.037828 },\n            { nominal: 231, mass: 231.038245 },\n            { nominal: 232, mass: 232.04011 },\n            { nominal: 233, mass: 233.040741 },\n            { nominal: 234, mass: 234.0428953 },\n            { nominal: 235, mass: 235.0440635 },\n            { nominal: 236, mass: 236.04657 },\n            { nominal: 237, mass: 237.0481736 },\n            { nominal: 238, mass: 238.0509466 },\n            { nominal: 239, mass: 239.0529392 },\n            { nominal: 240, mass: 240.056165 },\n            { nominal: 241, mass: 241.058253 },\n            { nominal: 242, mass: 242.06164 },\n            { nominal: 243, mass: 243.06428 },\n            { nominal: 244, mass: 244.06785 },\n            { nominal: 245, mass: 245.0708 },\n        ],\n        symbol: 'Np',\n        mass: null,\n        name: 'Neptunium',\n    },\n    {\n        number: 94,\n        isotopes: [\n            { nominal: 228, mass: 228.038732 },\n            { nominal: 229, mass: 229.040144 },\n            { nominal: 230, mass: 230.03965 },\n            { nominal: 231, mass: 231.041102 },\n            { nominal: 232, mass: 232.041185 },\n            { nominal: 233, mass: 233.042998 },\n            { nominal: 234, mass: 234.0433174 },\n            { nominal: 235, mass: 235.045286 },\n            { nominal: 236, mass: 236.0460581 },\n            { nominal: 237, mass: 237.0484098 },\n            { nominal: 238, mass: 238.0495601 },\n            { nominal: 239, mass: 239.0521636 },\n            { nominal: 240, mass: 240.0538138 },\n            { nominal: 241, mass: 241.0568517 },\n            { nominal: 242, mass: 242.0587428 },\n            { nominal: 243, mass: 243.0620036 },\n            { nominal: 244, mass: 244.0642053 },\n            { nominal: 245, mass: 245.067826 },\n            { nominal: 246, mass: 246.070205 },\n            { nominal: 247, mass: 247.07419 },\n        ],\n        symbol: 'Pu',\n        mass: null,\n        name: 'Plutonium',\n    },\n    {\n        number: 95,\n        isotopes: [\n            { nominal: 230, mass: 230.04609 },\n            { nominal: 231, mass: 231.04556 },\n            { nominal: 232, mass: 232.04645 },\n            { nominal: 233, mass: 233.04644 },\n            { nominal: 234, mass: 234.04773 },\n            { nominal: 235, mass: 235.047908 },\n            { nominal: 236, mass: 236.04943 },\n            { nominal: 237, mass: 237.049996 },\n            { nominal: 238, mass: 238.051985 },\n            { nominal: 239, mass: 239.0530247 },\n            { nominal: 240, mass: 240.0553 },\n            { nominal: 241, mass: 241.0568293 },\n            { nominal: 242, mass: 242.0595494 },\n            { nominal: 243, mass: 243.0613813 },\n            { nominal: 244, mass: 244.0642851 },\n            { nominal: 245, mass: 245.0664548 },\n            { nominal: 246, mass: 246.069775 },\n            { nominal: 247, mass: 247.07209 },\n            { nominal: 248, mass: 248.07575 },\n            { nominal: 249, mass: 249.07848 },\n        ],\n        symbol: 'Am',\n        name: 'Americium',\n        mass: null,\n    },\n    {\n        number: 96,\n        isotopes: [\n            { nominal: 232, mass: 232.04982 },\n            { nominal: 233, mass: 233.05077 },\n            { nominal: 234, mass: 234.05016 },\n            { nominal: 235, mass: 235.05154 },\n            { nominal: 236, mass: 236.051374 },\n            { nominal: 237, mass: 237.052869 },\n            { nominal: 238, mass: 238.053081 },\n            { nominal: 239, mass: 239.05491 },\n            { nominal: 240, mass: 240.0555297 },\n            { nominal: 241, mass: 241.0576532 },\n            { nominal: 242, mass: 242.058836 },\n            { nominal: 243, mass: 243.0613893 },\n            { nominal: 244, mass: 244.0627528 },\n            { nominal: 245, mass: 245.0654915 },\n            { nominal: 246, mass: 246.0672238 },\n            { nominal: 247, mass: 247.0703541 },\n            { nominal: 248, mass: 248.0723499 },\n            { nominal: 249, mass: 249.0759548 },\n            { nominal: 250, mass: 250.078358 },\n            { nominal: 251, mass: 251.082286 },\n            { nominal: 252, mass: 252.08487 },\n        ],\n        symbol: 'Cm',\n        name: 'Curium',\n        mass: null,\n    },\n    {\n        number: 97,\n        isotopes: [\n            { nominal: 234, mass: 234.05727 },\n            { nominal: 235, mass: 235.05658 },\n            { nominal: 236, mass: 236.05748 },\n            { nominal: 237, mass: 237.0571 },\n            { nominal: 238, mass: 238.0582 },\n            { nominal: 239, mass: 239.05824 },\n            { nominal: 240, mass: 240.05976 },\n            { nominal: 241, mass: 241.06016 },\n            { nominal: 242, mass: 242.06198 },\n            { nominal: 243, mass: 243.0630078 },\n            { nominal: 244, mass: 244.065181 },\n            { nominal: 245, mass: 245.0663618 },\n            { nominal: 246, mass: 246.068673 },\n            { nominal: 247, mass: 247.0703073 },\n            { nominal: 248, mass: 248.073088 },\n            { nominal: 249, mass: 249.0749877 },\n            { nominal: 250, mass: 250.0783167 },\n            { nominal: 251, mass: 251.080762 },\n            { nominal: 252, mass: 252.08431 },\n            { nominal: 253, mass: 253.08688 },\n            { nominal: 254, mass: 254.0906 },\n        ],\n        symbol: 'Bk',\n        name: 'Berkelium',\n        mass: null,\n    },\n    {\n        number: 98,\n        isotopes: [\n            { nominal: 237, mass: 237.062198 },\n            { nominal: 238, mass: 238.06149 },\n            { nominal: 239, mass: 239.06253 },\n            { nominal: 240, mass: 240.062256 },\n            { nominal: 241, mass: 241.06369 },\n            { nominal: 242, mass: 242.063754 },\n            { nominal: 243, mass: 243.06548 },\n            { nominal: 244, mass: 244.0660008 },\n            { nominal: 245, mass: 245.0680487 },\n            { nominal: 246, mass: 246.0688055 },\n            { nominal: 247, mass: 247.070965 },\n            { nominal: 248, mass: 248.0721851 },\n            { nominal: 249, mass: 249.0748539 },\n            { nominal: 250, mass: 250.0764062 },\n            { nominal: 251, mass: 251.0795886 },\n            { nominal: 252, mass: 252.0816272 },\n            { nominal: 253, mass: 253.0851345 },\n            { nominal: 254, mass: 254.087324 },\n            { nominal: 255, mass: 255.09105 },\n            { nominal: 256, mass: 256.09344 },\n        ],\n        symbol: 'Cf',\n        name: 'Californium',\n        mass: null,\n    },\n    {\n        number: 99,\n        isotopes: [\n            { nominal: 239, mass: 239.06823 },\n            { nominal: 240, mass: 240.06892 },\n            { nominal: 241, mass: 241.06856 },\n            { nominal: 242, mass: 242.06957 },\n            { nominal: 243, mass: 243.06951 },\n            { nominal: 244, mass: 244.07088 },\n            { nominal: 245, mass: 245.07125 },\n            { nominal: 246, mass: 246.0729 },\n            { nominal: 247, mass: 247.073622 },\n            { nominal: 248, mass: 248.075471 },\n            { nominal: 249, mass: 249.076411 },\n            { nominal: 250, mass: 250.07861 },\n            { nominal: 251, mass: 251.0799936 },\n            { nominal: 252, mass: 252.08298 },\n            { nominal: 253, mass: 253.0848257 },\n            { nominal: 254, mass: 254.0880222 },\n            { nominal: 255, mass: 255.090275 },\n            { nominal: 256, mass: 256.0936 },\n            { nominal: 257, mass: 257.09598 },\n            { nominal: 258, mass: 258.09952 },\n        ],\n        symbol: 'Es',\n        name: 'Einsteinium',\n        mass: null,\n    },\n    {\n        number: 100,\n        isotopes: [\n            { nominal: 241, mass: 241.07421 },\n            { nominal: 242, mass: 242.07343 },\n            { nominal: 243, mass: 243.07446 },\n            { nominal: 244, mass: 244.07404 },\n            { nominal: 245, mass: 245.07535 },\n            { nominal: 246, mass: 246.07535 },\n            { nominal: 247, mass: 247.07694 },\n            { nominal: 248, mass: 248.0771865 },\n            { nominal: 249, mass: 249.0789275 },\n            { nominal: 250, mass: 250.079521 },\n            { nominal: 251, mass: 251.08154 },\n            { nominal: 252, mass: 252.0824671 },\n            { nominal: 253, mass: 253.0851846 },\n            { nominal: 254, mass: 254.0868544 },\n            { nominal: 255, mass: 255.089964 },\n            { nominal: 256, mass: 256.0917745 },\n            { nominal: 257, mass: 257.0951061 },\n            { nominal: 258, mass: 258.09708 },\n            { nominal: 259, mass: 259.1006 },\n            { nominal: 260, mass: 260.10281 },\n        ],\n        symbol: 'Fm',\n        name: 'Fermium',\n        mass: null,\n    },\n    {\n        number: 101,\n        isotopes: [\n            { nominal: 245, mass: 245.08081 },\n            { nominal: 246, mass: 246.08171 },\n            { nominal: 247, mass: 247.08152 },\n            { nominal: 248, mass: 248.08282 },\n            { nominal: 249, mass: 249.08291 },\n            { nominal: 250, mass: 250.08441 },\n            { nominal: 251, mass: 251.084774 },\n            { nominal: 252, mass: 252.08643 },\n            { nominal: 253, mass: 253.087144 },\n            { nominal: 254, mass: 254.08959 },\n            { nominal: 255, mass: 255.0910841 },\n            { nominal: 256, mass: 256.09389 },\n            { nominal: 257, mass: 257.0955424 },\n            { nominal: 258, mass: 258.0984315 },\n            { nominal: 259, mass: 259.10051 },\n            { nominal: 260, mass: 260.10365 },\n            { nominal: 261, mass: 261.10583 },\n            { nominal: 262, mass: 262.1091 },\n        ],\n        symbol: 'Md',\n        name: 'Mendelevium',\n        mass: null,\n    },\n    {\n        number: 102,\n        isotopes: [\n            { nominal: 248, mass: 248.08655 },\n            { nominal: 249, mass: 249.0878 },\n            { nominal: 250, mass: 250.08756 },\n            { nominal: 251, mass: 251.08894 },\n            { nominal: 252, mass: 252.088967 },\n            { nominal: 253, mass: 253.0905641 },\n            { nominal: 254, mass: 254.090956 },\n            { nominal: 255, mass: 255.093191 },\n            { nominal: 256, mass: 256.0942829 },\n            { nominal: 257, mass: 257.0968878 },\n            { nominal: 258, mass: 258.09821 },\n            { nominal: 259, mass: 259.10103 },\n            { nominal: 260, mass: 260.10264 },\n            { nominal: 261, mass: 261.1057 },\n            { nominal: 262, mass: 262.10746 },\n            { nominal: 263, mass: 263.11071 },\n            { nominal: 264, mass: 264.11273 },\n        ],\n        symbol: 'No',\n        name: 'Nobelium',\n        mass: null,\n    },\n    {\n        number: 103,\n        isotopes: [\n            { nominal: 251, mass: 251.09418 },\n            { nominal: 252, mass: 252.09526 },\n            { nominal: 253, mass: 253.09509 },\n            { nominal: 254, mass: 254.09648 },\n            { nominal: 255, mass: 255.096562 },\n            { nominal: 256, mass: 256.098494 },\n            { nominal: 257, mass: 257.099418 },\n            { nominal: 258, mass: 258.10176 },\n            { nominal: 259, mass: 259.102902 },\n            { nominal: 260, mass: 260.1055 },\n            { nominal: 261, mass: 261.10688 },\n            { nominal: 262, mass: 262.10961 },\n            { nominal: 263, mass: 263.11136 },\n            { nominal: 264, mass: 264.1142 },\n            { nominal: 265, mass: 265.11619 },\n            { nominal: 266, mass: 266.11983 },\n        ],\n        symbol: 'Lr',\n        name: 'Lawrencium',\n        mass: null,\n    },\n    {\n        number: 104,\n        isotopes: [\n            { nominal: 253, mass: 253.10044 },\n            { nominal: 254, mass: 254.10005 },\n            { nominal: 255, mass: 255.10127 },\n            { nominal: 256, mass: 256.101152 },\n            { nominal: 257, mass: 257.102918 },\n            { nominal: 258, mass: 258.103428 },\n            { nominal: 259, mass: 259.105596 },\n            { nominal: 260, mass: 260.10644 },\n            { nominal: 261, mass: 261.108773 },\n            { nominal: 262, mass: 262.10992 },\n            { nominal: 263, mass: 263.11249 },\n            { nominal: 264, mass: 264.11388 },\n            { nominal: 265, mass: 265.11668 },\n            { nominal: 266, mass: 266.11817 },\n            { nominal: 267, mass: 267.12179 },\n            { nominal: 268, mass: 268.12397 },\n        ],\n        symbol: 'Rf',\n        name: 'Rutherfordium',\n        mass: null,\n    },\n    {\n        number: 105,\n        isotopes: [\n            { nominal: 255, mass: 255.10707 },\n            { nominal: 256, mass: 256.10789 },\n            { nominal: 257, mass: 257.10758 },\n            { nominal: 258, mass: 258.10928 },\n            { nominal: 259, mass: 259.109492 },\n            { nominal: 260, mass: 260.1113 },\n            { nominal: 261, mass: 261.11192 },\n            { nominal: 262, mass: 262.11407 },\n            { nominal: 263, mass: 263.11499 },\n            { nominal: 264, mass: 264.11741 },\n            { nominal: 265, mass: 265.11861 },\n            { nominal: 266, mass: 266.12103 },\n            { nominal: 267, mass: 267.12247 },\n            { nominal: 268, mass: 268.12567 },\n            { nominal: 269, mass: 269.12791 },\n            { nominal: 270, mass: 270.13136 },\n        ],\n        symbol: 'Db',\n        name: 'Dubnium',\n        mass: null,\n    },\n    {\n        number: 106,\n        isotopes: [\n            { nominal: 258, mass: 258.11298 },\n            { nominal: 259, mass: 259.1144 },\n            { nominal: 260, mass: 260.114384 },\n            { nominal: 261, mass: 261.115949 },\n            { nominal: 262, mass: 262.116337 },\n            { nominal: 263, mass: 263.11829 },\n            { nominal: 264, mass: 264.11893 },\n            { nominal: 265, mass: 265.12109 },\n            { nominal: 266, mass: 266.12198 },\n            { nominal: 267, mass: 267.12436 },\n            { nominal: 268, mass: 268.12539 },\n            { nominal: 269, mass: 269.12863 },\n            { nominal: 270, mass: 270.13043 },\n            { nominal: 271, mass: 271.13393 },\n            { nominal: 272, mass: 272.13589 },\n            { nominal: 273, mass: 273.13958 },\n        ],\n        symbol: 'Sg',\n        name: 'Seaborgium',\n        mass: null,\n    },\n    {\n        number: 107,\n        isotopes: [\n            { nominal: 260, mass: 260.12166 },\n            { nominal: 261, mass: 261.12145 },\n            { nominal: 262, mass: 262.12297 },\n            { nominal: 263, mass: 263.12292 },\n            { nominal: 264, mass: 264.12459 },\n            { nominal: 265, mass: 265.12491 },\n            { nominal: 266, mass: 266.12679 },\n            { nominal: 267, mass: 267.1275 },\n            { nominal: 268, mass: 268.12969 },\n            { nominal: 269, mass: 269.13042 },\n            { nominal: 270, mass: 270.13336 },\n            { nominal: 271, mass: 271.13526 },\n            { nominal: 272, mass: 272.13826 },\n            { nominal: 273, mass: 273.14024 },\n            { nominal: 274, mass: 274.14355 },\n            { nominal: 275, mass: 275.14567 },\n        ],\n        symbol: 'Bh',\n        name: 'Bohrium',\n        mass: null,\n    },\n    {\n        number: 108,\n        isotopes: [\n            { nominal: 263, mass: 263.12852 },\n            { nominal: 264, mass: 264.128357 },\n            { nominal: 265, mass: 265.129793 },\n            { nominal: 266, mass: 266.130046 },\n            { nominal: 267, mass: 267.13167 },\n            { nominal: 268, mass: 268.13186 },\n            { nominal: 269, mass: 269.13375 },\n            { nominal: 270, mass: 270.13429 },\n            { nominal: 271, mass: 271.13717 },\n            { nominal: 272, mass: 272.1385 },\n            { nominal: 273, mass: 273.14168 },\n            { nominal: 274, mass: 274.1433 },\n            { nominal: 275, mass: 275.14667 },\n            { nominal: 276, mass: 276.14846 },\n            { nominal: 277, mass: 277.1519 },\n        ],\n        symbol: 'Hs',\n        name: 'Hassium',\n        mass: null,\n    },\n    {\n        number: 109,\n        isotopes: [\n            { nominal: 265, mass: 265.136 },\n            { nominal: 266, mass: 266.13737 },\n            { nominal: 267, mass: 267.13719 },\n            { nominal: 268, mass: 268.13865 },\n            { nominal: 269, mass: 269.13882 },\n            { nominal: 270, mass: 270.14033 },\n            { nominal: 271, mass: 271.14074 },\n            { nominal: 272, mass: 272.14341 },\n            { nominal: 273, mass: 273.1444 },\n            { nominal: 274, mass: 274.14724 },\n            { nominal: 275, mass: 275.14882 },\n            { nominal: 276, mass: 276.15159 },\n            { nominal: 277, mass: 277.15327 },\n            { nominal: 278, mass: 278.15631 },\n            { nominal: 279, mass: 279.15808 },\n        ],\n        symbol: 'Mt',\n        name: 'Meitnerium',\n        mass: null,\n    },\n    {\n        number: 110,\n        isotopes: [\n            { nominal: 267, mass: 267.14377 },\n            { nominal: 268, mass: 268.14348 },\n            { nominal: 269, mass: 269.144752 },\n            { nominal: 270, mass: 270.144584 },\n            { nominal: 271, mass: 271.14595 },\n            { nominal: 272, mass: 272.14602 },\n            { nominal: 273, mass: 273.14856 },\n            { nominal: 274, mass: 274.14941 },\n            { nominal: 275, mass: 275.15203 },\n            { nominal: 276, mass: 276.15303 },\n            { nominal: 277, mass: 277.15591 },\n            { nominal: 278, mass: 278.15704 },\n            { nominal: 279, mass: 279.1601 },\n            { nominal: 280, mass: 280.16131 },\n            { nominal: 281, mass: 281.16451 },\n        ],\n        symbol: 'Ds',\n        name: 'Darmstadtium',\n        mass: null,\n    },\n    {\n        number: 111,\n        isotopes: [\n            { nominal: 272, mass: 272.15327 },\n            { nominal: 273, mass: 273.15313 },\n            { nominal: 274, mass: 274.15525 },\n            { nominal: 275, mass: 275.15594 },\n            { nominal: 276, mass: 276.15833 },\n            { nominal: 277, mass: 277.15907 },\n            { nominal: 278, mass: 278.16149 },\n            { nominal: 279, mass: 279.16272 },\n            { nominal: 280, mass: 280.16514 },\n            { nominal: 281, mass: 281.16636 },\n            { nominal: 282, mass: 282.16912 },\n            { nominal: 283, mass: 283.17054 },\n        ],\n        symbol: 'Rg',\n        name: 'Roentgenium',\n        mass: null,\n    },\n    {\n        number: 112,\n        isotopes: [\n            { nominal: 276, mass: 276.16141 },\n            { nominal: 277, mass: 277.16364 },\n            { nominal: 278, mass: 278.16416 },\n            { nominal: 279, mass: 279.16654 },\n            { nominal: 280, mass: 280.16715 },\n            { nominal: 281, mass: 281.16975 },\n            { nominal: 282, mass: 282.1705 },\n            { nominal: 283, mass: 283.17327 },\n            { nominal: 284, mass: 284.17416 },\n            { nominal: 285, mass: 285.17712 },\n        ],\n        symbol: 'Cn',\n        name: 'Copernicium',\n        mass: null,\n    },\n    {\n        number: 113,\n        isotopes: [\n            { nominal: 278, mass: 278.17058 },\n            { nominal: 279, mass: 279.17095 },\n            { nominal: 280, mass: 280.17293 },\n            { nominal: 281, mass: 281.17348 },\n            { nominal: 282, mass: 282.17567 },\n            { nominal: 283, mass: 283.17657 },\n            { nominal: 284, mass: 284.17873 },\n            { nominal: 285, mass: 285.17973 },\n            { nominal: 286, mass: 286.18221 },\n            { nominal: 287, mass: 287.18339 },\n        ],\n        symbol: 'Nh',\n        name: 'Nihonium',\n        mass: null,\n    },\n    {\n        number: 114,\n        isotopes: [\n            { nominal: 285, mass: 285.18364 },\n            { nominal: 286, mass: 286.18423 },\n            { nominal: 287, mass: 287.18678 },\n            { nominal: 288, mass: 288.18757 },\n            { nominal: 289, mass: 289.19042 },\n        ],\n        symbol: 'Fl',\n        name: 'Flerovium',\n        mass: null,\n    },\n    {\n        number: 115,\n        isotopes: [\n            { nominal: 287, mass: 287.1907 },\n            { nominal: 288, mass: 288.19274 },\n            { nominal: 289, mass: 289.19363 },\n            { nominal: 290, mass: 290.19598 },\n            { nominal: 291, mass: 291.19707 },\n        ],\n        symbol: 'Mc',\n        name: 'Moscovium',\n        mass: null,\n    },\n    {\n        number: 116,\n        isotopes: [\n            { nominal: 289, mass: 289.19816 },\n            { nominal: 290, mass: 290.19864 },\n            { nominal: 291, mass: 291.20108 },\n            { nominal: 292, mass: 292.20174 },\n            { nominal: 293, mass: 293.20449 },\n        ],\n        symbol: 'Lv',\n        name: 'Livermorium',\n        mass: null,\n    },\n    {\n        number: 117,\n        isotopes: [\n            { nominal: 291, mass: 291.20553 },\n            { nominal: 292, mass: 292.20746 },\n            { nominal: 293, mass: 293.20824 },\n            { nominal: 294, mass: 294.21046 },\n        ],\n        symbol: 'Ts',\n        name: 'Teennessine',\n        mass: null,\n    },\n    {\n        number: 118,\n        isotopes: [\n            { nominal: 293, mass: 293.21356 },\n            { nominal: 294, mass: 294.21392 },\n            { nominal: 295, mass: 295.21624 },\n        ],\n        symbol: 'Og',\n        name: 'Oganesson',\n        mass: null,\n    },\n];\n//# sourceMappingURL=elementsAndIsotopes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elements = void 0;\nconst elementsAndIsotopes_js_1 = require(\"./elementsAndIsotopes.js\");\nexports.elements = elementsAndIsotopes_js_1.elementsAndIsotopes.map((element) => ({\n    number: element.number,\n    symbol: element.symbol,\n    mass: element.mass,\n    name: element.name,\n    monoisotopicMass: element.monoisotopicMass,\n}));\n//# sourceMappingURL=elements.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elementsAndIsotopesObject = void 0;\nconst elementsAndIsotopes_js_1 = require(\"./elementsAndIsotopes.js\");\nexports.elementsAndIsotopesObject = {};\nfor (const element of elementsAndIsotopes_js_1.elementsAndIsotopes) {\n    exports.elementsAndIsotopesObject[element.symbol] = element;\n}\n//# sourceMappingURL=elementsAndIsotopesObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elementsAndStableIsotopes = void 0;\nconst elementsAndIsotopes_js_1 = require(\"./elementsAndIsotopes.js\");\nexports.elementsAndStableIsotopes = structuredClone(elementsAndIsotopes_js_1.elementsAndIsotopes);\nfor (const element of exports.elementsAndStableIsotopes) {\n    element.isotopes = element.isotopes.filter((i) => {\n        return typeof i.abundance === 'number' && i.abundance > 0;\n    });\n}\n//# sourceMappingURL=elementsAndStableIsotopes.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elementsAndStableIsotopesObject = void 0;\nconst elementsAndStableIsotopes_js_1 = require(\"./elementsAndStableIsotopes.js\");\nexports.elementsAndStableIsotopesObject = {};\nfor (const element of elementsAndStableIsotopes_js_1.elementsAndStableIsotopes) {\n    exports.elementsAndStableIsotopesObject[element.symbol] = element;\n}\n//# sourceMappingURL=elementsAndStableIsotopesObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.elementsObject = void 0;\nconst elements_js_1 = require(\"./elements.js\");\nexports.elementsObject = {};\nfor (const element of elements_js_1.elements) {\n    exports.elementsObject[element.symbol] = element;\n}\n//# sourceMappingURL=elementsObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isotopesObject = void 0;\nconst elementsAndIsotopesObject_js_1 = require(\"./elementsAndIsotopesObject.js\");\nexports.isotopesObject = {};\nfor (const [symbol, element] of Object.entries(elementsAndIsotopesObject_js_1.elementsAndIsotopesObject)) {\n    if (!element)\n        continue;\n    for (const isotope of element.isotopes) {\n        exports.isotopesObject[`${isotope.nominal}${symbol}`] = {\n            abundance: isotope.abundance,\n            mass: isotope.mass,\n        };\n    }\n}\n//# sourceMappingURL=isotopesObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.stableIsotopesObject = void 0;\nconst elementsAndIsotopes_js_1 = require(\"./elementsAndIsotopes.js\");\nexports.stableIsotopesObject = {};\nfor (const element of elementsAndIsotopes_js_1.elementsAndIsotopes) {\n    let abundance = 0;\n    let mostAbundant = 0;\n    for (const isotope of element.isotopes) {\n        if (typeof isotope.abundance === 'number' &&\n            isotope.abundance > abundance) {\n            abundance = isotope.abundance;\n            mostAbundant = isotope.nominal;\n        }\n    }\n    for (const isotope of element.isotopes) {\n        if (isotope.abundance === 0)\n            continue;\n        const entry = {\n            name: element.name,\n            mass: isotope.mass,\n            symbol: element.symbol,\n            mostAbundant: false,\n            deltaNeutrons: isotope.nominal - mostAbundant,\n        };\n        if (isotope.nominal === mostAbundant) {\n            entry.mostAbundant = true;\n        }\n        exports.stableIsotopesObject[`${isotope.nominal}${element.symbol}`] = entry;\n    }\n}\n//# sourceMappingURL=stableIsotopesObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsaturationsObject = void 0;\nexports.unsaturationsObject = {\n    O: 0,\n    N: 1,\n    H: -1,\n    Na: -1,\n    K: -1,\n    Li: -1,\n    Ca: -2,\n    C: 2,\n    F: -1,\n    Si: 2,\n    Cl: -1,\n    Br: -1,\n    I: -1,\n    S: 0,\n    P: 1,\n};\n//# sourceMappingURL=unsaturationsObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.groupsObject = void 0;\nconst groups_1 = require(\"./groups\");\nexports.groupsObject = {};\ngroups_1.groups.forEach((e) => {\n    if (exports.groupsObject[e.symbol]) {\n        // eslint-disable-next-line no-console\n        console.log(`The symbol ${e.symbol} is used more than once`);\n    }\n    exports.groupsObject[e.symbol] = e;\n});\n//# sourceMappingURL=groupsObject.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.groupsToSequence = groupsToSequence;\nconst groupsObject_js_1 = require(\"./groupsObject.js\");\n/**\n * Recreate a one letter sequence\n * @param {object} mf\n */\nfunction groupsToSequence(mf) {\n    mf = mf.replaceAll(/\\([^(]*\\)/g, '');\n    let parts = mf.split(/(?=[ A-Z])/);\n    let usefulParts = [];\n    for (let part of parts) {\n        if (part === ' ') {\n            usefulParts.push(' ');\n            continue;\n        }\n        if (!part.match(/^[A-Z][a-z]{2,6}/))\n            continue;\n        if (groupsObject_js_1.groupsObject[part] && groupsObject_js_1.groupsObject[part].oneLetter) {\n            usefulParts.push(groupsObject_js_1.groupsObject[part].oneLetter);\n        }\n        else {\n            usefulParts.push('?');\n        }\n    }\n    return usefulParts.join('').replaceAll(/ +/g, ' ').trim();\n}\n//# sourceMappingURL=groupsToSequence.js.map","\"use strict\";\n/**\n * Define static variable corresponding to the various Kinds of a molecular formula part.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Kind = void 0;\nexports.Kind = {\n    BEGIN: 'begin',\n    ATOM: 'atom',\n    MULTIPLIER_RANGE: 'multiplierRange',\n    ISOTOPE: 'isotope',\n    ISOTOPE_RATIO: 'isotopeRatio',\n    CHARGE: 'charge',\n    SALT: 'salt',\n    OPENING_PARENTHESIS: 'openingParenthesis',\n    CLOSING_PARENTHESIS: 'closingParenthesis',\n    PRE_MULTIPLIER: 'preMultiplier',\n    MULTIPLIER: 'multiplier',\n    TEXT: 'text',\n    ANCHOR: 'anchor',\n    COMMENT: 'comment',\n};\n//# sourceMappingURL=Kind.js.map","\"use strict\";\n/**\n * Parse a string to extract the charge.\n * The charge may be in the form --, +++, +3, -2, 4+, 2-\n * @param {*} charge\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCharge = parseCharge;\nfunction parseCharge(charge) {\n    charge = charge.replaceAll(/[()]/g, '');\n    let chargeNumber = 0;\n    if (charge.match(/^[+-]+$/)) {\n        for (let i = 0; i < charge.length; i++) {\n            if (charge.charAt(i) === '+')\n                chargeNumber++;\n            else\n                chargeNumber--;\n        }\n    }\n    else if (charge.match(/^\\d+[+-]$/)) {\n        chargeNumber = Number(\n        // eslint-disable-next-line unicorn/prefer-at\n        charge.charAt(charge.length - 1) + charge.slice(0, -1));\n    }\n    else {\n        chargeNumber = Number(charge);\n    }\n    return chargeNumber;\n}\n//# sourceMappingURL=parseCharge.js.map","\"use strict\";\n/* eslint-disable unicorn/prefer-code-point */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = parse;\nconst atom_sorter_1 = require(\"atom-sorter\");\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst chemical_groups_1 = require(\"chemical-groups\");\nconst Kind_1 = require(\"./Kind\");\nconst parseCharge_1 = require(\"./util/parseCharge\");\n/**\n * Parse a mf to an array of kind / value\n * @param {String} mf\n * @param {Object} [options={}]\n * @param {Boolean} [options.expandGroups=false] - if true, expand groups\n * @param {Boolean} [options.simplify=false] - if true, remove all the parenthesis and join identical atoms / groups\n */\nfunction parse(mf, options = {}) {\n    return new MFParser().parse(mf, options);\n}\nclass MFParser {\n    parse(mf = '', options = {}) {\n        this.expandGroups = options?.expandGroups ?? false;\n        this.simplify = options?.simplify ?? false;\n        this.mf = mf;\n        this.i = 0;\n        this.result = [];\n        let lastKind = Kind_1.Kind.BEGIN;\n        while (this.i < mf.length) {\n            if (this.result.length > 0 && this.result.at(-1).kind !== Kind_1.Kind.TEXT) {\n                lastKind = this.result.at(-1).kind;\n            }\n            let char = mf.charAt(this.i);\n            let ascii = mf.charCodeAt(this.i);\n            let nextAscii = 0;\n            if (this.i + 1 < mf.length)\n                nextAscii = mf.charCodeAt(this.i + 1);\n            if ((ascii > 47 && ascii < 58) ||\n                (char === '-' && nextAscii > 47 && nextAscii < 58)) {\n                // a number\n                let value = this.getNumber(ascii);\n                if (lastKind === Kind_1.Kind.SALT ||\n                    lastKind === Kind_1.Kind.BEGIN ||\n                    lastKind === Kind_1.Kind.OPENING_PARENTHESIS) {\n                    if (value.to) {\n                        throw new MFError(this.mf, this.i, 'Premultiplier may not contain a -');\n                    }\n                    this.result.push({ kind: Kind_1.Kind.PRE_MULTIPLIER, value: value.from });\n                }\n                else if (lastKind === Kind_1.Kind.ANCHOR) {\n                    if (value.to) {\n                        throw new MFError(this.mf, this.i, 'Anchor ID may not contain -');\n                    }\n                    this.result.at(-1).value = value.from;\n                }\n                else if (value.to) {\n                    this.result.push({\n                        kind: Kind_1.Kind.MULTIPLIER_RANGE,\n                        value: {\n                            from: Math.min(value.from, value.to),\n                            to: Math.max(value.from, value.to),\n                        },\n                    });\n                }\n                else {\n                    this.result.push({ kind: Kind_1.Kind.MULTIPLIER, value: value.from });\n                }\n                continue;\n            }\n            else if (char === '.') {\n                // a point\n                this.result.push({ kind: Kind_1.Kind.SALT, value: char });\n                // it is not in a number otherwise it would have been taken before\n                // it must be in a salt\n            }\n            else if (char === '#') {\n                // an anchor\n                this.result.push({ kind: Kind_1.Kind.ANCHOR, value: 0 });\n                // it is not in a number otherwise it would have been taken before\n                // it must be in a salt\n            }\n            else if (ascii > 64 && ascii < 91) {\n                // an uppercase = new atom\n                this.result.push(...this.getAtom(ascii));\n                continue;\n            }\n            else if (ascii > 96 && ascii < 123) {\n                // a lowercase\n                throw new MFError(this.mf, this.i, 'found a lowercase not following an uppercase');\n            }\n            else if (char === '(') {\n                let charge = this.getParenthesisCharge(ascii);\n                if (charge) {\n                    this.result.push({ kind: Kind_1.Kind.CHARGE, value: charge });\n                }\n                else {\n                    this.result.push({ kind: Kind_1.Kind.OPENING_PARENTHESIS, value: '(' });\n                }\n            }\n            else if (char === ')') {\n                this.result.push({ kind: Kind_1.Kind.CLOSING_PARENTHESIS, value: ')' });\n            }\n            else if (char === '[') {\n                // defines an isotope\n                let isotope = this.getIsotope(ascii);\n                this.result.push({ kind: Kind_1.Kind.ISOTOPE, value: isotope });\n            }\n            else if (char === ']') {\n                throw new MFError(this.mf, this.i, 'should never meet an closing bracket not in isotopes');\n            }\n            else if (char === '{') {\n                // can define an exotic isotopic ratio or mixtures of groups\n                let isotopeRatio = this.getCurlyBracketIsotopeRatio(ascii);\n                if (lastKind === Kind_1.Kind.ATOM) {\n                    let lastResult = this.result.at(-1);\n                    lastResult.kind = Kind_1.Kind.ISOTOPE_RATIO;\n                    lastResult.value = {\n                        atom: lastResult.value,\n                        ratio: isotopeRatio,\n                    };\n                }\n                else {\n                    throw new MFError(this.mf, this.i, 'isotopic composition has to follow an atom');\n                }\n            }\n            else if (char === '}') {\n                throw new MFError(this.mf, this.i, 'found a unexpected closing curly bracket');\n            }\n            else if (char === '+') {\n                // charge not in parenthesis\n                let charge = this.getNonParenthesisCharge(ascii);\n                this.result.push({ kind: Kind_1.Kind.CHARGE, value: charge });\n            }\n            else if (char === '-') {\n                // charge not in parenthesis\n                let charge = this.getNonParenthesisCharge(ascii);\n                this.result.push({ kind: Kind_1.Kind.CHARGE, value: charge });\n            }\n            else if (char === '$') {\n                // it is a comment after\n                this.result.push({\n                    kind: Kind_1.Kind.COMMENT,\n                    value: this.mf.slice(this.i + 1),\n                });\n                break;\n            }\n            else {\n                this.result.push({ kind: Kind_1.Kind.TEXT, value: char });\n            }\n            this.i++;\n        }\n        this.checkParenthesis();\n        if (this.simplify) {\n            this.result = simplify(this.result);\n        }\n        return this.result;\n    }\n    checkParenthesis() {\n        let counter = 0;\n        for (let line of this.result) {\n            if (line.kind === Kind_1.Kind.OPENING_PARENTHESIS)\n                counter++;\n            if (line.kind === Kind_1.Kind.CLOSING_PARENTHESIS)\n                counter--;\n        }\n        if (counter !== 0) {\n            throw new MFError(this.mf, this.i, 'number of opening and closing parenthesis not equal');\n        }\n    }\n    getNumber(ascii) {\n        let number = '';\n        let previous;\n        do {\n            previous = ascii;\n            number += String.fromCharCode(ascii);\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while ((ascii > 47 && ascii < 58) ||\n            ascii === 46 ||\n            ascii === 45 ||\n            ascii === 47); // number . - /\n        // we need to deal with the case there is a from / to\n        if (previous === 46)\n            this.i--;\n        let indexOfDash = number.indexOf('-', 1);\n        if (indexOfDash > -1) {\n            return {\n                from: parseNumberWithDivision(number.slice(0, indexOfDash)),\n                to: parseNumberWithDivision(number.slice(indexOfDash + 1)),\n            };\n        }\n        return { from: parseNumberWithDivision(number) };\n    }\n    getAtom(ascii) {\n        let atom = '';\n        do {\n            atom += String.fromCharCode(ascii);\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while (ascii > 96 && ascii < 123);\n        if (chemical_elements_1.elementsObject[atom] || !this.expandGroups) {\n            return [\n                {\n                    kind: Kind_1.Kind.ATOM,\n                    value: atom,\n                },\n            ];\n        }\n        if (chemical_groups_1.groupsObject[atom]) {\n            const group = chemical_groups_1.groupsObject[atom].mf;\n            const expandedGroups = parse(group, {\n                expandGroups: this.expandGroups,\n            });\n            // need to surround with parenthesis\n            return [\n                { kind: Kind_1.Kind.OPENING_PARENTHESIS, value: '(' },\n                ...expandedGroups,\n                { kind: Kind_1.Kind.CLOSING_PARENTHESIS, value: ')' },\n            ];\n        }\n        throw new MFError(`Not able to expand group: ${this.mf}`);\n    }\n    getIsotope(ascii) {\n        // [13C]\n        let substring = '';\n        do {\n            substring += String.fromCharCode(ascii);\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while (ascii !== 93 && this.i <= this.mf.length);\n        let atom = substring.replaceAll(/[^A-Za-z]/g, '');\n        let isotope = Number(substring.replaceAll(/\\D/g, ''));\n        return { atom, isotope };\n    }\n    getCurlyBracketIsotopeRatio(ascii) {\n        let substring = '';\n        let first = true;\n        do {\n            if (!first) {\n                substring += String.fromCharCode(ascii);\n            }\n            else {\n                first = false;\n            }\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while (ascii !== 125 && this.i <= this.mf.length); // closing curly bracket\n        if (substring.match(/^[0-9.,]+$/)) {\n            return substring.split(',').map(Number);\n        }\n        throw new MFError(this.mf, this.i, 'Curly brackets should contain only number, dot and comma');\n    }\n    getParenthesisCharge(ascii) {\n        let substring = '';\n        let begin = this.i;\n        do {\n            substring += String.fromCharCode(ascii);\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while (ascii !== 41 && this.i <= this.mf.length); // closing parenthesis\n        if (substring.match(/^\\([\\d+-]+$/)) {\n            return (0, parseCharge_1.parseCharge)(substring.slice(1));\n        }\n        else {\n            this.i = begin;\n            return undefined;\n        }\n    }\n    getNonParenthesisCharge(ascii) {\n        let substring = '';\n        do {\n            substring += String.fromCharCode(ascii);\n            this.i++;\n            ascii = this.mf.charCodeAt(this.i);\n        } while (ascii === 43 || ascii === 45 || (ascii > 47 && ascii < 58));\n        this.i--;\n        return (0, parseCharge_1.parseCharge)(substring);\n    }\n}\nclass MFError extends SyntaxError {\n    constructor(mf, i, message) {\n        let text = `${message}\\n\\n${mf}\\n${' '.repeat(i)}^`;\n        super(text);\n    }\n}\nfunction parseNumberWithDivision(string) {\n    if (string.includes('/')) {\n        let parts = string.split('/');\n        if (parts.length !== 2) {\n            throw new TypeError('Can not parse MF with number like: ', string);\n        }\n        return Number(parts[0]) / Number(parts[1]);\n    }\n    else {\n        return Number(string);\n    }\n}\n/**\n * Remove all the parenthesis and multipliers\n * Merge atoms and groups if present many times\n * We will also sort the atoms and groups\n * @param {*} parsed\n * @returns\n */\nfunction simplify(parsed) {\n    if (!parsed || parsed.length === 0)\n        return [];\n    const multipliers = [];\n    let currentMultiplier = { from: 1, to: 1 };\n    let newParsed = [];\n    for (let i = parsed.length - 1; i >= 0; i--) {\n        const item = parsed[i];\n        switch (item.kind) {\n            case 'atom':\n            case 'isotope': {\n                let realMultiplier = currentMultiplier;\n                for (const multiplier of multipliers) {\n                    realMultiplier = {\n                        from: multiplier.from * realMultiplier.from,\n                        to: multiplier.to * realMultiplier.to,\n                    };\n                }\n                newParsed.push({\n                    kind: item.kind,\n                    value: item.value,\n                }, {\n                    kind: 'multiplierRange',\n                    value: realMultiplier,\n                });\n                currentMultiplier = { from: 1, to: 1 };\n                break;\n            }\n            case 'multiplier':\n                currentMultiplier = { from: item.value, to: item.value };\n                break;\n            case 'multiplierRange':\n                currentMultiplier = item.value;\n                break;\n            case 'openingParenthesis':\n                multipliers.pop();\n                break;\n            case 'closingParenthesis':\n                multipliers.push(currentMultiplier);\n                currentMultiplier = { from: 1, to: 1 };\n                break;\n            case 'text':\n                break;\n            default:\n                throw new Error(`Unexpected kind --${item.kind}-- in removeParenthesis`);\n        }\n    }\n    // if we have many times the same atom / group, we can merge them\n    const distinctParsedObject = {};\n    for (let i = 0; i < newParsed.length; i = i + 2) {\n        const item = newParsed[i];\n        const multiplier = newParsed[i + 1];\n        const key = JSON.stringify(item.value);\n        if (!distinctParsedObject[key]) {\n            distinctParsedObject[key] = {\n                ...item,\n                multiplier: multiplier.value,\n            };\n        }\n        else {\n            distinctParsedObject[key].multiplier.from += multiplier.value.from;\n            distinctParsedObject[key].multiplier.to += multiplier.value.to;\n        }\n    }\n    const sorted = Object.values(distinctParsedObject).toSorted((a, b) => {\n        const atomA = a.kind === 'atom' ? a.value : a.value.atom;\n        const atomB = b.kind === 'atom' ? b.value : b.value.atom;\n        if (atomA === atomB) {\n            if (a.kind === 'isotope' && b.kind === 'isotope') {\n                return a.value.isotope - b.value.isotope;\n            }\n            if (a.kind === 'isotope' && b.kind !== 'isotope') {\n                return -1; // isotope comes before non-isotope\n            }\n            if (a.kind !== 'isotope' && b.kind === 'isotope') {\n                return 1; // non-isotope comes after isotope\n            }\n            return 0;\n        }\n        return (0, atom_sorter_1.atomSorter)(atomA, atomB);\n    });\n    const distinctParsed = [];\n    for (const item of sorted) {\n        if (item.multiplier.from === 0 && item.multiplier.to === 0) {\n            continue;\n        }\n        distinctParsed.push({\n            kind: item.kind,\n            value: item.value,\n        });\n        if (item.multiplier.from === 1 && item.multiplier.to === 1) {\n            continue; // no need to add a multiplier\n        }\n        if (item.multiplier.from === item.multiplier.to) {\n            distinctParsed.push({\n                kind: 'multiplier',\n                value: item.multiplier.from,\n            });\n        }\n        else {\n            distinctParsed.push({\n                kind: 'multiplierRange',\n                value: {\n                    from: item.multiplier.from,\n                    to: item.multiplier.to,\n                },\n            });\n        }\n    }\n    return distinctParsed;\n}\n//# sourceMappingURL=parse.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscript = exports.superscript = void 0;\nexports.superscript = {\n    0: '⁰',\n    1: '¹',\n    2: '²',\n    3: '³',\n    4: '⁴',\n    5: '⁵',\n    6: '⁶',\n    7: '⁷',\n    8: '⁸',\n    9: '⁹',\n    '+': '⁺',\n    '-': '⁻',\n    '(': '⁽',\n    ')': '⁾',\n    '{': '⁽',\n    '}': '⁾',\n    '.': '˙',\n    ',': '˒',\n};\nexports.subscript = {\n    0: '₀',\n    1: '₁',\n    2: '₂',\n    3: '₃',\n    4: '₄',\n    5: '₅',\n    6: '₆',\n    7: '₇',\n    8: '₈',\n    9: '₉',\n    '(': '₍',\n    ')': '₎',\n    '{': '₍',\n    '}': '₎',\n    '.': ' ',\n    ',': ' ',\n};\n//# sourceMappingURL=subSuperscript.js.map","\"use strict\";\n/**\n * Defines static variables corresponding to the various formatting possibilities\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Format = void 0;\nexports.Format = {\n    SUBSCRIPT: 'subscript',\n    SUPERSCRIPT: 'superscript',\n    SUPERIMPOSE: 'superimpose',\n    TEXT: 'text',\n};\n//# sourceMappingURL=Format.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.formatCharge = formatCharge;\nfunction formatCharge(charge) {\n    if (charge === 1)\n        return '+';\n    if (charge > 1)\n        return `+${charge}`;\n    if (charge < 0)\n        return String(charge);\n    return '';\n}\n//# sourceMappingURL=formatCharge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.improveLinesForDisplay = improveLinesForDisplay;\nconst Kind_js_1 = require(\"../Kind.js\");\n/**\n * We try to remove useless lines that are not needed for the display and could be confusing\n * for the user\n * @param {object[]} lines\n */\nfunction improveLinesForDisplay(lines) {\n    lines = lines.slice(0);\n    // multipliers by one seems completely useless\n    lines = lines.filter((line) => !(line.kind === Kind_js_1.Kind.MULTIPLIER && line.value === 1));\n    // global surrouding useless parenthesis\n    // (C) -> C, (CH2) -> CH2, ((CH2)) -> CH2, ((CH2)2) -> (CH2)2, (C(CH2)2) -> C(CH2)2\n    // need to count the number of opening parenthesis\n    // and check the minimum number of parenthesis we find\n    let beginCounter = 0;\n    let endCounter = 0;\n    let minCounter = Number.MAX_SAFE_INTEGER;\n    let counter = 0;\n    let begin = true;\n    for (let line of lines) {\n        switch (line.kind) {\n            case Kind_js_1.Kind.OPENING_PARENTHESIS:\n                if (begin) {\n                    beginCounter++;\n                }\n                counter++;\n                break;\n            case Kind_js_1.Kind.CLOSING_PARENTHESIS:\n                endCounter++;\n                counter--;\n                break;\n            case Kind_js_1.Kind.CHARGE: // seems to me we can still remove parenthesis even if we have some charges\n                break;\n            default:\n                if (counter < minCounter)\n                    minCounter = counter;\n                endCounter = 0;\n                begin = false;\n        }\n    }\n    let nbParenthesisToSuppress = Math.min(minCounter, beginCounter, endCounter);\n    if (nbParenthesisToSuppress > 0) {\n        // need to remove from the beginning and from the end the number of parenthesis\n        // knowing some of the lines could be charges\n        let toSuppress = nbParenthesisToSuppress;\n        let i = 0;\n        while (toSuppress > 0) {\n            if (lines[0].kind === Kind_js_1.Kind.OPENING_PARENTHESIS) {\n                lines.splice(i, 1);\n                toSuppress--;\n            }\n            else {\n                i++;\n            }\n        }\n        toSuppress = nbParenthesisToSuppress;\n        i = lines.length - 1;\n        while (toSuppress > 0) {\n            if (lines[i].kind === Kind_js_1.Kind.CLOSING_PARENTHESIS) {\n                toSuppress--;\n                lines.splice(i, 1);\n            }\n            i--;\n        }\n    }\n    return lines;\n}\n//# sourceMappingURL=improveLinesForDisplay.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toDisplay = toDisplay;\nconst Format_1 = require(\"../Format\");\nconst Kind_1 = require(\"../Kind\");\nconst formatCharge_js_1 = require(\"./formatCharge.js\");\nconst improveLinesForDisplay_js_1 = require(\"./improveLinesForDisplay.js\");\n/**\n * Converts an array of mf elements to an array of formatting information\n * @param {object[]} lines of the parse method\n * @returns {{kind: string, value: string}[]}\n */\nfunction toDisplay(lines) {\n    lines = (0, improveLinesForDisplay_js_1.improveLinesForDisplay)(lines);\n    const special = specialCases(lines);\n    if (special)\n        return special;\n    let results = [];\n    let result = {};\n    for (let line of lines) {\n        switch (line.kind) {\n            case Kind_1.Kind.MULTIPLIER:\n                if (line.value !== 1) {\n                    result = {\n                        kind: Format_1.Format.SUBSCRIPT,\n                        value: String(line.value),\n                    };\n                    results.push(result);\n                }\n                break;\n            case Kind_1.Kind.MULTIPLIER_RANGE:\n                result = {\n                    kind: Format_1.Format.SUBSCRIPT,\n                    value: `${String(line.value.from)}-${line.value.to}`,\n                };\n                results.push(result);\n                break;\n            case Kind_1.Kind.CHARGE:\n                if (result.kind === Format_1.Format.SUBSCRIPT) {\n                    result.kind = Format_1.Format.SUPERIMPOSE;\n                    result.over = (0, formatCharge_js_1.formatCharge)(line.value);\n                    result.under = result.value;\n                    result.value = undefined;\n                }\n                else {\n                    result = {\n                        kind: Format_1.Format.SUPERSCRIPT,\n                        value: (0, formatCharge_js_1.formatCharge)(line.value),\n                    };\n                    results.push(result);\n                }\n                break;\n            case Kind_1.Kind.ISOTOPE:\n                result = {\n                    kind: Format_1.Format.SUPERSCRIPT,\n                    value: line.value.isotope,\n                };\n                results.push(result);\n                result = {\n                    kind: Format_1.Format.TEXT,\n                    value: line.value.atom,\n                };\n                results.push(result);\n                break;\n            case Kind_1.Kind.ISOTOPE_RATIO:\n                if (result.kind === Format_1.Format.TEXT) {\n                    result.value += line.value.atom;\n                }\n                else {\n                    result = {\n                        kind: Format_1.Format.TEXT,\n                        value: line.value.atom,\n                    };\n                    results.push(result);\n                }\n                result = {\n                    kind: Format_1.Format.SUPERSCRIPT,\n                    value: `{${line.value.ratio.join(',')}}`,\n                };\n                results.push(result);\n                break;\n            case Kind_1.Kind.SALT:\n                if (result.kind === Format_1.Format.TEXT) {\n                    result.value += ' • ';\n                }\n                else {\n                    result = {\n                        kind: Format_1.Format.TEXT,\n                        value: ' • ',\n                    };\n                    results.push(result);\n                }\n                break;\n            default:\n                if (result.kind === Format_1.Format.TEXT) {\n                    result.value += line.value;\n                }\n                else {\n                    result = {\n                        kind: Format_1.Format.TEXT,\n                        value: line.value,\n                    };\n                    results.push(result);\n                }\n        }\n    }\n    return results;\n}\n/**\n * Some special changes for specific cases\n * @param {} lines\n */\nfunction specialCases(lines) {\n    // (-)\n    if (lines.length === 1 && lines[0].kind === Kind_1.Kind.CHARGE) {\n        const charge = lines[0].value;\n        if (charge === 0)\n            return [];\n        if (charge === 1) {\n            return [\n                { kind: Format_1.Format.TEXT, value: '-e' },\n                { kind: Format_1.Format.SUPERSCRIPT, value: '-' },\n            ];\n        }\n        if (charge === -1) {\n            return [\n                { kind: Format_1.Format.TEXT, value: '+e' },\n                { kind: Format_1.Format.SUPERSCRIPT, value: '-' },\n            ];\n        }\n        if (charge > 1) {\n            return [\n                { kind: Format_1.Format.TEXT, value: `-${charge}e` },\n                { kind: Format_1.Format.SUPERSCRIPT, value: '-' },\n            ];\n        }\n        if (charge < -1) {\n            return [\n                { kind: Format_1.Format.TEXT, value: `+${-charge}e` },\n                { kind: Format_1.Format.SUPERSCRIPT, value: '-' },\n            ];\n        }\n    }\n    // (-)2, (-)-1, (+)2, (+)-1, (2+)2, (2+)-1, (2-)+1, (2-)-1\n    if (lines.length === 2 &&\n        lines[0].kind === Kind_1.Kind.CHARGE &&\n        lines[1].kind === Kind_1.Kind.MULTIPLIER) {\n        const charge = lines[0].value;\n        const nbElectrons = -lines[1].value * charge;\n        const results = [];\n        if (nbElectrons === 0)\n            return [];\n        if (nbElectrons === 1) {\n            results.push({ kind: Format_1.Format.TEXT, value: '+e' });\n        }\n        if (nbElectrons === -1) {\n            results.push({ kind: Format_1.Format.TEXT, value: '-e' });\n        }\n        if (nbElectrons > 1) {\n            results.push({ kind: Format_1.Format.TEXT, value: `+${nbElectrons}e` });\n        }\n        if (nbElectrons < -1) {\n            results.push({ kind: Format_1.Format.TEXT, value: `${nbElectrons}e` });\n        }\n        results.push({ kind: Format_1.Format.SUPERSCRIPT, value: '-' });\n        return results;\n    }\n    return undefined;\n}\n//# sourceMappingURL=toDisplay.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isMF = isMF;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst chemical_groups_1 = require(\"chemical-groups\");\nfunction isMF(mf) {\n    let tmpMF = mf.replaceAll(/[^A-Za-z]/g, '');\n    let parts = tmpMF.replaceAll(/([A-Za-z])(?=[A-Z])/g, '$1 ').split(' ');\n    for (let i = 0; i < parts.length; i++) {\n        if (!chemical_elements_1.elementsObject[parts[i]] && !chemical_groups_1.groupsObject[parts[i]]) {\n            return false;\n        }\n    }\n    return true;\n}\n//# sourceMappingURL=isMF.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Style = void 0;\nexports.Style = {\n    SUPERIMPOSE: 'flex-direction: column;display: inline-flex;justify-content: center;text-align: left;vertical-align: middle;',\n    SUPERIMPOSE_SUP_SUB: 'line-height: 1; font-size: 70%',\n};\n//# sourceMappingURL=Style.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toHtml = toHtml;\nconst Format_1 = require(\"../Format\");\nconst Style_1 = require(\"../Style\");\nfunction toHtml(lines) {\n    let html = [];\n    for (let line of lines) {\n        switch (line.kind) {\n            case Format_1.Format.SUBSCRIPT:\n                html.push(`<sub>${line.value}</sub>`);\n                break;\n            case Format_1.Format.SUPERSCRIPT:\n                html.push(`<sup>${line.value}</sup>`);\n                break;\n            case Format_1.Format.SUPERIMPOSE:\n                html.push(`<span style=\"${Style_1.Style.SUPERIMPOSE}\">`, `<sup style=\"${Style_1.Style.SUPERIMPOSE_SUP_SUB}\">${line.over}</sup>`, `<sub style=\"${Style_1.Style.SUPERIMPOSE_SUP_SUB}\">${line.under}</sub>`, '</span>');\n                break;\n            default:\n                html.push(line.value);\n        }\n    }\n    return html.join('');\n}\n//# sourceMappingURL=toHtml.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureCase = ensureCase;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst elements = new Set(Object.keys(chemical_elements_1.elementsObject).toSorted((a, b) => b.length - a.length));\n/**\n * Ensure that the mf has been entered with capital letters and not only lowercase\n * If there is only lowercase we try to capitalize the mf\n * @param {string} mf\n */\nfunction ensureCase(mf) {\n    for (let i = 0; i < mf.length; i++) {\n        // eslint-disable-next-line unicorn/prefer-code-point\n        if (mf.charCodeAt(i) > 64 && mf.charCodeAt(i) < 91) {\n            return mf;\n        }\n    }\n    let parts = mf.replaceAll(/([a-z]*)([^a-z]*)/g, '$1 $2 ').split(/ +/);\n    for (let i = 0; i < parts.length; i++) {\n        if (parts[i].match(/^[a-z]$/)) {\n            parts[i] = parts[i].toUpperCase();\n        }\n        else if (parts[i].match(/^[a-z]+$/)) {\n            let newPart = '';\n            for (let j = 0; j < parts[i].length; j++) {\n                let two = parts[i].slice(j, j + 2);\n                let one = parts[i].charAt(j).toUpperCase();\n                if (['c', 'h', 'o', 'n'].includes(two.charAt(0)) &&\n                    ['h', 'o', 'n'].includes(two.charAt(1))) {\n                    newPart += two.toUpperCase();\n                    j++;\n                }\n                else {\n                    two = two.charAt(0).toUpperCase() + two.charAt(1);\n                    if (elements.has(two)) {\n                        newPart += two;\n                        j++;\n                    }\n                    else if (elements.has(one)) {\n                        newPart += one;\n                    }\n                    else {\n                        return mf;\n                    }\n                }\n            }\n            parts[i] = newPart;\n        }\n    }\n    return parts.join('');\n}\n//# sourceMappingURL=ensureCase.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.flatten = flatten;\n/**\n * This method will generate all possible molecular formulas\n * from ranges.\n * It should rather be called expand because it expands all the ranges\n * @param parsed\n * @param options\n * @return {string[]}\n */\nfunction flatten(parsed, options = {}) {\n    const { groupIdentical = false, limit = 100000 } = options;\n    if (parsed.length === 0)\n        return [''];\n    let parts = [];\n    let parenthesisLevel = 0;\n    let currentPart;\n    let comments = [];\n    for (const entry of parsed) {\n        if ((entry.kind === 'atom' ||\n            entry.kind === 'charge' ||\n            entry.kind === 'isotope' ||\n            entry.kind === 'openingParenthesis' ||\n            !currentPart) &&\n            parenthesisLevel === 0) {\n            currentPart = {\n                mf: '',\n                min: 1,\n                max: 1,\n            };\n            parts.push(currentPart);\n        }\n        switch (entry.kind) {\n            case 'atom':\n                currentPart.mf += entry.value;\n                break;\n            case 'isotope':\n                currentPart.mf += `[${entry.value.isotope}${entry.value.atom}]`;\n                break;\n            case 'multiplier':\n                currentPart.mf += entry.value;\n                break;\n            case 'multiplierRange':\n                if (parenthesisLevel !== 0) {\n                    throw new Error('Range definition inside parenthesis is not allowed.');\n                }\n                currentPart.min = entry.value.from;\n                currentPart.max = entry.value.to;\n                break;\n            case 'openingParenthesis':\n                parenthesisLevel++;\n                currentPart.mf += entry.value;\n                break;\n            case 'charge':\n                if (entry.value === 1) {\n                    currentPart.mf += '+';\n                }\n                else if (entry.value > 1) {\n                    currentPart.mf += `(+${entry.value})`;\n                }\n                else if (entry.value < 0) {\n                    currentPart.mf += `(${entry.value})`;\n                }\n                break;\n            case 'closingParenthesis':\n                parenthesisLevel--;\n                currentPart.mf += entry.value;\n                break;\n            case 'comment':\n                comments.push(entry.value);\n                break;\n            case 'text':\n                break;\n            default:\n                throw new Error(`Could not flatten the parsed MF. Unknown kind: ${entry.kind}`);\n        }\n    }\n    if (groupIdentical) {\n        parts = optimizeRanges(parts);\n    }\n    const mfs = createMFs(parts, comments.join(' '), limit);\n    return mfs;\n}\n/**\n * If we have many times the same mf we can combine them\n * This should only be applied if there are acutaly some ranges\n */\nfunction optimizeRanges(parts) {\n    let newParts = [];\n    let mfsObject = {};\n    let hasRange = false;\n    for (const mf of parts) {\n        if (mf.min !== mf.max) {\n            hasRange = true;\n            break;\n        }\n    }\n    if (!hasRange)\n        return parts;\n    for (const mf of parts) {\n        if (!mfsObject[mf.mf]) {\n            mfsObject[mf.mf] = {\n                mf: mf.mf,\n                min: mf.min,\n                max: mf.max,\n            };\n            newParts.push(mfsObject[mf.mf]);\n        }\n        else {\n            mfsObject[mf.mf].min = mfsObject[mf.mf].min + mf.min;\n            mfsObject[mf.mf].max = mfsObject[mf.mf].max + mf.max;\n        }\n    }\n    return newParts;\n}\nfunction createMFs(parts, comment, limit) {\n    const currents = new Array(parts.length);\n    for (let i = 0; i < currents.length; i++) {\n        currents[i] = parts[i].min;\n    }\n    /** @type {string[]} */\n    const mfs = [];\n    let position = 0;\n    while (position < currents.length) {\n        if (currents[position] < parts[position].max) {\n            mfs.push(getMF(parts, currents, comment));\n            currents[position]++;\n            for (let i = 0; i < position; i++) {\n                currents[i] = parts[i].min;\n            }\n            position = 0;\n        }\n        else {\n            position++;\n        }\n        if (mfs.length >= limit) {\n            throw new Error(`MF.flatten generates too many fragments (over ${limit})`);\n        }\n    }\n    mfs.push(getMF(parts, currents, comment));\n    return mfs;\n}\nfunction getMF(parts, currents, comment) {\n    let mf = '';\n    for (let i = 0; i < parts.length; i++) {\n        if (currents[i] === 0) {\n            continue;\n        }\n        mf += parts[i].mf;\n        if (currents[i] !== 1) {\n            mf += currents[i];\n        }\n    }\n    if (comment)\n        mf += `$${comment}`;\n    return mf;\n}\n//# sourceMappingURL=flatten.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIsotopeRatioInfo = getIsotopeRatioInfo;\nconst chemical_elements_1 = require(\"chemical-elements\");\nfunction getIsotopeRatioInfo(value) {\n    let result = { mass: 0, monoisotopicMass: 0 };\n    let element = chemical_elements_1.elementsAndStableIsotopesObject[value.atom];\n    if (!element)\n        throw new Error(`Element not found: ${value.atom}`);\n    let isotopesArray = element.isotopes;\n    let ratios = normalize(value.ratio);\n    let max = Math.max(...ratios);\n    if (ratios.length > isotopesArray.length) {\n        throw new Error(`the number of specified ratios is bigger that the number of stable isotopes: ${value.atom}`);\n    }\n    for (let i = 0; i < ratios.length; i++) {\n        result.mass += ratios[i] * isotopesArray[i].mass;\n        if (max === ratios[i] && result.monoisotopicMass === 0) {\n            result.monoisotopicMass = isotopesArray[i].mass;\n        }\n    }\n    return result;\n}\nfunction normalize(array) {\n    let sum = array.reduce((prev, current) => prev + current, 0);\n    return array.map((a) => a / sum);\n}\n//# sourceMappingURL=getIsotopeRatioInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEA = getEA;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst chemical_groups_1 = require(\"chemical-groups\");\nconst Kind_1 = require(\"../Kind\");\nconst getIsotopeRatioInfo_1 = require(\"./getIsotopeRatioInfo\");\n/**\n * @param {*} parts\n */\nfunction getEA(parts) {\n    let results = {};\n    for (let part of parts) {\n        for (let line of part) {\n            switch (line.kind) {\n                case Kind_1.Kind.ISOTOPE: {\n                    let isotope = chemical_elements_1.isotopesObject[line.value.isotope + line.value.atom];\n                    if (!isotope) {\n                        throw new Error(`Unknown isotope: ${line.value.isotope}${line.value.atom}`);\n                    }\n                    addMass(results, line.value.atom, isotope.mass * line.multiplier);\n                    break;\n                }\n                case Kind_1.Kind.ISOTOPE_RATIO: {\n                    let isotopeRatioInfo = (0, getIsotopeRatioInfo_1.getIsotopeRatioInfo)(line.value);\n                    addMass(results, line.value.atom, isotopeRatioInfo.mass * line.multiplier);\n                    break;\n                }\n                case Kind_1.Kind.ATOM: {\n                    let element = chemical_elements_1.elementsObject[line.value];\n                    if (!element) {\n                        element = chemical_groups_1.groupsObject[line.value];\n                        if (!element)\n                            throw new Error(`Unknown element: ${line.value}`);\n                        // need to explode group ????\n                    }\n                    addMass(results, line.value, element.mass * line.multiplier);\n                    break;\n                }\n                case Kind_1.Kind.CHARGE:\n                    break;\n                default:\n                    throw new Error('partToMF unhandled Kind: ', line.kind);\n            }\n        }\n    }\n    let eas = [];\n    let sum = 0;\n    for (let key in results) {\n        sum += results[key];\n        eas.push({\n            element: key,\n            mass: results[key],\n        });\n    }\n    for (const ea of eas) {\n        ea.ratio = ea.mass / sum;\n    }\n    return eas;\n}\nfunction addMass(results, atom, mass) {\n    if (!results[atom])\n        results[atom] = 0;\n    results[atom] += mass;\n}\n//# sourceMappingURL=getEA.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getElements = getElements;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst Kind_1 = require(\"../Kind\");\n/**\n * @param {*} parts\n */\nfunction getElements(parts) {\n    const elements = [];\n    for (const part of parts) {\n        for (const line of part) {\n            let number = line.multiplier;\n            switch (line.kind) {\n                case Kind_1.Kind.ATOM: {\n                    let symbol = line.value;\n                    let element = chemical_elements_1.elementsObject[symbol];\n                    if (!element) {\n                        throw new Error(`element unknown: ${symbol} - ${line}`);\n                    }\n                    addElement(elements, { symbol, number });\n                    break;\n                }\n                case Kind_1.Kind.ISOTOPE: {\n                    let element = chemical_elements_1.elementsAndIsotopesObject[line.value.atom];\n                    if (!element) {\n                        throw new Error(`element unknown: ${part.value.atom} - ${line}`);\n                    }\n                    let isotope = element.isotopes.find((a) => a.nominal === line.value.isotope);\n                    if (!isotope) {\n                        throw new Error(`isotope unknown: ${line.value.isotope} - ${line}`);\n                    }\n                    addElement(elements, {\n                        symbol: line.value.atom,\n                        number,\n                        isotope: line.value.isotope,\n                    });\n                    break;\n                }\n                default:\n                    throw new Error(`unknown type: ${line.kind}`);\n            }\n        }\n    }\n    return elements;\n}\nfunction addElement(elements, newElement) {\n    for (let element of elements) {\n        if (element.symbol === newElement.symbol &&\n            element.isotope === newElement.isotope) {\n            element.number += newElement.number;\n            return;\n        }\n    }\n    elements.push(newElement);\n}\n//# sourceMappingURL=getElements.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNumberOfIsotopologues = getNumberOfIsotopologues;\nconst chemical_elements_1 = require(\"chemical-elements\");\n/**\n * Returns the theoretical number of isotopologues for a given MF based on stable isotopes for each element.\n * This method will not take into account possible non natural isotopic composition (e.g. 13C enrichment)\n * If one element does not have any stable isotope, the result will be 0.\n * @param atoms\n * @returns\n */\nfunction getNumberOfIsotopologues(atoms) {\n    if (Object.keys(atoms).length === 0) {\n        return 0;\n    }\n    let result = 1;\n    for (const atom in atoms) {\n        const nbIsotopes = chemical_elements_1.elementsAndStableIsotopesObject[atom]?.isotopes.length;\n        if (!nbIsotopes) {\n            return 0;\n        }\n        const nbAtoms = atoms[atom];\n        result *= getNbCombinationsPerAtom(nbAtoms, nbIsotopes);\n    }\n    return result;\n}\n/**\n * Returns the number of isotopologues for one specific atom\n *\n * @param nbAtoms\n * @param nbIsotopes\n * @returns\n */\nfunction getNbCombinationsPerAtom(nbAtoms, nbIsotopes) {\n    let result = 1;\n    for (let i = nbAtoms + 1; i < nbAtoms + nbIsotopes; i++) {\n        result *= i;\n    }\n    for (let i = 2; i < nbIsotopes; i++) {\n        result /= i;\n    }\n    return result;\n}\n//# sourceMappingURL=getNumberOfIsotopologues.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partToAtoms = partToAtoms;\nconst Kind_js_1 = require(\"../Kind.js\");\n/** @typedef {import('./partToAtoms.types').AtomsMap} AtomsMap */\n/**\n * Convert a MF part to a map of atoms\n * This procedure will suppress the isotopes !\n * This is mainly used to make queries\n * @returns {AtomsMap}\n */\nfunction partToAtoms(part) {\n    /** @type {AtomsMap} */\n    const atoms = {};\n    for (let line of part) {\n        switch (line.kind) {\n            case Kind_js_1.Kind.ISOTOPE:\n                if (!atoms[line.value.atom])\n                    atoms[line.value.atom] = 0;\n                atoms[line.value.atom] += line.multiplier;\n                break;\n            case Kind_js_1.Kind.ISOTOPE_RATIO:\n                if (!atoms[line.value.atom])\n                    atoms[line.value.atom] = 0;\n                atoms[line.value.atom] += line.multiplier;\n                break;\n            case Kind_js_1.Kind.ATOM:\n                if (!atoms[line.value])\n                    atoms[line.value] = 0;\n                atoms[line.value] += line.multiplier;\n                break;\n            case Kind_js_1.Kind.CHARGE:\n                break;\n            case Kind_js_1.Kind.ANCHOR:\n                break;\n            default:\n                throw new Error('partToMF unhandled Kind: ', line.kind);\n        }\n    }\n    return atoms;\n}\n//# sourceMappingURL=partToAtoms.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partToMF = partToMF;\nconst Kind_1 = require(\"../Kind\");\nfunction partToMF(part, options = {}) {\n    let mf = [];\n    for (let line of part) {\n        switch (line.kind) {\n            case Kind_1.Kind.ISOTOPE:\n                if (line.multiplier !== 0) {\n                    mf.push(`[${line.value.isotope}${line.value.atom}]${line.multiplier !== 1 ? line.multiplier : ''}`);\n                }\n                break;\n            case Kind_1.Kind.ISOTOPE_RATIO:\n                if (line.multiplier !== 0) {\n                    mf.push(`${line.value.atom}{${line.value.ratio.join(',')}}${line.multiplier !== 1 ? line.multiplier : ''}`);\n                }\n                break;\n            case Kind_1.Kind.ATOM:\n                if (line.multiplier !== 0) {\n                    mf.push(line.value + (line.multiplier !== 1 ? line.multiplier : ''));\n                }\n                break;\n            case Kind_1.Kind.CHARGE:\n                if (line.value === 0 || options.neutral)\n                    break;\n                mf.push(`(${line.value > 0 ? `+${line.value}` : line.value})`);\n                break;\n            default:\n        }\n    }\n    return mf.join('');\n}\n//# sourceMappingURL=partToMF.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getInfoInternal = getInfoInternal;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst chemical_groups_1 = require(\"chemical-groups\");\nconst Kind_1 = require(\"../Kind\");\nconst getIsotopeRatioInfo_1 = require(\"./getIsotopeRatioInfo\");\nconst getNumberOfIsotopologues_1 = require(\"./getNumberOfIsotopologues\");\nconst partToAtoms_1 = require(\"./partToAtoms\");\nconst partToMF_1 = require(\"./partToMF\");\n/** @typedef {import('./getInfo.types').MFInfo} MFInfo */\n/** @typedef {import('./getInfo.types').MFInfoWithParts} MFInfoWithParts */\n/**\n *\n * @param {*} parts\n * @param {*} [options={}]\n * @returns {object|MFInfo|MFInfoWithParts}\n */\nfunction getInfoInternal(parts, options = {}) {\n    let { customUnsaturations = {}, emFieldName = 'monoisotopicMass', msemFieldName = 'observedMonoisotopicMass', } = options;\n    if (parts.length === 0)\n        return {};\n    if (parts.length === 1) {\n        let oneResult = getProcessedPart(parts[0], {\n            customUnsaturations,\n            emFieldName,\n            msemFieldName,\n        });\n        oneResult.nbIsotopologues = (0, getNumberOfIsotopologues_1.getNumberOfIsotopologues)(oneResult.atoms);\n        return oneResult;\n    }\n    let result = { parts: [] };\n    for (let part of parts) {\n        result.parts.push(getProcessedPart(part, {\n            customUnsaturations,\n            emFieldName,\n            msemFieldName,\n        }));\n    }\n    result[emFieldName] = 0;\n    result.mass = 0;\n    result.charge = 0;\n    result.unsaturation = 0;\n    result.atoms = {};\n    result.mf = result.parts.map((a) => a.mf).join('.');\n    for (const part of result.parts) {\n        result.mass += part.mass;\n        result[emFieldName] += part[emFieldName];\n        result.charge += part.charge;\n        result.unsaturation += part.unsaturation;\n        for (const atom in part.atoms) {\n            if (!result.atoms[atom]) {\n                result.atoms[atom] = 0;\n            }\n            result.atoms[atom] += part.atoms[atom];\n        }\n    }\n    result.nbIsotopologues = (0, getNumberOfIsotopologues_1.getNumberOfIsotopologues)(result.atoms);\n    return result;\n}\nfunction getProcessedPart(part, options) {\n    let { customUnsaturations, emFieldName, msemFieldName } = options;\n    /** @type {MFInfo} */\n    let currentPart = {\n        mass: 0,\n        charge: 0,\n        mf: '',\n        atoms: (0, partToAtoms_1.partToAtoms)(part),\n        [emFieldName]: 0,\n    };\n    let unsaturation = 0;\n    let validUnsaturation = true;\n    currentPart.mf = (0, partToMF_1.partToMF)(part);\n    for (let line of part) {\n        let currentElement = '';\n        switch (line.kind) {\n            case Kind_1.Kind.ATOM: {\n                currentElement = line.value;\n                let element = chemical_elements_1.elementsAndIsotopesObject[line.value];\n                // todo should we have a kind GROUP ?\n                if (!element) {\n                    element = chemical_groups_1.groupsObject[line.value];\n                    if (!element)\n                        throw new Error(`Unknown element: ${line.value}`);\n                    if (!customUnsaturations[line.value]) {\n                        customUnsaturations[line.value] = element.unsaturation;\n                    }\n                }\n                if (!element)\n                    throw new Error(`Unknown element: ${line.value}`);\n                currentPart[emFieldName] += element.monoisotopicMass * line.multiplier;\n                currentPart.mass += element.mass * line.multiplier;\n                break;\n            }\n            case Kind_1.Kind.ISOTOPE: {\n                currentElement = line.value.atom;\n                let isotope = chemical_elements_1.isotopesObject[line.value.isotope + line.value.atom];\n                if (!isotope) {\n                    throw new Error(`Unknown isotope: ${line.value.isotope}${line.value.atom}`);\n                }\n                currentPart[emFieldName] += isotope.mass * line.multiplier;\n                currentPart.mass += isotope.mass * line.multiplier;\n                break;\n            }\n            case Kind_1.Kind.ISOTOPE_RATIO: {\n                currentElement = line.value.atom;\n                let isotopeRatioInfo = (0, getIsotopeRatioInfo_1.getIsotopeRatioInfo)(line.value);\n                currentPart[emFieldName] +=\n                    isotopeRatioInfo[emFieldName] * line.multiplier;\n                currentPart.mass += isotopeRatioInfo.mass * line.multiplier;\n                break;\n            }\n            case Kind_1.Kind.CHARGE:\n                currentPart.charge = line.value;\n                if (validUnsaturation) {\n                    unsaturation -= line.value;\n                }\n                break;\n            default:\n                throw new Error('Unimplemented Kind in getInfo', line.kind);\n        }\n        if (currentElement) {\n            if (customUnsaturations[currentElement] !== undefined) {\n                unsaturation += customUnsaturations[currentElement] * line.multiplier;\n            }\n            else if (chemical_elements_1.unsaturationsObject[currentElement] !== undefined) {\n                unsaturation += chemical_elements_1.unsaturationsObject[currentElement] * line.multiplier;\n            }\n            else {\n                validUnsaturation = false;\n            }\n        }\n    }\n    // need to calculate the observedMonoisotopicMass\n    if (currentPart.charge) {\n        currentPart[msemFieldName] =\n            (currentPart[emFieldName] - currentPart.charge * chemical_elements_1.ELECTRON_MASS) /\n                Math.abs(currentPart.charge);\n    }\n    if (validUnsaturation) {\n        currentPart.unsaturation = unsaturation / 2 + 1;\n    }\n    return currentPart;\n}\n//# sourceMappingURL=getInfoInternal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIsotopesInfo = getIsotopesInfo;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst Kind_1 = require(\"../Kind\");\n/** @typedef {import('./getIsotopesInfo.types').IsotopesInfo} IsotopesInfo\n\n/**\n *\n * @param {*} parts\n * @returns {[]|IsotopesInfo}\n */\nfunction getIsotopesInfo(parts) {\n    if (parts.length === 0)\n        return [];\n    if (parts.length > 1) {\n        throw new Error('getIsotopesInfo can not be applied on multipart MF');\n    }\n    return getProcessedPart(parts[0]);\n}\n/**\n * @returns {IsotopesInfo}\n */\nfunction getProcessedPart(part) {\n    /** @type {IsotopesInfo} */\n    let result = {\n        charge: 0,\n        isotopes: [],\n    };\n    for (let line of part) {\n        switch (line.kind) {\n            case Kind_1.Kind.ISOTOPE: {\n                let isotopeKey = line.value.isotope + line.value.atom;\n                let isotope = chemical_elements_1.isotopesObject[isotopeKey];\n                if (!isotope) {\n                    throw new Error('unknown isotope:', line.value.atom, line.value.isotope);\n                }\n                result.isotopes.push({\n                    atom: line.value.atom,\n                    number: line.multiplier,\n                    distribution: [{ x: isotope.mass, y: 1 }],\n                    naturalDeltaNeutrons: chemical_elements_1.stableIsotopesObject[isotopeKey]?.deltaNeutrons ?? 0,\n                });\n                break;\n            }\n            case Kind_1.Kind.ISOTOPE_RATIO: {\n                let element = chemical_elements_1.elementsAndStableIsotopesObject[line.value.atom];\n                if (!element)\n                    throw new Error('unknown element:', line.value);\n                let distribution = getDistribution(element.isotopes, line.value.ratio);\n                let maxIndex = 0;\n                for (let i = 1; i < distribution.length; i++) {\n                    if (distribution[i].y > distribution[maxIndex].y) {\n                        maxIndex = i;\n                    }\n                }\n                let mostAbundantKey = Math.round(distribution[maxIndex].x) + line.value.atom;\n                result.isotopes.push({\n                    atom: line.value.atom,\n                    number: line.multiplier,\n                    distribution,\n                    naturalDeltaNeutrons: chemical_elements_1.stableIsotopesObject[mostAbundantKey]?.deltaNeutrons ?? 0,\n                });\n                break;\n            }\n            case Kind_1.Kind.ATOM: {\n                let element = chemical_elements_1.elementsAndStableIsotopesObject[line.value];\n                if (!element)\n                    throw new Error('unknown element:', line.value);\n                result.isotopes.push({\n                    atom: line.value,\n                    number: line.multiplier,\n                    distribution: element.isotopes.map((e) => ({\n                        x: e.mass,\n                        y: e.abundance,\n                    })),\n                    naturalDeltaNeutrons: 0,\n                });\n                break;\n            }\n            case Kind_1.Kind.CHARGE:\n                result.charge += line.value;\n                break;\n            default:\n                throw new Error('partToMF unhandled Kind: ', line.kind);\n        }\n    }\n    return result;\n}\nfunction getDistribution(isotopesArray, ratio) {\n    let ratios = normalize(ratio);\n    let result = [];\n    if (ratios.length > isotopesArray.length) {\n        throw new Error(`the number of specified ratios is bigger that the number of stable isotopes: ${chemical_elements_1.isotopesObject}`);\n    }\n    for (let i = 0; i < ratios.length; i++) {\n        result.push({\n            x: isotopesArray[i].mass,\n            y: ratios[i],\n        });\n    }\n    return result;\n}\nfunction normalize(array) {\n    let sum = array.reduce((prev, current) => prev + current, 0);\n    return array.map((a) => a / sum);\n}\n//# sourceMappingURL=getIsotopesInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partsToDisplay = partsToDisplay;\nconst Kind_1 = require(\"../Kind\");\nconst toDisplay_js_1 = require(\"./toDisplay.js\");\n/**\n * Converts an array of mf elements to an array of formatting information\n * @param {Array<Object>} result of the parse method\n */\nfunction partsToDisplay(parts) {\n    let lines = [];\n    for (let part of parts) {\n        if (lines.length > 0)\n            lines.push({ kind: Kind_1.Kind.SALT, value: '•' });\n        for (let partLine of part) {\n            lines.push(partLine);\n            if (partLine.multiplier) {\n                lines.push({\n                    kind: Kind_1.Kind.MULTIPLIER,\n                    value: partLine.multiplier,\n                });\n            }\n        }\n    }\n    return (0, toDisplay_js_1.toDisplay)(lines);\n}\n//# sourceMappingURL=partsToDisplay.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partsToMF = partsToMF;\nconst partToMF_1 = require(\"./partToMF\");\nfunction partsToMF(parts, options) {\n    let mf = [];\n    for (let part of parts) {\n        mf.push((0, partToMF_1.partToMF)(part, options));\n    }\n    return mf.join(' . ');\n}\n//# sourceMappingURL=partsToMF.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toParts = toParts;\nconst atom_sorter_1 = require(\"atom-sorter\");\nconst chemical_groups_1 = require(\"chemical-groups\");\nconst Kind_1 = require(\"../Kind\");\n/**\n *\n * @param {*} lines\n * @param {object} [options={}]\n * @param {boolean} [options.expand=true] - Should we expand the groupsObject\n */\nfunction toParts(lines, options = {}) {\n    const { expand: shouldExpandGroupsObject = true } = options;\n    let parts = [];\n    let currentPart = createNewPart();\n    let previousKind = Kind_1.Kind.BEGIN;\n    parts.push(currentPart);\n    for (let line of lines) {\n        switch (line.kind) {\n            case Kind_1.Kind.ATOM:\n            case Kind_1.Kind.ISOTOPE_RATIO:\n            case Kind_1.Kind.ISOTOPE:\n            case Kind_1.Kind.CHARGE:\n                currentPart.lines.push({ ...line, multiplier: 1 });\n                break;\n            case Kind_1.Kind.OPENING_PARENTHESIS:\n                openingParenthesis(currentPart);\n                break;\n            case Kind_1.Kind.CLOSING_PARENTHESIS:\n                closingParenthesis(currentPart);\n                break;\n            case Kind_1.Kind.PRE_MULTIPLIER:\n                preMultiplier(currentPart, line);\n                break;\n            case Kind_1.Kind.MULTIPLIER:\n                postMultiplier(currentPart, line.value, previousKind);\n                break;\n            case Kind_1.Kind.SALT:\n                globalPartMultiplier(currentPart);\n                currentPart = createNewPart();\n                parts.push(currentPart);\n                break;\n            case Kind_1.Kind.ANCHOR: // we ignore anchors to create the parts and canonized MF\n                break;\n            case Kind_1.Kind.COMMENT: // we ignore comments to create the parts and canonized MF\n                break;\n            case Kind_1.Kind.TEXT:\n                break;\n            default:\n                throw new Error(`Can not process mf having: ${line.kind}`);\n        }\n        previousKind = line.kind;\n    }\n    globalPartMultiplier(currentPart);\n    if (shouldExpandGroupsObject)\n        expandGroupsObject(parts);\n    return combineAtomsIsotopesCharges(parts);\n}\nfunction createNewPart() {\n    let currentMultiplier = { value: 1, fromIndex: 0 };\n    return { lines: [], multipliers: [currentMultiplier], currentMultiplier };\n}\nfunction openingParenthesis(currentPart) {\n    currentPart.currentMultiplier = {\n        value: 1,\n        fromIndex: currentPart.lines.length,\n    };\n    currentPart.multipliers.push(currentPart.currentMultiplier);\n}\nfunction closingParenthesis(currentPart) {\n    currentPart.currentMultiplier = currentPart.multipliers.pop();\n    if (currentPart.currentMultiplier !== 1) {\n        for (let i = currentPart.currentMultiplier.fromIndex; i < currentPart.lines.length; i++) {\n            currentPart.lines[i].multiplier *= currentPart.currentMultiplier.value;\n        }\n    }\n}\nfunction preMultiplier(currentPart, line) {\n    currentPart.currentMultiplier.value *= line.value;\n}\nfunction globalPartMultiplier(currentPart) {\n    for (let i = currentPart.multipliers[0].fromIndex; i < currentPart.lines.length; i++) {\n        currentPart.lines[i].multiplier *= currentPart.multipliers[0].value;\n    }\n}\nfunction postMultiplier(currentPart, value, previousKind) {\n    if (previousKind === Kind_1.Kind.CLOSING_PARENTHESIS) {\n        // need to apply to everything till the previous parenthesis\n        for (let i = currentPart.currentMultiplier.fromIndex; i < currentPart.lines.length; i++) {\n            currentPart.lines[i].multiplier *= value;\n        }\n    }\n    else {\n        // just applies to the previous element\n        currentPart.lines.at(-1).multiplier *= value;\n    }\n}\nfunction expandGroupsObject(parts) {\n    for (let part of parts) {\n        let expanded = false;\n        for (let i = 0; i < part.lines.length; i++) {\n            let line = part.lines[i];\n            if (line.kind === Kind_1.Kind.ATOM) {\n                let group = chemical_groups_1.groupsObject[line.value];\n                if (group) {\n                    expanded = true;\n                    for (let element of group.elements) {\n                        if (element.isotope) {\n                            part.lines.push({\n                                kind: 'isotope',\n                                value: { atom: element.symbol, isotope: element.isotope },\n                                multiplier: line.multiplier * element.number,\n                            });\n                        }\n                        else {\n                            part.lines.push({\n                                kind: 'atom',\n                                value: element.symbol,\n                                multiplier: line.multiplier * element.number,\n                            });\n                        }\n                    }\n                    part.lines[i] = undefined;\n                }\n            }\n        }\n        if (expanded)\n            part.lines = part.lines.filter(Boolean);\n    }\n}\nfunction combineAtomsIsotopesCharges(parts) {\n    let results = [];\n    for (let part of parts) {\n        let result = [];\n        results.push(result);\n        calculateAndSortKeys(part);\n        let currentKey = '';\n        for (let key of part.keys) {\n            if (key.key === Kind_1.Kind.CHARGE) {\n                if (currentKey !== key.key) {\n                    result.push({\n                        kind: Kind_1.Kind.CHARGE,\n                        value: key.value.value * key.value.multiplier,\n                    });\n                }\n                else {\n                    result.at(-1).value += key.value.value * key.value.multiplier;\n                }\n            }\n            else if (currentKey !== key.key) {\n                result.push(key.value);\n            }\n            else {\n                result.at(-1).multiplier += key.value.multiplier;\n            }\n            currentKey = key.key;\n        }\n        result.sort((a, b) => {\n            if (a.kind === Kind_1.Kind.CHARGE)\n                return 1;\n            if (b.kind === Kind_1.Kind.CHARGE)\n                return -1;\n            let atomA = a.kind === Kind_1.Kind.ATOM ? a.value : a.value.atom;\n            let atomB = b.kind === Kind_1.Kind.ATOM ? b.value : b.value.atom;\n            if (atomA !== atomB)\n                return (0, atom_sorter_1.atomSorter)(atomA, atomB);\n            // same atome but some isotopes ...\n            if (a.kind === Kind_1.Kind.ATOM)\n                return -1;\n            if (b.kind === Kind_1.Kind.ATOM)\n                return 1;\n            if (a.kind === Kind_1.Kind.ISOTOPE)\n                return -1;\n            if (b.kind === Kind_1.Kind.ISOTOPE)\n                return 1;\n            if (a.kind === Kind_1.Kind.ISOTOPE_RATIO)\n                return -1;\n            if (b.kind === Kind_1.Kind.ISOTOPE_RATIO)\n                return 1;\n            return 0;\n        });\n    }\n    return results;\n}\nfunction calculateAndSortKeys(part) {\n    part.keys = [];\n    for (let line of part.lines) {\n        part.keys.push({ key: getKey(line), value: line });\n    }\n    part.keys.sort((a, b) => stringComparator(a.key, b.key));\n}\nfunction getKey(line) {\n    let key = [line.kind];\n    switch (line.kind) {\n        case Kind_1.Kind.CHARGE:\n            break;\n        default:\n            if (typeof line.value === 'string') {\n                key.push(line.value);\n            }\n            else {\n                for (let prop of Object.keys(line.value).toSorted()) {\n                    key.push(line.value[prop]);\n                }\n            }\n    }\n    return key.join('-');\n}\nfunction stringComparator(a, b) {\n    if (a < b)\n        return -1;\n    if (a > b)\n        return 1;\n    return 0;\n}\n//# sourceMappingURL=toParts.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toText = toText;\nconst Format_1 = require(\"../Format\");\nconst subSuperscript_1 = require(\"./subSuperscript\");\nfunction toText(lines) {\n    let text = [];\n    for (let line of lines) {\n        switch (line.kind) {\n            case Format_1.Format.SUBSCRIPT: {\n                const value = String(line.value);\n                for (let i = 0; i < value.length; i++) {\n                    const char = value[i];\n                    if (subSuperscript_1.subscript[char]) {\n                        text.push(subSuperscript_1.subscript[char]);\n                    }\n                    else {\n                        throw new Error(`Subscript problem with: ${char}`);\n                    }\n                }\n                break;\n            }\n            case Format_1.Format.SUPERSCRIPT: {\n                const value = String(line.value);\n                for (let i = 0; i < value.length; i++) {\n                    const char = value[i];\n                    if (subSuperscript_1.superscript[char]) {\n                        text.push(subSuperscript_1.superscript[char]);\n                    }\n                    else {\n                        throw new Error(`Superscript problem with: ${char}`);\n                    }\n                }\n                break;\n            }\n            case Format_1.Format.SUPERIMPOSE: {\n                const under = String(line.under);\n                for (let i = 0; i < under.length; i++) {\n                    const char = under[i];\n                    if (subSuperscript_1.subscript[char]) {\n                        text.push(subSuperscript_1.subscript[char]);\n                    }\n                    else {\n                        throw new Error(`Subscript problem with: ${char}`);\n                    }\n                }\n                const over = String(line.over);\n                for (let i = 0; i < over.length; i++) {\n                    const char = over[i];\n                    if (subSuperscript_1.superscript[char]) {\n                        text.push(subSuperscript_1.superscript[char]);\n                    }\n                    else {\n                        throw new Error(`Superscript problem with: ${char}`);\n                    }\n                }\n                break;\n            }\n            default:\n                text.push(line.value);\n        }\n    }\n    return text.join('');\n}\n//# sourceMappingURL=toText.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MFInternal = void 0;\nconst Kind_1 = require(\"./Kind\");\nconst ensureCase_1 = require(\"./ensureCase\");\nconst parse_1 = require(\"./parse\");\nconst flatten_1 = require(\"./util/flatten\");\nconst getEA_1 = require(\"./util/getEA\");\nconst getElements_1 = require(\"./util/getElements\");\nconst getInfo_1 = require(\"./util/getInfo\");\nconst getIsotopesInfo_1 = require(\"./util/getIsotopesInfo\");\nconst partsToDisplay_1 = require(\"./util/partsToDisplay\");\nconst partsToMF_1 = require(\"./util/partsToMF\");\nconst toDisplay_1 = require(\"./util/toDisplay\");\nconst toHtml_1 = require(\"./util/toHtml\");\nconst toParts_1 = require(\"./util/toParts\");\nconst toText_1 = require(\"./util/toText\");\n/** @typedef {import('./util/getIsotopesInfo.types').IsotopesInfo} IsotopesInfo */\n/** @typedef {import('./util/getInfo.types').MFInfo} MFInfo */\n/** @typedef {import('./util/getInfo.types').MFInfoWithParts} MFInfoWithParts */\n/**\n * Class allowing to deal with molecular formula and derived information\n */\nclass MFInternal {\n    constructor(mf, options = {}) {\n        const { flattenLimit = 0 } = options;\n        if (options.ensureCase) {\n            mf = (0, ensureCase_1.ensureCase)(mf);\n        }\n        this.parsed = (0, parse_1.parse)(mf);\n        // This is definitely not the fastest way to do it but it allows to flatten the formula if needed and then parse it again to have a clean structure without multiplier ranges. We can consider doing it in one pass in the future if performance is an issue.\n        if (flattenLimit > 0 &&\n            this.parsed.some((entry) => entry.kind === Kind_1.Kind.MULTIPLIER_RANGE)) {\n            try {\n                const flattened = (0, flatten_1.flatten)(this.parsed, { limit: flattenLimit });\n                this.parsed = (0, parse_1.parse)(flattened.join('.'));\n            }\n            catch (error) {\n                // eslint-disable-next-line no-console\n                console.error(error.toString());\n            }\n        }\n        this.cache = {};\n    }\n    /**\n     * Returns an array of objects with kind and value that can be used to easily\n     * display the molecular formula.\n     * @returns {{kind: string, value: string}[]}\n     */\n    toDisplay() {\n        if (!this.cache.displayed)\n            this.cache.displayed = (0, toDisplay_1.toDisplay)(this.parsed);\n        return this.cache.displayed;\n    }\n    /**\n     * Returns a string that represents the molecular formula adding subscript and superscript in HTML.\n     * @returns {string}\n     */\n    toHtml() {\n        if (!this.cache.html) {\n            this.toDisplay();\n            this.cache.html = (0, toHtml_1.toHtml)(this.cache.displayed);\n        }\n        return this.cache.html;\n    }\n    /**\n     * Returns a string that represents the molecular formula adding subscript and superscript\n     * using Unicode characters. This can not be parsed anymore so kind of dead end ...\n     * @returns {string}\n     */\n    toText() {\n        if (!this.cache.text) {\n            this.toDisplay();\n            this.cache.text = (0, toText_1.toText)(this.cache.displayed);\n        }\n        return this.cache.text;\n    }\n    /**\n     * Similar to toText but returns a canonic string in which the atoms are sorted using the Hill system\n     * @returns {string}\n     */\n    toCanonicText() {\n        if (!this.cache.canonicText) {\n            this.cache.canonicText = new MFInternal(this.toMF()).toText();\n        }\n        return this.cache.canonicText;\n    }\n    toParts(options) {\n        if (options) {\n            return (0, toParts_1.toParts)(this.parsed, options);\n        }\n        // we don't want to cache the parts if we are using options\n        if (!this.cache.parts) {\n            this.cache.parts = (0, toParts_1.toParts)(this.parsed, options);\n        }\n        return this.cache.parts;\n    }\n    /**\n     * Returns an object with the global MF, global charge, monoisotopic mass and mass\n     * as well as the same information for all the parts\n     * @param {object} [options={}] options\n     * @param {object} [options.customUnsaturations={}] custom unsaturations\n     * @param {string} [options.emFieldName='monoisotopicMass'] name of the monoisotopic mass field\n     * @param {string} [options.msemFieldName='observedMonoisotopicMass'] name of the observed monoisotopic mass field\n     * @returns {MFInfo|MFInfoWithParts}\n     */\n    getInfo(options = {}) {\n        if (!this.cache.info) {\n            this.toParts();\n            this.cache.info = (0, getInfo_1.getInfo)(this.cache.parts, options);\n        }\n        return this.cache.info;\n    }\n    /**\n     * Returns an object with the elemental analysis\n     * @returns {*[]}\n     */\n    getEA() {\n        if (!this.cache.ea) {\n            this.toParts();\n            this.cache.ea = (0, getEA_1.getEA)(this.cache.parts);\n        }\n        return this.cache.ea;\n    }\n    /**\n     * Get the different elements for each part\n     * @returns {*[]}\n     */\n    getElements() {\n        if (!this.cache.elements) {\n            this.toParts();\n            this.cache.elements = (0, getElements_1.getElements)(this.cache.parts);\n        }\n        return this.cache.elements;\n    }\n    /**\n     * Returns an array with each atom and isotopic composition\n     * @returns {IsotopesInfo}\n     */\n    getIsotopesInfo(options = {}) {\n        if (!this.cache.isotopesInfo) {\n            this.toParts();\n            this.cache.isotopesInfo = (0, getIsotopesInfo_1.getIsotopesInfo)(this.cache.parts, options);\n        }\n        return this.cache.isotopesInfo;\n    }\n    /**\n     * Get a canonized MF\n     * @returns {string}\n     */\n    toMF() {\n        if (!this.cache.mf) {\n            this.toParts();\n            this.cache.mf = (0, partsToMF_1.partsToMF)(this.cache.parts);\n        }\n        return this.cache.mf;\n    }\n    /**\n     * Get a canonized MF\n     * @returns {string}\n     */\n    toNeutralMF() {\n        if (!this.cache.neutralMF) {\n            this.toParts();\n            this.cache.neutralMF = (0, partsToMF_1.partsToMF)(this.cache.parts, { neutral: true });\n        }\n        return this.cache.neutralMF;\n    }\n    canonize() {\n        this.toParts();\n        this.cache.displayed = (0, partsToDisplay_1.partsToDisplay)(this.cache.parts);\n        this.cache.html = undefined;\n    }\n    flatten(options) {\n        return (0, flatten_1.flatten)(this.parsed, options);\n    }\n}\nexports.MFInternal = MFInternal;\n//# sourceMappingURL=MFInternal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MF = void 0;\nconst MFInternal_1 = require(\"./MFInternal\");\nclass MF {\n    internal;\n    constructor(mf, options = {}) {\n        this.internal = new MFInternal_1.MFInternal(mf, options);\n    }\n    /**\n     * Returns an array of objects with kind and value that can be used to easily\n     * display the molecular formula.\n     */\n    toDisplay() {\n        return this.internal.toDisplay();\n    }\n    /**\n     * Returns a string that represents the molecular formula adding subscript and superscript in HTML.\n     */\n    toHtml() {\n        return this.internal.toHtml();\n    }\n    /**\n     * Returns a string that represents the molecular formula adding subscript and superscript\n     * using Unicode characters. This can not be parsed anymore so kind of dead end ...\n     */\n    toText() {\n        return this.internal.toText();\n    }\n    /**\n     * Similar to toText but returns a canonic string in which the atoms are sorted using the Hill system\n     */\n    toCanonicText() {\n        return this.internal.toCanonicText();\n    }\n    toParts(options) {\n        return this.internal.toParts(options);\n    }\n    /**\n     * Returns an object with the global MF, global charge, monoisotopic mass and mass\n     * as well as the same information for all the parts\n     */\n    getInfo(options) {\n        return this.internal.getInfo(options);\n    }\n    /**\n     * Returns an object with the elemental analysis\n     */\n    getEA() {\n        return this.internal.getEA();\n    }\n    /**\n     * Get the different elements for each part\n     */\n    getElements() {\n        return this.internal.getElements();\n    }\n    /**\n     * Returns an array with each atom and isotopic composition\n     */\n    getIsotopesInfo(options = {}) {\n        return this.internal.getIsotopesInfo(options);\n    }\n    /**\n     * Get a canonized parsable Molecule Formula\n     */\n    toMF() {\n        return this.internal.toMF();\n    }\n    /**\n     * Get a canonized MF\n     */\n    toNeutralMF() {\n        return this.internal.toNeutralMF();\n    }\n    canonize() {\n        return this.internal.canonize();\n    }\n    flatten(options) {\n        return this.internal.flatten(options);\n    }\n}\nexports.MF = MF;\n//# sourceMappingURL=MF.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseToHtml = parseToHtml;\nconst parse_js_1 = require(\"./parse.js\");\nconst toDisplay_js_1 = require(\"./util/toDisplay.js\");\nconst toHtml_js_1 = require(\"./util/toHtml.js\");\n/**\n * Parse a molecular formula and converts it to an HTML code\n * @param {String} mf String containing the molecular formula\n */\nfunction parseToHtml(mf) {\n    let parsed = (0, parse_js_1.parse)(mf);\n    let display = (0, toDisplay_js_1.toDisplay)(parsed);\n    return (0, toHtml_js_1.toHtml)(display);\n}\n//# sourceMappingURL=parseToHtml.js.map","\"use strict\";\n/**\n * Ensure that the sequence is in uppercase taking into account possible modifications\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureUppercaseSequence = ensureUppercaseSequence;\nfunction ensureUppercaseSequence(sequence) {\n    let parenthesisCounter = 0;\n    let parts = [];\n    let part = '';\n    for (let i = 0; i < sequence.length; i++) {\n        let currentSymbol = sequence[i];\n        if (currentSymbol === '(' && parenthesisCounter === 0 && part) {\n            parts.push(part);\n            part = currentSymbol;\n        }\n        else if (currentSymbol === ')' && parenthesisCounter === 0) {\n            part += currentSymbol;\n            parts.push(part);\n            part = '';\n        }\n        else {\n            part += currentSymbol;\n        }\n    }\n    if (part)\n        parts.push(part);\n    for (let i = 0; i < parts.length; i++) {\n        if (!parts[i].startsWith('(') && parts[i].match(/^[a-z]+$/)) {\n            parts[i] = parts[i].toUpperCase();\n        }\n    }\n    return parts.join('');\n}\n//# sourceMappingURL=ensureUppercaseSequence.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEutrophicationPotential = getEutrophicationPotential;\nconst mf_parser_1 = require(\"mf-parser\");\nfunction getEutrophicationPotential(mfString) {\n    let parsed = new mf_parser_1.MF(mfString);\n    let info = parsed.getInfo();\n    let mf = info.mf;\n    let mw = info.mass;\n    let nC = info.atoms.C || 0;\n    let nO = info.atoms.O || 0;\n    let nN = info.atoms.N || 0;\n    let nP = info.atoms.P || 0;\n    let nH = info.atoms.H || 0;\n    let atoms = Object.keys(info.atoms);\n    for (let atom of atoms) {\n        if (!['C', 'H', 'N', 'O', 'P'].includes(atom)) {\n            return {\n                log: `EP can not be calculated because the MF contains the element: ${atom}`,\n            };\n        }\n    }\n    let vRef = 1;\n    let mwRef = 94.97;\n    let thOD = nC + (nH - 3 * nN) / 4 - nO / 2;\n    let v = nP + nN / 16 + thOD / 138;\n    let ep = v / mw / (vRef / mwRef);\n    return {\n        v,\n        thOD,\n        ep,\n        mf,\n        mw,\n        log: 'Successful calculation',\n    };\n}\n//# sourceMappingURL=getEutrophicationPotential.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getMsem = getMsem;\nconst chemical_elements_1 = require(\"chemical-elements\");\nfunction getMsem(em, charge) {\n    if (charge > 0) {\n        return em / charge - chemical_elements_1.ELECTRON_MASS;\n    }\n    else if (charge < 0) {\n        return em / (charge * -1) + chemical_elements_1.ELECTRON_MASS;\n    }\n    else {\n        return 0;\n    }\n}\n//# sourceMappingURL=getMsem.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getMsInfo = getMsInfo;\nconst getMsem_1 = require(\"./getMsem\");\n/**\n * Returns an object containing:\n * {ms: {em, charge, ionization}, ionization: {}}\n * We return the ionization in order to know which one has been selected\n */\nfunction getMsInfo(entry, options = {}) {\n    const { allowNeutralMolecules, ionization = { mf: '', em: 0, charge: 0 }, forceIonization = false, targetMass, } = options;\n    let realIonization = ionization;\n    if (!forceIonization && entry.ionization && entry.ionization.mf !== '') {\n        realIonization = entry.ionization;\n    }\n    let ms = {\n        ionization: realIonization.mf,\n        em: 0,\n        charge: entry.charge + realIonization.charge,\n    };\n    if (ms.charge !== 0) {\n        ms.em = (0, getMsem_1.getMsem)(entry.em + realIonization.em, ms.charge);\n    }\n    else if (allowNeutralMolecules) {\n        ms.em = entry.em + realIonization.em;\n    }\n    if (targetMass) {\n        ms.delta = targetMass - ms.em;\n        ms.ppm = ((targetMass - ms.em) / ms.em) * 1e6;\n    }\n    return {\n        ms,\n        ionization: realIonization,\n    };\n}\n//# sourceMappingURL=getMsInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRangesForFragment = getRangesForFragment;\nconst mf_parser_1 = require(\"mf-parser\");\nfunction getRangesForFragment(ranges) {\n    ranges = structuredClone(ranges);\n    if (typeof ranges === 'string') {\n        // need to convert to ranges\n        let parsed = (0, mf_parser_1.parse)(ranges.replaceAll(/[\\t\\n\\r ]/g, ''));\n        let newRanges = [];\n        // example ClBr2(CH2)0-2NO\n        // the idea is that as long as we don't have a range we don't really care\n        // there is a limitation is that the range has to be first level of parenthesis\n        let parenthesisLevel = 0;\n        let currentMF = ''; // start at an atom first level or a parenthesis\n        for (let item of parsed) {\n            switch (item.kind) {\n                case mf_parser_1.Kind.ATOM:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        newRanges.push({\n                            mf: currentMF,\n                        });\n                        currentMF = '';\n                    }\n                    currentMF += item.value;\n                    break;\n                case mf_parser_1.Kind.ISOTOPE:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        newRanges.push({\n                            mf: currentMF,\n                        });\n                        currentMF = '';\n                    }\n                    currentMF += `[${item.value.isotope}${item.value.atom}]`;\n                    break;\n                case mf_parser_1.Kind.MULTIPLIER:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        newRanges.push({\n                            mf: currentMF,\n                            max: item.value,\n                        });\n                        currentMF = '';\n                    }\n                    else {\n                        currentMF += item.value;\n                    }\n                    break;\n                case mf_parser_1.Kind.MULTIPLIER_RANGE:\n                    if (parenthesisLevel !== 0) {\n                        throw new Error('Range multiplier can only be at the first level');\n                    }\n                    newRanges.push({\n                        mf: currentMF,\n                        min: item.value.from,\n                        max: item.value.to,\n                    });\n                    currentMF = '';\n                    break;\n                case mf_parser_1.Kind.OPENING_PARENTHESIS:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        newRanges.push({\n                            mf: currentMF,\n                        });\n                        currentMF = '';\n                    }\n                    parenthesisLevel++;\n                    currentMF += '(';\n                    break;\n                case mf_parser_1.Kind.CLOSING_PARENTHESIS:\n                    parenthesisLevel--;\n                    currentMF += ')';\n                    break;\n                default:\n                    throw new Error(`can not preprocess ${ranges}`);\n            }\n        }\n        if (currentMF) {\n            newRanges.push({ mf: currentMF });\n        }\n        ranges = newRanges;\n    }\n    let possibilities = [];\n    for (const range of ranges) {\n        if (range.max === 0)\n            continue;\n        let max = range.max === undefined ? 1 : range.max;\n        possibilities.push(`${range.mf}0-${max}`);\n    }\n    return possibilities.join(' ');\n}\n//# sourceMappingURL=getRangesForFragment.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MFRange = void 0;\nconst mf_parser_1 = require(\"mf-parser\");\nclass MFRange {\n    constructor(mf) {\n        this.range = getRange(mf);\n    }\n    isInRange(mf) {\n        const target = getRange(mf);\n        let rangeIndex = 0;\n        let targetIndex = 0;\n        while (rangeIndex < this.range.length && targetIndex < target.length) {\n            const rangeElement = this.range[rangeIndex];\n            const targetElement = target[targetIndex];\n            if (rangeElement.element === targetElement.element) {\n                // Check if the target's range is within the range's range\n                if (targetElement.range.from >= rangeElement.range.from &&\n                    targetElement.range.to <= rangeElement.range.to) {\n                    targetIndex++;\n                    rangeIndex++;\n                }\n                else {\n                    return false; // Target element is out of range\n                }\n            }\n            else if (rangeElement.element < targetElement.element) {\n                if (rangeElement.range.from > 0) {\n                    return false; // Remaining range elements must have a minimum of 1\n                }\n                rangeIndex++;\n            }\n            else {\n                return false; // Target element is not in the range\n            }\n        }\n        if (rangeIndex < this.range.length) {\n            if (this.range[rangeIndex].range.from > 0) {\n                return false; // Remaining range elements must have a minimum of 1\n            }\n            rangeIndex++;\n        }\n        if (targetIndex < target.length) {\n            return false; // Not all target elements were matched\n        }\n        return true; // All target elements are within the range\n    }\n}\nexports.MFRange = MFRange;\nfunction getRange(mf) {\n    const parsed = (0, mf_parser_1.parse)(mf, { expandGroups: true, simplify: true });\n    const ranges = [];\n    let currentRange;\n    for (const item of parsed) {\n        switch (item.kind) {\n            case 'atom':\n                currentRange = { element: item.value, range: { from: 1, to: 1 } };\n                ranges.push(currentRange);\n                break;\n            case 'isotope':\n                currentRange = {\n                    element: item.value.isotope + item.value.atom,\n                    range: { from: 1, to: 1 },\n                };\n                break;\n            case 'multiplier':\n                if (currentRange) {\n                    currentRange.range.from = item.value;\n                    currentRange.range.to = item.value;\n                }\n                else {\n                    throw new Error(`MFRange: Multiplier without preceding element in MF: ${mf}`);\n                }\n                break;\n            case 'multiplierRange':\n                if (currentRange) {\n                    currentRange.range.from = item.value.from;\n                    currentRange.range.to = item.value.to;\n                }\n                else {\n                    throw new Error(`MFRange: Multiplier range without preceding element in MF: ${mf}`);\n                }\n                break;\n            default:\n                throw new Error(`MFRange: Unknown kind: ${item.kind} in MF: ${mf}`);\n        }\n    }\n    return ranges.toSorted((a, b) => {\n        if (a.element < b.element)\n            return -1;\n        if (a.element > b.element)\n            return 1;\n        return 0;\n    });\n}\n//# sourceMappingURL=MFRange.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.mfDiff = mfDiff;\nconst mf_parser_1 = require(\"mf-parser\");\nfunction mfDiff(mfString1, mfString2) {\n    let mf1 = new mf_parser_1.MF(mfString1).getInfo().atoms;\n    let mf2 = new mf_parser_1.MF(mfString2).getInfo().atoms;\n    let atoms = Object.keys(mf1);\n    for (const atom of Object.keys(mf2)) {\n        if (!atoms.includes(atom))\n            atoms.push(atom);\n    }\n    let mf = '';\n    for (let atom of atoms) {\n        let diff = (mf1[atom] || 0) - (mf2[atom] || 0);\n        if (diff)\n            mf += atom + diff;\n    }\n    return new mf_parser_1.MF(mf).toMF();\n}\n//# sourceMappingURL=mfDiff.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.preprocessIonizations = preprocessIonizations;\nconst mf_parser_1 = require(\"mf-parser\");\nfunction preprocessIonizations(ionizationsString = '') {\n    if (Array.isArray(ionizationsString))\n        return ionizationsString;\n    const ionizations = ionizationsString.split(/ *[\\t\\n\\r,.;]+ */);\n    // it is allowed to have ranges in Ionizations. We need to explode them.\n    const results = [];\n    for (const ionization of ionizations) {\n        const parts = new mf_parser_1.MF(ionization).flatten();\n        for (const part of parts) {\n            const info = new mf_parser_1.MF(part).getInfo();\n            results.push({\n                mf: part,\n                em: info.monoisotopicMass,\n                charge: info.charge,\n                atoms: info.atoms,\n            });\n        }\n    }\n    return results;\n}\n//# sourceMappingURL=preprocessIonizations.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.preprocessRanges = preprocessRanges;\nconst mf_parser_1 = require(\"mf-parser\");\nfunction preprocessRanges(ranges) {\n    ranges = structuredClone(ranges);\n    if (typeof ranges === 'string') {\n        // need to convert to ranges\n        let parsed = (0, mf_parser_1.parse)(ranges.replaceAll(/[\\t\\n\\r ]/g, ''));\n        let newRanges = [];\n        let current = {\n            mf: '',\n            min: 1,\n            max: 1,\n        };\n        // example ClBr2(CH2)0-2NO\n        // the idea is that has long as we don't have a range we don't really care\n        // but the range should only applied on the previous atom, group or parenthesis\n        // there is a limitation is that the range has to be first level of parenthesis\n        let parenthesisLevel = 0;\n        let currentMF = ''; // start at an atom first level or a parenthesis\n        for (let item of parsed) {\n            switch (item.kind) {\n                case mf_parser_1.Kind.ATOM:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        current.mf += currentMF;\n                        currentMF = '';\n                    }\n                    currentMF += item.value;\n                    break;\n                case mf_parser_1.Kind.ISOTOPE:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        current.mf += currentMF;\n                        currentMF = '';\n                    }\n                    currentMF += `[${item.value.isotope}${item.value.atom}]`;\n                    break;\n                case mf_parser_1.Kind.MULTIPLIER:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        current.mf += currentMF + item.value;\n                        currentMF = '';\n                    }\n                    else {\n                        currentMF += item.value;\n                    }\n                    break;\n                case mf_parser_1.Kind.MULTIPLIER_RANGE:\n                    if (parenthesisLevel !== 0) {\n                        throw new Error('Range multiplier can only be at the first level');\n                    }\n                    newRanges.push({\n                        mf: currentMF,\n                        min: item.value.from,\n                        max: item.value.to,\n                    });\n                    currentMF = '';\n                    break;\n                case mf_parser_1.Kind.OPENING_PARENTHESIS:\n                    if (parenthesisLevel === 0 && currentMF) {\n                        current.mf += currentMF;\n                        currentMF = '';\n                    }\n                    parenthesisLevel++;\n                    currentMF += '(';\n                    break;\n                case mf_parser_1.Kind.CLOSING_PARENTHESIS:\n                    parenthesisLevel--;\n                    currentMF += ')';\n                    break;\n                default:\n                    throw new Error(`can not preprocess ${ranges}`);\n            }\n        }\n        if (currentMF) {\n            current.mf += currentMF;\n        }\n        if (current.mf) {\n            newRanges.push(current);\n        }\n        ranges = newRanges;\n    }\n    let possibilities = [];\n    for (let i = 0; i < ranges.length; i++) {\n        let range = ranges[i];\n        let min = range.min === undefined ? 0 : range.min;\n        let max = range.max === undefined ? 1 : range.max;\n        let possibility = {\n            mf: range.mf,\n            originalMinCount: min, // value defined by the user\n            originalMaxCount: max, // value defined by the user\n            currentMinCount: min,\n            currentMaxCount: max,\n            currentCount: min,\n            currentMonoisotopicMass: 0,\n            currentCharge: 0,\n            currentUnsaturation: 0,\n            initialOrder: i,\n            minInnerMass: 0,\n            maxInnerMass: 0,\n            minInnerCharge: 0,\n            maxInnerCharge: 0,\n            minCharge: 0,\n            maxCharge: 0,\n            minMass: 0,\n            maxMass: 0,\n            innerCharge: false,\n        };\n        possibilities.push(possibility);\n        let info = new mf_parser_1.MF(range.mf).getInfo();\n        possibility.em = range.em || info.monoisotopicMass;\n        possibility.charge = range.charge || info.charge;\n        possibility.unsaturation =\n            range.unsaturation === undefined\n                ? (info.unsaturation - 1) * 2\n                : range.unsaturation;\n        possibility.atoms = info.atoms;\n        if (possibility.mf !== info.mf) {\n            possibility.isGroup = true;\n        }\n    }\n    possibilities = possibilities.filter((r) => r.originalMinCount !== 0 || r.originalMaxCount !== 0);\n    // we will sort the way we analyse the data\n    // 1. The one possibility parameter\n    // 2. The charged part\n    // 3. Decreasing em\n    possibilities.sort((a, b) => {\n        if (a.originalMinCount === a.originalMaxCount)\n            return -1; // should be in front, they are 'static'\n        if (b.originalMinCount === b.originalMaxCount)\n            return 1;\n        if (a.charge && b.charge) {\n            if (Math.abs(a.charge) > Math.abs(b.charge))\n                return -1;\n            if (Math.abs(a.charge) < Math.abs(b.charge))\n                return 1;\n            return b.em - a.em;\n        }\n        if (a.charge)\n            return -1;\n        if (b.charge)\n            return 1;\n        return b.em - a.em;\n    });\n    // we calculate couple of fixed values\n    for (let i = 0; i < possibilities.length; i++) {\n        for (let j = i; j < possibilities.length; j++) {\n            let possibility = possibilities[j];\n            if (possibility.em > 0) {\n                possibilities[i].minMass +=\n                    possibility.em * possibility.originalMinCount;\n                possibilities[i].maxMass +=\n                    possibility.em * possibility.originalMaxCount;\n            }\n            else {\n                possibilities[i].minMass +=\n                    possibility.em * possibility.originalMaxCount;\n                possibilities[i].maxMass +=\n                    possibility.em * possibility.originalMinCount;\n            }\n            if (possibility.charge > 0) {\n                possibilities[i].minCharge +=\n                    possibility.charge * possibility.originalMinCount;\n                possibilities[i].maxCharge +=\n                    possibility.charge * possibility.originalMaxCount;\n            }\n            else {\n                possibilities[i].minCharge +=\n                    possibility.charge * possibility.originalMaxCount;\n                possibilities[i].maxCharge +=\n                    possibility.charge * possibility.originalMinCount;\n            }\n        }\n    }\n    for (let i = 0; i < possibilities.length; i++) {\n        if (i < possibilities.length - 1) {\n            let possibility = possibilities[i];\n            let innerPossibility = possibilities[i + 1];\n            possibility.minInnerMass = innerPossibility.minMass;\n            possibility.maxInnerMass = innerPossibility.maxMass;\n            possibility.minInnerCharge = innerPossibility.minCharge;\n            possibility.maxInnerCharge = innerPossibility.maxCharge;\n            if (possibility.minInnerCharge || possibility.maxInnerCharge) {\n                possibility.innerCharge = true;\n            }\n        }\n    }\n    return possibilities;\n}\n//# sourceMappingURL=preprocessRanges.js.map","export const GAUSSIAN_EXP_FACTOR = -4 * Math.LN2;\nexport const ROOT_PI_OVER_LN2 = Math.sqrt(Math.PI / Math.LN2);\nexport const ROOT_THREE = Math.sqrt(3);\nexport const ROOT_2LN2 = Math.sqrt(2 * Math.LN2);\nexport const ROOT_2LN2_MINUS_ONE = Math.sqrt(2 * Math.LN2) - 1;\n//# sourceMappingURL=constants.js.map","import { ROOT_2LN2, GAUSSIAN_EXP_FACTOR, ROOT_PI_OVER_LN2, } from '../../../util/constants';\nimport erfinv from '../../../util/erfinv';\nexport class Gaussian {\n    constructor(options = {}) {\n        const { fwhm = 500, sd } = options;\n        this.fwhm = sd ? gaussianWidthToFWHM(2 * sd) : fwhm;\n    }\n    fwhmToWidth(fwhm = this.fwhm) {\n        return gaussianFwhmToWidth(fwhm);\n    }\n    widthToFWHM(width) {\n        return gaussianWidthToFWHM(width);\n    }\n    fct(x) {\n        return gaussianFct(x, this.fwhm);\n    }\n    getArea(height = calculateGaussianHeight({ fwhm: this.fwhm })) {\n        return getGaussianArea({ fwhm: this.fwhm, height });\n    }\n    getFactor(area) {\n        return getGaussianFactor(area);\n    }\n    getData(options = {}) {\n        return getGaussianData(this, options);\n    }\n    calculateHeight(area = 1) {\n        return calculateGaussianHeight({ fwhm: this.fwhm, area });\n    }\n    getParameters() {\n        return ['fwhm'];\n    }\n}\nexport function calculateGaussianHeight(options) {\n    let { fwhm = 500, area = 1, sd } = options;\n    if (sd)\n        fwhm = gaussianWidthToFWHM(2 * sd);\n    return (2 * area) / ROOT_PI_OVER_LN2 / fwhm;\n}\n/**\n * Calculate the height of the gaussian function of a specific width (fwhm) at a speicifc\n * x position (the gaussian is centered on x=0)\n * @param x\n * @param fwhm\n * @returns y\n */\nexport function gaussianFct(x, fwhm) {\n    return Math.exp(GAUSSIAN_EXP_FACTOR * Math.pow(x / fwhm, 2));\n}\nexport function gaussianWidthToFWHM(width) {\n    return width * ROOT_2LN2;\n}\nexport function gaussianFwhmToWidth(fwhm) {\n    return fwhm / ROOT_2LN2;\n}\nexport function getGaussianArea(options) {\n    let { fwhm = 500, sd, height = 1 } = options;\n    if (sd)\n        fwhm = gaussianWidthToFWHM(2 * sd);\n    return (height * ROOT_PI_OVER_LN2 * fwhm) / 2;\n}\nexport function getGaussianFactor(area = 0.9999) {\n    return Math.sqrt(2) * erfinv(area);\n}\nexport function getGaussianData(shape = {}, options = {}) {\n    let { fwhm = 500, sd } = shape;\n    if (sd)\n        fwhm = gaussianWidthToFWHM(2 * sd);\n    let { length, factor = getGaussianFactor(), height = calculateGaussianHeight({ fwhm }), } = options;\n    if (!length) {\n        length = Math.min(Math.ceil(fwhm * factor), Math.pow(2, 25) - 1);\n        if (length % 2 === 0)\n            length++;\n    }\n    const center = (length - 1) / 2;\n    const data = new Float64Array(length);\n    for (let i = 0; i <= center; i++) {\n        data[i] = gaussianFct(i - center, fwhm) * height;\n        data[length - 1 - i] = data[i];\n    }\n    return data;\n}\n//# sourceMappingURL=Gaussian.js.map","// https://en.wikipedia.org/wiki/Error_function#Inverse_functions\n// This code yields to a good approximation\n// If needed a better implementation using polynomial can be found on https://en.wikipedia.org/wiki/Error_function#Inverse_functions\nexport default function erfinv(x) {\n    let a = 0.147;\n    if (x === 0)\n        return 0;\n    let ln1MinusXSqrd = Math.log(1 - x * x);\n    let lnEtcBy2Plus2 = ln1MinusXSqrd / 2 + 2 / (Math.PI * a);\n    let firstSqrt = Math.sqrt(lnEtcBy2Plus2 ** 2 - ln1MinusXSqrd / a);\n    let secondSqrt = Math.sqrt(firstSqrt - lnEtcBy2Plus2);\n    return secondSqrt * (x > 0 ? 1 : -1);\n}\n//# sourceMappingURL=erfinv.js.map","import { ROOT_THREE } from '../../../util/constants';\nexport class Lorentzian {\n    constructor(options = {}) {\n        const { fwhm = 500 } = options;\n        this.fwhm = fwhm;\n    }\n    fwhmToWidth(fwhm = this.fwhm) {\n        return lorentzianFwhmToWidth(fwhm);\n    }\n    widthToFWHM(width) {\n        return lorentzianWidthToFWHM(width);\n    }\n    fct(x) {\n        return lorentzianFct(x, this.fwhm);\n    }\n    getArea(height = 1) {\n        return getLorentzianArea({ fwhm: this.fwhm, height });\n    }\n    getFactor(area) {\n        return getLorentzianFactor(area);\n    }\n    getData(options = {}) {\n        return getLorentzianData(this, options);\n    }\n    calculateHeight(area = 1) {\n        return calculateLorentzianHeight({ fwhm: this.fwhm, area });\n    }\n    getParameters() {\n        return ['fwhm'];\n    }\n}\nexport const calculateLorentzianHeight = ({ fwhm = 1, area = 1 }) => {\n    return (2 * area) / Math.PI / fwhm;\n};\nexport const getLorentzianArea = (options) => {\n    const { fwhm = 500, height = 1 } = options;\n    return (height * Math.PI * fwhm) / 2;\n};\nexport const lorentzianFct = (x, fwhm) => {\n    return fwhm ** 2 / (4 * x ** 2 + fwhm ** 2);\n};\nexport const lorentzianWidthToFWHM = (width) => {\n    return width * ROOT_THREE;\n};\nexport const lorentzianFwhmToWidth = (fwhm) => {\n    return fwhm / ROOT_THREE;\n};\nexport const getLorentzianFactor = (area = 0.9999) => {\n    if (area >= 1) {\n        throw new Error('area should be (0 - 1)');\n    }\n    const halfResidual = (1 - area) * 0.5;\n    const quantileFunction = (p) => Math.tan(Math.PI * (p - 0.5));\n    return ((quantileFunction(1 - halfResidual) - quantileFunction(halfResidual)) / 2);\n};\nexport const getLorentzianData = (shape = {}, options = {}) => {\n    let { fwhm = 500 } = shape;\n    let { length, factor = getLorentzianFactor(), height = calculateLorentzianHeight({ fwhm, area: 1 }), } = options;\n    if (!length) {\n        length = Math.min(Math.ceil(fwhm * factor), Math.pow(2, 25) - 1);\n        if (length % 2 === 0)\n            length++;\n    }\n    const center = (length - 1) / 2;\n    const data = new Float64Array(length);\n    for (let i = 0; i <= center; i++) {\n        data[i] = lorentzianFct(i - center, fwhm) * height;\n        data[length - 1 - i] = data[i];\n    }\n    return data;\n};\n//# sourceMappingURL=Lorentzian.js.map","import { calculateLorentzianHeight, getLorentzianFactor, lorentzianFwhmToWidth, lorentzianWidthToFWHM, } from '../lorentzian/Lorentzian';\nexport class LorentzianDispersive {\n    constructor(options = {}) {\n        const { fwhm = 500 } = options;\n        this.fwhm = fwhm;\n    }\n    fwhmToWidth(fwhm = this.fwhm) {\n        return lorentzianFwhmToWidth(fwhm);\n    }\n    widthToFWHM(width) {\n        return lorentzianWidthToFWHM(width);\n    }\n    fct(x) {\n        return lorentzianDispersiveFct(x, this.fwhm);\n    }\n    //eslint-disable-next-line\n    getArea(_height) {\n        return 0;\n    }\n    getFactor(area) {\n        return getLorentzianFactor(area);\n    }\n    getData(options = {}) {\n        return getLorentzianDispersiveData(this, options);\n    }\n    calculateHeight(area = 1) {\n        return calculateLorentzianHeight({ fwhm: this.fwhm, area });\n    }\n    getParameters() {\n        return ['fwhm'];\n    }\n}\nexport const lorentzianDispersiveFct = (x, fwhm) => {\n    return (2 * fwhm * x) / (4 * x ** 2 + fwhm ** 2);\n};\nexport const getLorentzianDispersiveData = (shape = {}, options = {}) => {\n    let { fwhm = 500 } = shape;\n    let { length, factor = getLorentzianFactor(), height = calculateLorentzianHeight({ fwhm, area: 1 }), } = options;\n    if (!length) {\n        length = Math.min(Math.ceil(fwhm * factor), Math.pow(2, 25) - 1);\n        if (length % 2 === 0)\n            length++;\n    }\n    const center = (length - 1) / 2;\n    const data = new Float64Array(length);\n    for (let i = 0; i <= center; i++) {\n        data[i] = lorentzianDispersiveFct(i - center, fwhm) * height;\n        data[length - 1 - i] = -data[i];\n    }\n    return data;\n};\n//# sourceMappingURL=LorentzianDispersive.js.map","import { GAUSSIAN_EXP_FACTOR, ROOT_2LN2_MINUS_ONE, ROOT_PI_OVER_LN2, } from '../../../util/constants';\nimport { gaussianFct, getGaussianFactor } from '../gaussian/Gaussian';\nimport { lorentzianFct, getLorentzianFactor } from '../lorentzian/Lorentzian';\nexport class PseudoVoigt {\n    constructor(options = {}) {\n        const { fwhm = 500, mu = 0.5 } = options;\n        this.mu = mu;\n        this.fwhm = fwhm;\n    }\n    fwhmToWidth(fwhm = this.fwhm, mu = this.mu) {\n        return pseudoVoigtFwhmToWidth(fwhm, mu);\n    }\n    widthToFWHM(width, mu = this.mu) {\n        return pseudoVoigtWidthToFWHM(width, mu);\n    }\n    fct(x) {\n        return pseudoVoigtFct(x, this.fwhm, this.mu);\n    }\n    getArea(height = 1) {\n        return getPseudoVoigtArea({ fwhm: this.fwhm, height, mu: this.mu });\n    }\n    getFactor(area) {\n        return getPseudoVoigtFactor(area);\n    }\n    getData(options = {}) {\n        const { length, factor, height = calculatePseudoVoigtHeight({\n            fwhm: this.fwhm,\n            mu: this.mu,\n            area: 1,\n        }), } = options;\n        return getPseudoVoigtData(this, { factor, length, height });\n    }\n    calculateHeight(area = 1) {\n        return calculatePseudoVoigtHeight({ fwhm: this.fwhm, mu: this.mu, area });\n    }\n    getParameters() {\n        return ['fwhm', 'mu'];\n    }\n}\nexport const calculatePseudoVoigtHeight = (options = {}) => {\n    let { fwhm = 1, mu = 0.5, area = 1 } = options;\n    return (2 * area) / (fwhm * (mu * ROOT_PI_OVER_LN2 + (1 - mu) * Math.PI));\n};\nexport const pseudoVoigtFct = (x, fwhm, mu) => {\n    return (1 - mu) * lorentzianFct(x, fwhm) + mu * gaussianFct(x, fwhm);\n};\nexport const pseudoVoigtWidthToFWHM = (width, mu = 0.5) => {\n    return width * (mu * ROOT_2LN2_MINUS_ONE + 1);\n};\nexport const pseudoVoigtFwhmToWidth = (fwhm, mu = 0.5) => {\n    return fwhm / (mu * ROOT_2LN2_MINUS_ONE + 1);\n};\nexport const getPseudoVoigtArea = (options) => {\n    const { fwhm = 500, height = 1, mu = 0.5 } = options;\n    return (fwhm * height * (mu * ROOT_PI_OVER_LN2 + (1 - mu) * Math.PI)) / 2;\n};\nexport const getPseudoVoigtFactor = (area = 0.9999, mu = 0.5) => {\n    return mu < 1 ? getLorentzianFactor(area) : getGaussianFactor(area);\n};\nexport const getPseudoVoigtData = (shape = {}, options = {}) => {\n    let { fwhm = 500, mu = 0.5 } = shape;\n    let { length, factor = getPseudoVoigtFactor(0.999, mu), height = calculatePseudoVoigtHeight({ fwhm, mu, area: 1 }), } = options;\n    if (!height) {\n        height =\n            1 /\n                ((mu / Math.sqrt(-GAUSSIAN_EXP_FACTOR / Math.PI)) * fwhm +\n                    ((1 - mu) * fwhm * Math.PI) / 2);\n    }\n    if (!length) {\n        length = Math.min(Math.ceil(fwhm * factor), Math.pow(2, 25) - 1);\n        if (length % 2 === 0)\n            length++;\n    }\n    const center = (length - 1) / 2;\n    const data = new Float64Array(length);\n    for (let i = 0; i <= center; i++) {\n        data[i] = pseudoVoigtFct(i - center, fwhm, mu) * height;\n        data[length - 1 - i] = data[i];\n    }\n    return data;\n};\n//# sourceMappingURL=PseudoVoigt.js.map","import { ROOT_THREE } from '../../../util/constants';\n/**\n * This shape is a linear combination of rational function (n|n+2), for n = 0 (lorentzian function) and n = 2\n * the parameter that combines those two functions is `gamma` and it is called the kurtosis parameter, it is an\n * implementation of generalized lorentzian shape published by Stanislav Sykora in the SMASH 2010. DOI:10.3247/SL3nmr10.006\n * @link http://www.ebyte.it/stan/Talk_ML_UserMeeting_SMASH_2010_GeneralizedLorentzian.html\n */\nexport class GeneralizedLorentzian {\n    constructor(options = {}) {\n        const { fwhm = 500, gamma = 0.5 } = options;\n        this.fwhm = fwhm;\n        this.gamma = gamma;\n    }\n    fwhmToWidth(fwhm = this.fwhm) {\n        return generalizedLorentzianFwhmToWidth(fwhm);\n    }\n    widthToFWHM(width) {\n        return generalizedLorentzianWidthToFWHM(width);\n    }\n    fct(x) {\n        return generalizedLorentzianFct(x, this.fwhm, this.gamma);\n    }\n    getArea(height = 1) {\n        return getGeneralizedLorentzianArea({\n            fwhm: this.fwhm,\n            height,\n            gamma: this.gamma,\n        });\n    }\n    getFactor(area) {\n        return getGeneralizedLorentzianFactor(area);\n    }\n    getData(options = {}) {\n        return getGeneralizedLorentzianData(this, options);\n    }\n    calculateHeight(area = 1) {\n        const { gamma, fwhm } = this;\n        return calculateGeneralizedLorentzianHeight({ fwhm, area, gamma });\n    }\n    getParameters() {\n        return ['fwhm', 'gamma'];\n    }\n}\nexport const calculateGeneralizedLorentzianHeight = ({ fwhm = 1, gamma = 1, area = 1, }) => {\n    return (area / fwhm / (3.14159 - 0.420894 * gamma)) * 2;\n};\n/**\n * expression of integral generated by Mathematica of the function\n */\nexport const getGeneralizedLorentzianArea = (options) => {\n    const { fwhm = 500, height = 1, gamma = 1 } = options;\n    return (height * fwhm * (3.14159 - 0.420894 * gamma)) / 2;\n};\nexport const generalizedLorentzianFct = (x, fwhm, gamma) => {\n    const u = ((2 * x) / fwhm) ** 2;\n    return (1 - gamma) / (1 + u) + (gamma * (1 + u / 2)) / (1 + u + u ** 2);\n};\nexport const generalizedLorentzianWidthToFWHM = (width) => {\n    return width * ROOT_THREE;\n};\nexport const generalizedLorentzianFwhmToWidth = (fwhm) => {\n    return fwhm / ROOT_THREE;\n};\nexport const getGeneralizedLorentzianFactor = (area = 0.9999) => {\n    if (area >= 1) {\n        throw new Error('area should be (0 - 1)');\n    }\n    const halfResidual = (1 - area) * 0.5;\n    const quantileFunction = (p) => Math.tan(Math.PI * (p - 0.5));\n    return ((quantileFunction(1 - halfResidual) - quantileFunction(halfResidual)) / 2);\n};\nexport const getGeneralizedLorentzianData = (shape = {}, options = {}) => {\n    let { fwhm = 500, gamma = 1 } = shape;\n    let { length, factor = getGeneralizedLorentzianFactor(), height = calculateGeneralizedLorentzianHeight({ fwhm, area: 1, gamma }), } = options;\n    if (!length) {\n        length = Math.min(Math.ceil(fwhm * factor), Math.pow(2, 25) - 1);\n        if (length % 2 === 0)\n            length++;\n    }\n    const center = (length - 1) / 2;\n    const data = new Float64Array(length);\n    for (let i = 0; i <= center; i++) {\n        data[i] = generalizedLorentzianFct(i - center, fwhm, gamma) * height;\n        data[length - 1 - i] = data[i];\n    }\n    return data;\n};\n//# sourceMappingURL=GeneralizedLorentzian.js.map","import { GAUSSIAN_EXP_FACTOR } from '../../../util/constants';\nimport { getGaussianFactor, gaussianFwhmToWidth, gaussianWidthToFWHM, } from '../../1d/gaussian/Gaussian';\nexport class Gaussian2D {\n    constructor(options = {}) {\n        let { fwhm = 20, sd } = options;\n        fwhm = ensureFWHM2D(fwhm, sd);\n        this.fwhmX = fwhm.x;\n        this.fwhmY = fwhm.y;\n    }\n    fct(x, y) {\n        return gaussian2DFct(x, y, this.fwhmX, this.fwhmY);\n    }\n    getData(options = {}) {\n        return getGaussian2DData({\n            fwhm: { x: this.fwhmX, y: this.fwhmY },\n        }, options);\n    }\n    getFactor(volume = 1) {\n        return getGaussianFactor(volume);\n    }\n    getVolume(height = calculateGaussian2DHeight({\n        fwhm: { x: this.fwhmX, y: this.fwhmY },\n        volume: 1,\n    })) {\n        return getGaussian2DVolume({\n            fwhm: { x: this.fwhmX, y: this.fwhmY },\n            height,\n        });\n    }\n    widthToFWHM(width) {\n        return gaussianWidthToFWHM(width);\n    }\n    fwhmToWidth(fwhm) {\n        return gaussianFwhmToWidth(fwhm);\n    }\n    calculateHeight(volume = 1) {\n        return calculateGaussian2DHeight({\n            volume,\n            fwhm: { x: this.fwhmX, y: this.fwhmY },\n        });\n    }\n    set fwhm(fwhm) {\n        fwhm = ensureXYNumber(fwhm);\n        this.fwhmX = fwhm.x;\n        this.fwhmY = fwhm.y;\n    }\n}\nexport const gaussian2DFct = (x, y, xFWHM, yFWHM) => {\n    return Math.exp(GAUSSIAN_EXP_FACTOR * (Math.pow(x / xFWHM, 2) + Math.pow(y / yFWHM, 2)));\n};\nexport const getGaussian2DData = (shape, options = {}) => {\n    let { fwhm = 50, sd } = shape;\n    fwhm = ensureFWHM2D(fwhm, sd);\n    let { factor = getGaussianFactor(), length = { x: 0, y: 0 }, height = calculateGaussian2DHeight({ fwhm, volume: 1 }), } = options;\n    factor = ensureXYNumber(factor);\n    length = ensureXYNumber(length);\n    for (const axis of ['x', 'y']) {\n        if (!length[axis]) {\n            length[axis] = Math.min(Math.ceil(fwhm[axis] * factor[axis]), Math.pow(2, 25) - 1);\n            if (length[axis] % 2 === 0)\n                length[axis]++;\n        }\n    }\n    const xCenter = (length.x - 1) / 2;\n    const yCenter = (length.y - 1) / 2;\n    const data = new Array(length.x);\n    for (let i = 0; i < length.x; i++) {\n        data[i] = new Float64Array(length.y);\n    }\n    for (let i = 0; i < length.x; i++) {\n        for (let j = 0; j < length.y; j++) {\n            data[i][j] =\n                gaussian2DFct(i - xCenter, j - yCenter, fwhm.x, fwhm.y) * height;\n        }\n    }\n    return data;\n};\nexport const calculateGaussian2DHeight = (options = {}) => {\n    let { volume = 1, fwhm = 50, sd } = options;\n    fwhm = ensureFWHM2D(fwhm, sd);\n    return (volume * Math.LN2 * 4) / (Math.PI * fwhm.y * fwhm.x);\n};\nexport const getGaussian2DVolume = (options = {}) => {\n    let { fwhm = 50, height = 1, sd } = options;\n    fwhm = ensureFWHM2D(fwhm, sd);\n    return (height * Math.PI * fwhm.y * fwhm.x) / Math.LN2 / 4;\n};\nfunction ensureXYNumber(input) {\n    return typeof input !== 'object' ? { x: input, y: input } : { ...input };\n}\nfunction ensureFWHM2D(fwhm, sd) {\n    if (sd !== undefined) {\n        let sdObject = ensureXYNumber(sd);\n        return {\n            x: gaussianWidthToFWHM(2 * sdObject.x),\n            y: gaussianWidthToFWHM(2 * sdObject.y),\n        };\n    }\n    else if (fwhm !== undefined) {\n        return ensureXYNumber(fwhm);\n    }\n    else {\n        throw new Error('ensureFWHM2D must have either fwhm or sd defined');\n    }\n}\n//# sourceMappingURL=Gaussian2D.js.map","import { Gaussian } from './gaussian/Gaussian';\nimport { GeneralizedLorentzian } from './generalizedLorentzian/GeneralizedLorentzian';\nimport { Lorentzian } from './lorentzian/Lorentzian';\nimport { LorentzianDispersive } from './lorentzianDispersive/LorentzianDispersive';\nimport { PseudoVoigt } from './pseudoVoigt/PseudoVoigt';\n/**\n * Generate a instance of a specific kind of shape.\n */\nexport function getShape1D(shape) {\n    const { kind } = shape;\n    switch (kind) {\n        case 'gaussian':\n            return new Gaussian(shape);\n        case 'lorentzian':\n            return new Lorentzian(shape);\n        case 'pseudoVoigt':\n            return new PseudoVoigt(shape);\n        case 'lorentzianDispersive':\n            return new LorentzianDispersive(shape);\n        case 'generalizedLorentzian':\n            return new GeneralizedLorentzian(shape);\n        default: {\n            throw Error(`Unknown distribution ${kind}`);\n        }\n    }\n}\n//# sourceMappingURL=getShape1D.js.map","import { Gaussian2D } from './gaussian2D/Gaussian2D';\n/**\n * Generate a instance of a specific kind of shape.\n */\nexport function getShape2D(shape) {\n    const { kind } = shape;\n    switch (kind) {\n        case 'gaussian':\n            return new Gaussian2D(shape);\n        default: {\n            const unHandled = kind;\n            // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n            throw Error(`Unknown distribution ${unHandled}`);\n        }\n    }\n}\n//# sourceMappingURL=getShape2D.js.map","import { getShape1D } from 'ml-peak-shape-generator';\nexport class BaseSpectrumGenerator {\n    from;\n    to;\n    nbPoints;\n    interval;\n    peakWidthFct;\n    shape;\n    constructor(options = {}) {\n        const { from = 0, to = 1000, nbPoints = 10001, peakWidthFct, shape = { kind: 'gaussian', fwhm: 5 }, } = options;\n        assertNumber(from, 'from');\n        assertNumber(to, 'to');\n        assertInteger(nbPoints, 'nbPoints');\n        if (to <= from) {\n            throw new RangeError('to option must be larger than from');\n        }\n        if (peakWidthFct && typeof peakWidthFct !== 'function') {\n            throw new TypeError('peakWidthFct option must be a function');\n        }\n        this.from = from;\n        this.to = to;\n        this.nbPoints = nbPoints;\n        this.interval = (to - from) / (nbPoints - 1);\n        this.peakWidthFct = peakWidthFct;\n        this.shape = getShape1D(shape);\n    }\n    /**\n     * Resolves a peak to its canonical parameters, cloning and configuring\n     * separate shape instances for the left and right halves.\n     */\n    resolvePeak(peak, options) {\n        let x0;\n        let intensity;\n        let peakFWHM;\n        let peakWidth;\n        let peakShapeOptions;\n        if (Array.isArray(peak)) {\n            [x0, intensity, peakFWHM, peakShapeOptions] = peak;\n        }\n        else {\n            x0 = peak.x;\n            intensity = peak.y;\n            peakWidth = peak.width;\n            peakShapeOptions = peak.shape;\n        }\n        let { shape: shapeOptions } = options;\n        if (peakShapeOptions) {\n            shapeOptions = shapeOptions\n                ? { ...shapeOptions, ...peakShapeOptions }\n                : peakShapeOptions;\n        }\n        const shape = shapeOptions\n            ? getShape1D(shapeOptions)\n            : cloneShape(this.shape);\n        const { width } = options;\n        let { widthLeft, widthRight } = options;\n        const fwhm = peakFWHM !== undefined\n            ? peakFWHM\n            : peakWidth\n                ? shape.widthToFWHM(peakWidth)\n                : this.peakWidthFct\n                    ? this.peakWidthFct(x0)\n                    : width !== undefined\n                        ? width\n                        : shape.fwhm;\n        if (!widthLeft)\n            widthLeft = fwhm;\n        if (!widthRight)\n            widthRight = fwhm;\n        if (!widthLeft || !widthRight) {\n            throw new Error('Width left or right is undefined or zero');\n        }\n        const factor = options.factor === undefined ? shape.getFactor() : options.factor;\n        const shapeLeft = cloneShape(shape);\n        shapeLeft.fwhm = widthLeft;\n        const shapeRight = cloneShape(shape);\n        shapeRight.fwhm = widthRight;\n        return {\n            x0,\n            intensity,\n            shapeLeft,\n            shapeRight,\n            widthLeft,\n            widthRight,\n            factor,\n        };\n    }\n}\nfunction cloneShape(shape) {\n    return Object.assign(Object.create(Object.getPrototypeOf(shape)), shape);\n}\nfunction assertInteger(value, name) {\n    if (!Number.isInteger(value)) {\n        throw new TypeError(`${name} option must be an integer`);\n    }\n}\nfunction assertNumber(value, name) {\n    if (!Number.isFinite(value)) {\n        throw new TypeError(`${name} option must be a number`);\n    }\n}\n//# sourceMappingURL=BaseSpectrumGenerator.js.map","import { BaseSpectrumGenerator } from \"./BaseSpectrumGenerator.js\";\nimport addBaseline from \"./util/addBaseline.js\";\nimport addNoise from \"./util/addNoise.js\";\nexport { BaseSpectrumGenerator } from \"./BaseSpectrumGenerator.js\";\nexport class SpectrumGenerator extends BaseSpectrumGenerator {\n    maxPeakHeight;\n    data;\n    constructor(options = {}) {\n        super(options);\n        this.maxPeakHeight = Number.MIN_SAFE_INTEGER;\n        this.data = {\n            x: new Float64Array(this.nbPoints),\n            y: new Float64Array(this.nbPoints),\n        };\n        this.reset();\n    }\n    /**\n     * Generates a spectrum from a list of peaks and returns it.\n     * @param peaks - List of peaks to add.\n     * @param options - Options for spectrum generation.\n     * @returns The generated spectrum data.\n     */\n    generateSpectrum(peaks, options = {}) {\n        const { noise, baseline, threshold, peakOptions } = options;\n        this.addPeaks(peaks, peakOptions);\n        if (baseline)\n            this.addBaseline(baseline);\n        if (noise)\n            this.addNoise(noise);\n        return this.getSpectrum({ threshold });\n    }\n    /**\n     * Add a series of peaks to the spectrum.\n     * @param peaks - Peaks to add.\n     * @param options - Options for adding peaks.\n     * @returns The generator instance.\n     */\n    addPeaks(peaks, options) {\n        if (!Array.isArray(peaks) &&\n            (typeof peaks !== 'object' ||\n                peaks.x === undefined ||\n                peaks.y === undefined ||\n                !Array.isArray(peaks.x) ||\n                !Array.isArray(peaks.y) ||\n                peaks.x.length !== peaks.y.length)) {\n            throw new TypeError('peaks must be an array or an object containing x[] and y[]');\n        }\n        if (Array.isArray(peaks)) {\n            for (const peak of peaks) {\n                this.addPeak(peak, options);\n            }\n        }\n        else {\n            for (let i = 0; i < peaks.x.length; i++) {\n                this.addPeak([peaks.x[i], peaks.y[i]], options);\n            }\n        }\n        return this;\n    }\n    /**\n     * Add a single peak to the spectrum.\n     * A peak may be either defined as [x,y,fwhm,...] or as {x, y, shape}\n     * @param peak - The peak to add, defined as array or object.\n     * @param options - Options for adding the peak.\n     * @returns The generator instance.\n     */\n    addPeak(peak, options = {}) {\n        if (Array.isArray(peak) && peak.length < 2) {\n            throw new Error('peak must be an array with two (or three) values or an object with {x,y,width?}');\n        }\n        if (!Array.isArray(peak) &&\n            (peak.x === undefined || peak.y === undefined)) {\n            throw new Error('peak must be an array with two (or three) values or an object with {x,y,width?}');\n        }\n        const { x0, intensity, shapeLeft, shapeRight, widthLeft, widthRight, factor, } = this.resolvePeak(peak, options);\n        if (intensity > this.maxPeakHeight)\n            this.maxPeakHeight = intensity;\n        const firstValue = x0 - (widthLeft / 2) * factor;\n        const lastValue = x0 + (widthRight / 2) * factor;\n        const firstPoint = Math.max(0, Math.floor((firstValue - this.from) / this.interval));\n        const lastPoint = Math.min(this.nbPoints - 1, Math.ceil((lastValue - this.from) / this.interval));\n        const middlePoint = Math.round((x0 - this.from) / this.interval);\n        // PEAK SHAPE MAY BE ASYMMETRIC (widthLeft and widthRight) !\n        // we calculate the left part of the shape\n        for (let index = firstPoint; index < Math.max(middlePoint, 0); index++) {\n            this.data.y[index] += intensity * shapeLeft.fct(this.data.x[index] - x0);\n        }\n        // we calculate the right part of the gaussian\n        for (let index = Math.min(middlePoint, lastPoint); index <= lastPoint; index++) {\n            this.data.y[index] += intensity * shapeRight.fct(this.data.x[index] - x0);\n        }\n        return this;\n    }\n    /**\n     * Add a baseline to the spectrum.\n     * @param baselineFct - Mathematical function producing the baseline you want.\n     * @returns The generator instance.\n     */\n    addBaseline(baselineFct) {\n        addBaseline(this.data, baselineFct);\n        return this;\n    }\n    /**\n     * Add noise to the spectrum.\n     * @param options - Configuration for noise generation.\n     * @returns The generator instance.\n     */\n    addNoise(options) {\n        addNoise(this.data, options);\n        return this;\n    }\n    /**\n     * Get the generated spectrum.\n     * @param options - Options for getting the spectrum.\n     * @returns The generated spectrum data.\n     */\n    getSpectrum(options = {}) {\n        if (typeof options === 'boolean') {\n            options = { copy: options };\n        }\n        const { copy = true, threshold = 0 } = options;\n        if (threshold) {\n            const minPeakHeight = this.maxPeakHeight * threshold;\n            const x = [];\n            const y = [];\n            for (let i = 0; i < this.data.x.length; i++) {\n                if (this.data.y[i] >= minPeakHeight) {\n                    x.push(this.data.x[i]);\n                    y.push(this.data.y[i]);\n                }\n            }\n            return { x: Float64Array.from(x), y: Float64Array.from(y) };\n        }\n        if (copy) {\n            return {\n                x: this.data.x.slice(),\n                y: this.data.y.slice(),\n            };\n        }\n        else {\n            return this.data;\n        }\n    }\n    /**\n     * Resets the generator with an empty spectrum.\n     * @returns The generator instance.\n     */\n    reset() {\n        if (this.nbPoints === 1) {\n            this.data.x[0] = (this.from + this.to) / 2;\n        }\n        else {\n            for (let i = 0; i < this.nbPoints; i++) {\n                this.data.x[i] = this.from + i * this.interval;\n            }\n        }\n        return this;\n    }\n}\n//# sourceMappingURL=SpectrumGenerator.js.map","/**\n * Adds a baseline to the spectrum data.\n * @param data - The spectrum data to modify.\n * @param baselineFct - Function that generates the baseline value for a given x.\n * @returns The modified spectrum data.\n */\nexport default function addBaseline(data, baselineFct) {\n    if (!baselineFct)\n        return data;\n    const xs = data.x;\n    const ys = data.y;\n    for (let i = 0; i < xs.length; i++) {\n        ys[i] += baselineFct(xs[i]);\n    }\n    return data;\n}\n//# sourceMappingURL=addBaseline.js.map","import { xMaxValue, xAdd, createRandomArray } from 'ml-spectra-processing';\n/**\n * Adds noise to the spectrum data.\n * @param data - The spectrum data to modify.\n * @param options - Configuration for noise generation.\n * @returns The modified spectrum data.\n */\nexport default function addNoise(data, options = {}) {\n    const { seed = 0, distribution = 'normal', percent = 1 } = options;\n    const range = (xMaxValue(data.y) * percent) / 100;\n    const noise = createRandomArray({\n        distribution,\n        seed,\n        mean: 0,\n        standardDeviation: range,\n        range,\n        length: data.x.length,\n    });\n    data.y = xAdd(data.y, noise);\n    return data;\n}\n//# sourceMappingURL=addNoise.js.map","import { getShape2D } from 'ml-peak-shape-generator';\nimport { matrixCreateEmpty, matrixMinMaxZ } from 'ml-spectra-processing';\nconst axis2D = ['x', 'y'];\nconst peakCoordinates = ['x', 'y', 'z'];\n/**\n * Converts a width value to full width at half maximum (FWHM).\n * @param shape - The 2D shape to use for conversion.\n * @param width - The width value to convert.\n * @returns The converted FWHM value as an XYNumber object.\n */\nconst convertWidthToFWHM = (shape, width) => {\n    const widthData = ensureXYNumber(width);\n    for (const key of axis2D) {\n        widthData[key] = shape.widthToFWHM(widthData[key]);\n    }\n    return widthData;\n};\nexport class Spectrum2DGenerator {\n    from;\n    to;\n    nbPoints;\n    interval;\n    data;\n    maxPeakHeight;\n    shape;\n    peakWidthFct;\n    constructor(options = {}) {\n        const { peakWidthFct = () => 5, shape = {\n            kind: 'gaussian',\n        }, } = options;\n        let { from = 0, to = 100, nbPoints = 1001 } = options;\n        from = ensureXYNumber(from);\n        to = ensureXYNumber(to);\n        nbPoints = ensureXYNumber(nbPoints);\n        for (const axis of axis2D) {\n            assertNumber(from[axis], `from-${axis}`);\n            assertNumber(to[axis], `to-${axis}`);\n            assertInteger(nbPoints[axis], `nbPoints-${axis}`);\n        }\n        this.from = from;\n        this.to = to;\n        this.nbPoints = nbPoints;\n        this.interval = calculeIntervals(from, to, nbPoints);\n        this.peakWidthFct = peakWidthFct;\n        this.maxPeakHeight = Number.MIN_SAFE_INTEGER;\n        const shapeGenerator = getShape2D(shape);\n        this.shape = shapeGenerator;\n        this.data = {\n            x: new Float64Array(nbPoints.x),\n            y: new Float64Array(nbPoints.y),\n            z: matrixCreateEmpty({\n                nbRows: this.nbPoints.y,\n                nbColumns: this.nbPoints.x,\n            }),\n        };\n        for (const axis of axis2D) {\n            if (this.to[axis] <= this.from[axis]) {\n                throw new RangeError('to option must be larger than from');\n            }\n        }\n        if (typeof this.peakWidthFct !== 'function') {\n            throw new TypeError('peakWidthFct option must be a function');\n        }\n        this.reset();\n    }\n    /**\n     * Adds multiple peaks to the 2D spectrum.\n     * @param peaks - Array of peaks or peak series to add.\n     * @param options - Options for adding peaks.\n     * @returns The generator instance.\n     */\n    addPeaks(peaks, options) {\n        if (!Array.isArray(peaks) &&\n            (typeof peaks !== 'object' ||\n                peaks.x === undefined ||\n                peaks.y === undefined ||\n                !Array.isArray(peaks.x) ||\n                !Array.isArray(peaks.y) ||\n                peaks.x.length !== peaks.y.length)) {\n            throw new TypeError('peaks must be an array or an object containing x[] and y[]');\n        }\n        if (Array.isArray(peaks)) {\n            for (const peak of peaks) {\n                this.addPeak(peak, options);\n            }\n        }\n        else {\n            if (!Array.isArray(peaks.x) ||\n                !Array.isArray(peaks.y) ||\n                !Array.isArray(peaks.z)) {\n                throw new TypeError('x, y, z must all be arrays');\n            }\n            const nbPeaks = peaks.x.length;\n            if (peaks.y.length !== nbPeaks || peaks.z.length !== nbPeaks) {\n                throw new Error('x, y, z should have the same length');\n            }\n            for (let i = 0; i < nbPeaks; i++) {\n                this.addPeak([peaks.x[i], peaks.y[i], peaks.z[i]], options);\n            }\n        }\n        return this;\n    }\n    /**\n     * Adds a single peak to the 2D spectrum.\n     * @param peak - Peak to add, can be array or object format.\n     * @param options - Options for adding the peak.\n     * @returns The generator instance.\n     */\n    addPeak(peak, options = {}) {\n        if (Array.isArray(peak) && peak.length < 3) {\n            throw new Error('peak must be an array with three (or four) values or an object with {x,y,z,width?}');\n        }\n        if (!Array.isArray(peak) &&\n            peakCoordinates.some((e) => peak[e] === undefined)) {\n            throw new Error('peak must be an array with three (or four) values or an object with {x,y,z,width?}');\n        }\n        let xPosition;\n        let yPosition;\n        let intensity;\n        let peakFWHM;\n        let peakWidth;\n        let peakShapeOptions;\n        if (Array.isArray(peak)) {\n            [xPosition, yPosition, intensity, peakFWHM, peakShapeOptions] = peak;\n        }\n        else {\n            xPosition = peak.x;\n            yPosition = peak.y;\n            intensity = peak.z;\n            peakFWHM = peak.fwhm;\n            peakWidth = peak.width;\n            peakShapeOptions = peak.shape;\n        }\n        const position = { x: xPosition, y: yPosition };\n        if (intensity > this.maxPeakHeight)\n            this.maxPeakHeight = intensity;\n        const { width } = options;\n        let { shape: shapeOptions } = options;\n        if (peakShapeOptions) {\n            shapeOptions = shapeOptions\n                ? { ...shapeOptions, ...peakShapeOptions }\n                : peakShapeOptions;\n        }\n        const shape = shapeOptions\n            ? getShape2D(shapeOptions)\n            : Object.assign(Object.create(Object.getPrototypeOf(this.shape)), structuredClone(this.shape));\n        let { fwhm = peakFWHM !== undefined\n            ? peakFWHM\n            : peakWidth\n                ? convertWidthToFWHM(shape, peakWidth)\n                : width\n                    ? convertWidthToFWHM(shape, width)\n                    : this.peakWidthFct(xPosition, yPosition), } = options;\n        fwhm = ensureXYNumber(fwhm);\n        let factor = options.factor === undefined ? shape.getFactor() : options.factor;\n        factor = ensureXYNumber(factor);\n        const firstPoint = { x: 0, y: 0 };\n        const lastPoint = { x: 0, y: 0 };\n        for (const axis of axis2D) {\n            const first = position[axis] - (fwhm[axis] / 2) * factor[axis];\n            const last = position[axis] + (fwhm[axis] / 2) * factor[axis];\n            firstPoint[axis] = Math.max(0, Math.floor((first - this.from[axis]) / this.interval[axis]));\n            lastPoint[axis] = Math.min(this.nbPoints[axis], Math.ceil((last - this.from[axis]) / this.interval[axis]));\n        }\n        shape.fwhm = fwhm;\n        for (let xIndex = firstPoint.x; xIndex < lastPoint.x; xIndex++) {\n            for (let yIndex = firstPoint.y; yIndex < lastPoint.y; yIndex++) {\n                const value = intensity *\n                    shape.fct(this.data.x[xIndex] - position.x, this.data.y[yIndex] - position.y);\n                if (Math.abs(value) > 1e-6) {\n                    this.data.z[yIndex][xIndex] += value;\n                }\n            }\n        }\n        return this;\n    }\n    /**\n     * Gets the generated 2D spectrum data.\n     * @param options - Options for getting the spectrum.\n     * @returns The spectrum data object.\n     */\n    getSpectrum(options = {}) {\n        if (typeof options === 'boolean') {\n            options = { copy: options };\n        }\n        const { copy = true } = options;\n        const minMaxZ = matrixMinMaxZ(this.data.z);\n        return {\n            minX: this.from.x,\n            maxX: this.to.x,\n            maxY: this.to.y,\n            minY: this.from.y,\n            minZ: minMaxZ.min,\n            maxZ: minMaxZ.max,\n            z: copy ? this.data.z.slice() : this.data.z,\n        };\n    }\n    /**\n     * Resets the generator to initial state.\n     * @returns The generator instance.\n     */\n    reset() {\n        const spectrum = this.data;\n        for (const axis of axis2D) {\n            for (let i = 0; i < this.nbPoints[axis]; i++) {\n                spectrum[axis][i] = this.from[axis] + i * this.interval[axis];\n            }\n        }\n        for (const row of spectrum.z) {\n            for (let j = 0; j < row.length; j++) {\n                row[j] = 0;\n            }\n        }\n        return this;\n    }\n}\n/**\n * Generates a 2D spectrum with the given peaks.\n * @param peaks - Peaks to include in the spectrum.\n * @param options - Options for spectrum generation.\n * @returns The generated spectrum data.\n */\nexport function generateSpectrum2D(peaks, options = {}) {\n    const { generator: generatorOptions, peaks: addPeaksOptions } = options;\n    const generator = new Spectrum2DGenerator(generatorOptions);\n    generator.addPeaks(peaks, addPeaksOptions);\n    return generator.getSpectrum();\n}\n/**\n * Ensures the input is an XYNumber object.\n * @param input - Number or XYNumber to process.\n * @returns An XYNumber object.\n */\nfunction ensureXYNumber(input) {\n    return typeof input !== 'object' ? { x: input, y: input } : { ...input };\n}\n/**\n * Calculates the intervals between points for both x and y axes.\n * @param from - Starting point coordinates.\n * @param to - Ending point coordinates.\n * @param nbPoints - Number of points in each dimension.\n * @returns The calculated intervals as an XYNumber object.\n */\nfunction calculeIntervals(from, to, nbPoints) {\n    return {\n        x: (to.x - from.x) / (nbPoints.x - 1),\n        y: (to.y - from.y) / (nbPoints.y - 1),\n    };\n}\n/**\n * Validates if a value is an integer.\n * @param value - Number to validate.\n * @param name - Name of the parameter for error message.\n * @throws {TypeError} If value is not an integer.\n */\nfunction assertInteger(value, name) {\n    if (!Number.isInteger(value)) {\n        throw new TypeError(`${name} option must be an integer`);\n    }\n}\n/**\n * Validates if a value is a finite number.\n * @param value - Number to validate.\n * @param name - Name of the parameter for error message.\n * @throws {TypeError} If value is not a finite number.\n */\nfunction assertNumber(value, name) {\n    if (!Number.isFinite(value)) {\n        throw new TypeError(`${name} option must be a number`);\n    }\n}\n//# sourceMappingURL=Spectrum2DGenerator.js.map","import { BaseSpectrumGenerator } from \"./BaseSpectrumGenerator.js\";\nexport class SparseSpectrumGenerator extends BaseSpectrumGenerator {\n    constructor(options = {}) {\n        super(options);\n    }\n    /**\n     * Generates a sparse spectrum containing only x values where at least one\n     * peak contributes above the threshold. No dense array is allocated:\n     * intervals are computed per peak first, then y is evaluated only for the\n     * merged set of required x values.\n     * @param peaks - List of peaks to include.\n     * @param options - Options for sparse spectrum generation.\n     * @returns Sparse spectrum data with x and y arrays covering only peak regions.\n     */\n    generateSparseSpectrum(peaks, options = {}) {\n        if ('noise' in options) {\n            throw new Error('noise is not supported for sparse spectrum generation');\n        }\n        const { baseline, peakOptions = {}, threshold = 1e-7 } = options;\n        const peakArray = Array.isArray(peaks)\n            ? peaks\n            : Array.from(peaks.x, (x, i) => peaks.fwhm !== undefined\n                ? [x, peaks.y[i], peaks.fwhm[i]]\n                : [x, peaks.y[i]]);\n        const resolvedPeaks = peakArray\n            .map((peak) => {\n            const { x0, intensity, shapeLeft, shapeRight } = this.resolvePeak(peak, peakOptions);\n            return {\n                x0,\n                intensity,\n                shapeLeft,\n                shapeRight,\n                xFrom: x0 - computeHalfWidth(shapeLeft, threshold),\n                xTo: x0 + computeHalfWidth(shapeRight, threshold),\n            };\n        })\n            .filter((p) => p.xFrom < this.to && p.xTo > this.from);\n        if (resolvedPeaks.length === 0) {\n            return {\n                x: Float64Array.from([this.from, this.to]),\n                y: baseline\n                    ? Float64Array.from([baseline(this.from), baseline(this.to)])\n                    : new Float64Array(2),\n            };\n        }\n        for (const peak of resolvedPeaks) {\n            peak.xFrom = Math.max(this.from, peak.xFrom);\n            peak.xTo = Math.min(this.to, peak.xTo);\n        }\n        resolvedPeaks.sort((a, b) => a.xFrom - b.xFrom);\n        const mergedIntervals = [];\n        for (const peak of resolvedPeaks) {\n            const last = mergedIntervals.at(-1);\n            if (last !== undefined && peak.xFrom <= last.xTo) {\n                last.xTo = Math.max(last.xTo, peak.xTo);\n                last.peaks.push(peak);\n            }\n            else {\n                mergedIntervals.push({\n                    xFrom: peak.xFrom,\n                    xTo: peak.xTo,\n                    peaks: [peak],\n                });\n            }\n        }\n        const xResult = [this.from];\n        const yResult = [0];\n        // tracks the last grid index written to avoid duplicate guard points when\n        // two intervals are only one step apart\n        let lastWrittenIndex = 0;\n        for (const interval of mergedIntervals) {\n            const firstIndex = Math.max(0, Math.floor((interval.xFrom - this.from) / this.interval));\n            const lastIndex = Math.min(this.nbPoints - 1, Math.ceil((interval.xTo - this.from) / this.interval));\n            const guardBefore = firstIndex - 1;\n            if (guardBefore >= 0 && guardBefore > lastWrittenIndex) {\n                xResult.push(this.from + guardBefore * this.interval);\n                yResult.push(0);\n                lastWrittenIndex = guardBefore;\n            }\n            for (let i = firstIndex; i <= lastIndex; i++) {\n                const x = this.from + i * this.interval;\n                let y = 0;\n                for (const peak of interval.peaks) {\n                    const shape = x < peak.x0 ? peak.shapeLeft : peak.shapeRight;\n                    y += peak.intensity * shape.fct(x - peak.x0);\n                }\n                xResult.push(x);\n                yResult.push(y);\n                lastWrittenIndex = i;\n            }\n            const guardAfter = lastIndex + 1;\n            if (guardAfter < this.nbPoints) {\n                xResult.push(this.from + guardAfter * this.interval);\n                yResult.push(0);\n                lastWrittenIndex = guardAfter;\n            }\n        }\n        if (xResult[0] !== this.from) {\n            xResult.unshift(this.from);\n            yResult.unshift(0);\n        }\n        if (xResult[xResult.length - 1] !== this.to) {\n            xResult.push(this.to);\n            yResult.push(0);\n        }\n        if (baseline) {\n            for (let i = 0; i < yResult.length; i++) {\n                yResult[i] += baseline(xResult[i]);\n            }\n        }\n        return {\n            x: Float64Array.from(xResult),\n            y: Float64Array.from(yResult),\n        };\n    }\n}\n/**\n * Finds the half-width d at which shape.fct(d) equals the given threshold via\n * binary search. Works for any monotonically decreasing shape function.\n */\nfunction computeHalfWidth(shape, threshold) {\n    if (threshold <= 0)\n        return Infinity;\n    if (shape.fct(0) <= threshold)\n        return 0;\n    let high = shape.fwhm;\n    while (shape.fct(high) > threshold) {\n        high *= 2;\n    }\n    let low = 0;\n    for (let i = 0; i < 64; i++) {\n        const mid = (low + high) / 2;\n        if (shape.fct(mid) > threshold) {\n            low = mid;\n        }\n        else {\n            high = mid;\n        }\n    }\n    return (low + high) / 2;\n}\n//# sourceMappingURL=SparseSpectrumGenerator.js.map","import { SparseSpectrumGenerator } from \"./SparseSpectrumGenerator.js\";\n/**\n * Generates a sparse spectrum containing only x values where at least one peak\n * contributes above the threshold. Unlike `generateSpectrum`, no dense array\n * is allocated: intervals are computed per peak first, then y is evaluated only\n * for the merged set of required x values.\n * @param peaks - List of peaks to include.\n * @param options - Configuration for sparse spectrum generation.\n * @returns Sparse spectrum data with x and y arrays covering only peak regions.\n */\nexport function generateSparseSpectrum(peaks, options = {}) {\n    const { generator, ...rest } = options;\n    return new SparseSpectrumGenerator(generator).generateSparseSpectrum(peaks, rest);\n}\n//# sourceMappingURL=generateSparseSpectrum.js.map","import { SpectrumGenerator } from \"./SpectrumGenerator.js\";\n/**\n * Generates a spectrum and returns it.\n * @param peaks - List of peaks to put in the spectrum.\n * @param options - Configuration for spectrum generation.\n * @returns The generated spectrum data.\n */\nexport function generateSpectrum(peaks, options = {}) {\n    const { generator, ...rest } = options;\n    return new SpectrumGenerator(generator).generateSpectrum(peaks, rest);\n}\n//# sourceMappingURL=generateSpectrum.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.closestPointX = closestPointX;\nfunction closestPointX(array, target) {\n    let low = 0;\n    let high = array.length - 1;\n    let middle = 0;\n    while (high - low > 1) {\n        middle = low + ((high - low) >> 1);\n        if (array[middle].x < target) {\n            low = middle;\n        }\n        else if (array[middle].x > target) {\n            high = middle;\n        }\n        else {\n            return array[middle];\n        }\n    }\n    if (low < array.length - 1) {\n        if (Math.abs(target - array[low].x) < Math.abs(array[low + 1].x - target)) {\n            return array[low];\n        }\n        else {\n            return array[low + 1];\n        }\n    }\n    else {\n        return array[low];\n    }\n}\n//# sourceMappingURL=closestPointX.js.map","\"use strict\";\n/**\n * Join x values if there are similar\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.joinX = joinX;\nfunction joinX(self, threshold = Number.EPSILON) {\n    // when we join we will use the center of mass\n    if (self.array.length === 0)\n        return [];\n    self.sortX();\n    let current = self.array[0];\n    let result = [current];\n    for (let i = 1; i < self.array.length; i++) {\n        const item = self.array[i];\n        if (item.x - current.x <= threshold) {\n            // weighted sum\n            current.x =\n                (item.y / (current.y + item.y)) * (item.x - current.x) + current.x;\n            current.y += item.y;\n        }\n        else {\n            current = { ...item };\n            result.push(current);\n        }\n    }\n    self.array = result;\n    self.ySorted = false;\n    return self;\n}\n//# sourceMappingURL=joinX.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiply = multiply;\nfunction multiply(a, b, options = {}) {\n    const { minY = 1e-8, maxLines = 5000, deltaX = 1e-2 } = options;\n    const result = new a.constructor();\n    a.sortY();\n    b.sortY();\n    for (let entryA of a.array) {\n        for (let entryB of b.array) {\n            let y = entryA.y * entryB.y;\n            if (y > minY) {\n                const composition = calculateComposition(entryA, entryB);\n                if (composition) {\n                    result.push({ x: entryA.x + entryB.x, y, composition });\n                }\n                else {\n                    result.push({ x: entryA.x + entryB.x, y });\n                }\n            }\n            if (result.length > maxLines * 2) {\n                result.joinX(deltaX);\n                result.topY(maxLines);\n            }\n        }\n    }\n    result.joinX(deltaX);\n    result.topY(maxLines);\n    a.move(result);\n    return a;\n}\nfunction calculateComposition(entryA, entryB) {\n    if (!entryA.composition || !entryB.composition)\n        return;\n    let toReturn = {};\n    const keys = [\n        ...new Set(Object.keys(entryA.composition).concat(Object.keys(entryB.composition))),\n    ];\n    for (let key of keys) {\n        toReturn[key] =\n            (entryA.composition[key] || 0) + (entryB.composition[key] || 0);\n    }\n    return toReturn;\n}\n//# sourceMappingURL=multiply.js.map","\"use strict\";\n// https://en.wikipedia.org/wiki/Exponentiation_by_squaring\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.power = power;\nfunction power(array, p, options = {}) {\n    if (p <= 0)\n        throw new Error('power must be larger than 0');\n    if (p === 1)\n        return array;\n    if (p === 2) {\n        return array.square();\n    }\n    p--;\n    let base = array.copy(); // linear time\n    while (p !== 0) {\n        if ((p & 1) !== 0) {\n            array.multiply(base, options); // executed <= log2(p) times\n        }\n        p >>= 1;\n        if (p !== 0)\n            base.square(options); // executed <= log2(p) times\n    }\n    return array;\n}\n//# sourceMappingURL=power.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Distribution = void 0;\nconst closestPointX_js_1 = require(\"./utils/closestPointX.js\");\nconst joinX_js_1 = require(\"./utils/joinX.js\");\nconst multiply_js_1 = require(\"./utils/multiply.js\");\nconst power_js_1 = require(\"./utils/power.js\");\n/**\n * Internal class to deal with isotopic distribution calculations\n */\nclass Distribution {\n    constructor(array = []) {\n        this.array = array;\n        this.cache = getEmptyCache();\n    }\n    emptyCache() {\n        if (this.cache.isEmpty)\n            return;\n        this.cache = getEmptyCache();\n    }\n    get length() {\n        return this.array.length;\n    }\n    get xs() {\n        return this.array.map((p) => p.x);\n    }\n    get ys() {\n        return this.array.map((p) => p.y);\n    }\n    get sumY() {\n        if (!Number.isNaN(this.cache.sumY))\n            return this.cache.sumY;\n        let sumY = 0;\n        for (let item of this.array) {\n            sumY += item.y;\n        }\n        this.cache.sumY = sumY;\n        this.cache.isEmpty = false;\n        return sumY;\n    }\n    get minX() {\n        if (!Number.isNaN(this.cache.minX))\n            return this.cache.minX;\n        let minX = Number.POSITIVE_INFINITY;\n        for (let item of this.array) {\n            if (item.x < minX) {\n                minX = item.x;\n            }\n        }\n        this.cache.minX = minX;\n        this.cache.isEmpty = false;\n        return minX;\n    }\n    get maxX() {\n        if (!Number.isNaN(this.cache.maxX))\n            return this.cache.maxX;\n        let maxX = Number.NEGATIVE_INFINITY;\n        for (let item of this.array) {\n            if (item.x > maxX) {\n                maxX = item.x;\n            }\n        }\n        this.cache.maxX = maxX;\n        this.cache.isEmpty = false;\n        return maxX;\n    }\n    get minY() {\n        if (!Number.isNaN(this.cache.minY))\n            return this.cache.minY;\n        let minY = Number.POSITIVE_INFINITY;\n        for (let item of this.array) {\n            if (item.y < minY) {\n                minY = item.y;\n            }\n        }\n        this.cache.minY = minY;\n        this.cache.isEmpty = false;\n        return minY;\n    }\n    get maxY() {\n        if (!Number.isNaN(this.cache.maxY))\n            return this.cache.maxY;\n        let maxY = Number.NEGATIVE_INFINITY;\n        for (let item of this.array) {\n            if (item.y > maxY) {\n                maxY = item.y;\n            }\n        }\n        this.cache.maxY = maxY;\n        this.cache.isEmpty = false;\n        return maxY;\n    }\n    multiplyY(value) {\n        for (const item of this.array) {\n            item.y *= value;\n        }\n    }\n    setArray(array) {\n        this.array = array;\n        this.emptyCache();\n    }\n    move(other) {\n        this.array = other.array;\n        this.emptyCache();\n    }\n    push(...points) {\n        this.array.push(...points);\n        this.emptyCache();\n    }\n    /**\n     * Sort by ASCENDING x values\n     * @returns {Distribution}\n     */\n    sortX() {\n        this.cache.ySorted = false;\n        if (this.cache.xSorted)\n            return this;\n        this.array.sort((a, b) => a.x - b.x);\n        this.cache.xSorted = true;\n        this.cache.isEmpty = false;\n        return this;\n    }\n    /**\n     * Sort by DESCENDING y values\n     * @returns {Distribution}\n     */\n    sortY() {\n        this.cache.xSorted = false;\n        if (this.cache.ySorted)\n            return this;\n        this.array.sort((a, b) => b.y - a.y);\n        this.cache.ySorted = true;\n        this.cache.isEmpty = false;\n        return this;\n    }\n    normalize() {\n        const sum = this.sumY;\n        for (let item of this.array) {\n            item.y /= sum;\n        }\n        return this;\n    }\n    /**\n     * Only keep a defined number of peaks\n     * @param {number} limit\n     * @returns\n     */\n    topY(limit) {\n        if (!limit)\n            return this;\n        if (this.array.length <= limit)\n            return this;\n        this.sortY();\n        this.array.splice(limit);\n        return this;\n    }\n    /**\n     * remove all the peaks under a defined relative threshold\n     * @param {number} [relativeValue=0] Should be between 0 and 1. 0 means no peak will be removed, 1 means all peaks will be removed\n     */\n    threshold(relativeValue = 0) {\n        if (!relativeValue)\n            return this;\n        const maxY = this.maxY;\n        const threshold = maxY * relativeValue;\n        this.array = this.array.filter((point) => point.y >= threshold);\n    }\n    square(options = {}) {\n        return this.multiply(this, options);\n    }\n    multiply(b, options) {\n        return (0, multiply_js_1.multiply)(this, b, options);\n    }\n    power(p, options) {\n        return (0, power_js_1.power)(this, p, options);\n    }\n    copy() {\n        let distCopy = new Distribution();\n        distCopy.cache = { ...this.cache };\n        distCopy.array = structuredClone(this.array);\n        return distCopy;\n    }\n    maxToOne() {\n        if (this.array.length === 0)\n            return this;\n        let currentMax = this.maxY;\n        for (let item of this.array) {\n            item.y /= currentMax;\n        }\n        return this;\n    }\n    joinX(threshold) {\n        return (0, joinX_js_1.joinX)(this, threshold);\n    }\n    append(distribution) {\n        for (let item of distribution.array) {\n            this.array.push(item);\n        }\n        this.emptyCache();\n    }\n    closestPointX(target) {\n        this.sortX();\n        return (0, closestPointX_js_1.closestPointX)(this.array, target);\n    }\n}\nexports.Distribution = Distribution;\nfunction getEmptyCache() {\n    return {\n        isEmpty: true,\n        xSorted: false,\n        ySorted: false,\n        minX: Number.NaN,\n        maxX: Number.NaN,\n        minY: Number.NaN,\n        maxY: Number.NaN,\n        sumY: Number.NaN,\n    };\n}\n//# sourceMappingURL=Distribution.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDerivedCompositionInfo = getDerivedCompositionInfo;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst mf_parser_1 = require(\"mf-parser\");\n/**\n * Calcultes informations about the isotopic composition explaining a specific mass\n * @param {Record<string, number>} composition\n * @returns\n */\nfunction getDerivedCompositionInfo(composition) {\n    const shortComposition = {};\n    let label = '';\n    let shortLabel = '';\n    let deltaNeutrons = 0;\n    for (let key in composition) {\n        let isotopeLabel = '';\n        for (let i = 0; i < key.length; i++) {\n            if (mf_parser_1.superscript[key[i]]) {\n                isotopeLabel += mf_parser_1.superscript[key[i]];\n            }\n            else {\n                isotopeLabel += key[i];\n            }\n        }\n        if (composition[key] > 1) {\n            const number = String(composition[key]);\n            for (let i = 0; i < number.length; i++) {\n                isotopeLabel += mf_parser_1.subscript[number[i]];\n            }\n        }\n        label += isotopeLabel;\n        const isotope = chemical_elements_1.stableIsotopesObject[key];\n        deltaNeutrons += isotope.deltaNeutrons * composition[key];\n        if (isotope.mostAbundant)\n            continue;\n        shortLabel += isotopeLabel;\n        shortComposition[key] = composition[key];\n    }\n    return { label, shortComposition, shortLabel, deltaNeutrons };\n}\n//# sourceMappingURL=getDerivedCompositionInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.IsotopicDistribution = void 0;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst mf_parser_1 = require(\"mf-parser\");\nconst mf_utilities_1 = require(\"mf-utilities\");\nconst ml_spectra_processing_1 = require(\"ml-spectra-processing\");\nconst spectrum_generator_1 = require(\"spectrum-generator\");\nconst Distribution_1 = require(\"./Distribution\");\nconst getDerivedCompositionInfo_1 = require(\"./utils/getDerivedCompositionInfo\");\nconst MINIMAL_FWHM = 1e-8;\nconst MINIMAL_Y = 1e-8;\n/** @typedef {import('mf-parser').IsotopesInfo} IsotopesInfo */\n/** @typedef {import('mf-parser').MFInfo} MFInfo */\n/** @typedef {import('./IsotopicDistribution.types').XY} XY */\n/** @typedef {import('./IsotopicDistribution.types').IsotopicDistributionPart} IsotopicDistributionPart */\n/** @typedef {import('./IsotopicDistribution.types').IsotopicDistributionOptions} IsotopicDistributionOptions */\n/**\n * A class that allows to manage isotopic distribution\n */\nclass IsotopicDistribution {\n    /**\n     * Class that manages isotopic distribution\n     * @param {string|Array<any>} value - Molecular formula or an array of parts.\n     * @param {IsotopicDistributionOptions} [options]\n     */\n    constructor(value, options = {}) {\n        this.threshold = options.threshold;\n        this.limit = options.limit;\n        if (Array.isArray(value)) {\n            this.parts = structuredClone(value);\n            for (let part of this.parts) {\n                part.confidence = 0;\n                part.isotopesInfo = new mf_parser_1.MF(part.ionization?.mf\n                    ? `${part.mf}(${part.ionization.mf})`\n                    : part.mf || '').getIsotopesInfo();\n            }\n        }\n        else {\n            let mf = new mf_parser_1.MF(value, { ensureCase: options.ensureCase });\n            let mfInfo = mf.getInfo();\n            const ionizations = (0, mf_utilities_1.preprocessIonizations)(options.ionizations);\n            /** @type {MFInfo} */\n            const parts = 'parts' in mfInfo ? mfInfo.parts : [mfInfo];\n            this.parts = [];\n            for (let partOriginal of parts) {\n                // we calculate information for each part\n                for (const ionization of ionizations) {\n                    let part = structuredClone(partOriginal);\n                    part.em = part.monoisotopicMass; // TODO: To remove !!! we change the name !?\n                    part.isotopesInfo = new mf_parser_1.MF(ionization.mf ? `${part.mf}(${ionization.mf})` : part.mf || '').getIsotopesInfo();\n                    part.confidence = 0;\n                    let msInfo = (0, mf_utilities_1.getMsInfo)(part, {\n                        ionization,\n                    });\n                    part.ionization = msInfo.ionization;\n                    part.ms = msInfo.ms;\n                    this.parts.push(part);\n                }\n            }\n        }\n        this.cachedDistribution = undefined;\n        this.fwhm = options.fwhm === undefined ? 0.01 : options.fwhm;\n        // if fwhm is under 1e-8 there are some artifacts in the spectra\n        if (this.fwhm < MINIMAL_FWHM)\n            this.fwhm = MINIMAL_FWHM;\n        this.minY = options.minY === undefined ? MINIMAL_Y : options.minY;\n        this.maxLines = options.maxLines || 5000;\n        this.allowNeutral =\n            options.allowNeutral === undefined ? true : options.allowNeutral;\n    }\n    /**\n     * @returns {Array<IsotopicDistributionPart>}\n     */\n    getParts() {\n        return this.parts;\n    }\n    /**\n     * @return {Distribution} returns the total distribution (for all parts)\n     */\n    getDistribution() {\n        if (this.cachedDistribution)\n            return this.cachedDistribution;\n        let options = {\n            maxLines: this.maxLines,\n            minY: this.minY,\n            deltaX: this.fwhm,\n        };\n        let finalDistribution = new Distribution_1.Distribution();\n        this.confidence = 0;\n        // TODO need to cache each part without ionization\n        // in case of many ionization we don't need to recalculate everything !\n        for (let part of this.parts) {\n            let totalDistribution = new Distribution_1.Distribution([\n                {\n                    x: 0,\n                    y: 1,\n                    composition: this.fwhm === MINIMAL_FWHM ? {} : undefined, // should we calculate composition in isotopes of each peak\n                },\n            ]);\n            let partNaturalDeltaNeutrons = 0;\n            for (let isotope of part.isotopesInfo.isotopes) {\n                partNaturalDeltaNeutrons +=\n                    (isotope.naturalDeltaNeutrons ?? 0) * isotope.number;\n            }\n            let charge = part.ms?.charge || part.isotopesInfo.charge || 0;\n            let absoluteCharge = Math.abs(charge);\n            if (charge || this.allowNeutral) {\n                for (let isotope of part.isotopesInfo.isotopes) {\n                    if (isotope.number < 0)\n                        return { array: [] };\n                    if (isotope.number > 0) {\n                        const newDistribution = structuredClone(isotope.distribution);\n                        if (this.fwhm === MINIMAL_FWHM) {\n                            // add composition\n                            for (const entry of newDistribution) {\n                                entry.composition = { [Math.round(entry.x) + isotope.atom]: 1 };\n                            }\n                        }\n                        let distribution = new Distribution_1.Distribution(newDistribution);\n                        distribution.power(isotope.number, options);\n                        totalDistribution.multiply(distribution, options);\n                    }\n                }\n                this.confidence = 0;\n                for (const item of totalDistribution.array) {\n                    this.confidence += item.y;\n                }\n                // we finally deal with the charge\n                if (charge) {\n                    for (const e of totalDistribution.array) {\n                        e.x = (e.x - chemical_elements_1.ELECTRON_MASS * charge) / absoluteCharge;\n                    }\n                }\n                if (totalDistribution.array && totalDistribution.array.length > 0) {\n                    totalDistribution.sortX();\n                    part.fromX = totalDistribution.array[0].x;\n                    part.toX = totalDistribution.array.at(-1).x;\n                }\n                if (part.ms?.similarity?.factor) {\n                    totalDistribution.multiplyY(part.ms.similarity.factor);\n                }\n                else if (part.ms?.target?.intensity &&\n                    part.ms?.target?.intensity !== 1) {\n                    // intensity is the value of the monoisotopic mass !\n                    // need to find the intensity of the peak corresponding\n                    // to the monoisotopic mass\n                    if (part.ms.target.mass) {\n                        let target = totalDistribution.closestPointX(part.ms.target.mass);\n                        totalDistribution.multiplyY(part.ms.target.intensity / target.y);\n                    }\n                    else {\n                        totalDistribution.multiplyY(part.ms.target.intensity);\n                    }\n                }\n                else if (part?.intensity && part?.intensity !== 1) {\n                    totalDistribution.multiplyY(part.intensity);\n                }\n                part.isotopicDistribution = totalDistribution.array;\n                for (let entry of totalDistribution.array) {\n                    if (!entry.composition)\n                        continue;\n                    const info = (0, getDerivedCompositionInfo_1.getDerivedCompositionInfo)(entry.composition);\n                    info.deltaNeutrons -= partNaturalDeltaNeutrons;\n                    Object.assign(entry, info);\n                }\n                if (finalDistribution.array.length === 0) {\n                    finalDistribution = totalDistribution;\n                }\n                else {\n                    finalDistribution.append(totalDistribution);\n                }\n            }\n        }\n        if (finalDistribution)\n            finalDistribution.joinX(this.fwhm);\n        // if there is a threshold we will deal with it\n        // and we will correct the confidence\n        if (this.threshold || this.limit) {\n            const sumBefore = finalDistribution.sumY;\n            if (this.threshold)\n                finalDistribution.threshold(this.threshold);\n            if (this.limit) {\n                finalDistribution.topY(this.limit);\n                finalDistribution.sortX();\n            }\n            const sumAfter = finalDistribution.sumY;\n            this.confidence = (this.confidence * sumAfter) / sumBefore;\n        }\n        this.confidence /= this.parts.length;\n        this.cachedDistribution = finalDistribution;\n        return finalDistribution;\n    }\n    /**\n     *\n     * @param {object} options\n     * @param {string} [options.delimiter=', ']\n     * @param {number} [options.numberXDecimals=4]\n     * @param {number} [options.numberYDecimals=4]\n     * @returns\n     */\n    getCSV(options) {\n        return this.getText({ ...options, delimiter: ', ' });\n    }\n    /**\n     *\n     * @param {object} options\n     * @param {string} [options.delimiter='\\t']\n     * @param {number} [options.numberXDecimals=4]\n     * @param {number} [options.numberYDecimals=4]\n     * @returns\n     */\n    getTSV(options) {\n        return this.getText({ ...options, delimiter: '\\t' });\n    }\n    getTable(options = {}) {\n        const { maxValue, xLabel = 'x', yLabel = 'y' } = options;\n        let points = this.getDistribution().array;\n        if (points.length === 0)\n            return [];\n        let factor = 1;\n        if (maxValue) {\n            let maxY = this.getMaxY(points);\n            factor = maxValue / maxY;\n        }\n        return points.map((point) => {\n            let newPoint = { [xLabel]: point.x, [yLabel]: point.y * factor };\n            return newPoint;\n        });\n    }\n    /**\n     *\n     * @param {object} options\n     * @param {string} [options.delimiter='\\t']\n     * @param {number} [options.numberXDecimals=4]\n     * @param {number} [options.numberYDecimals=4]\n     * @returns\n     */\n    getText(options = {}) {\n        const { delimiter = '\\t', numberXDecimals = 5, numberYDecimals = 3, } = options;\n        let points = this.getDistribution().array;\n        let csv = [];\n        for (let point of points) {\n            csv.push(`${point.x.toFixed(numberXDecimals)}${delimiter}${(point.y * 100).toFixed(numberYDecimals)}`);\n        }\n        return csv.join('\\n');\n    }\n    getMaxY(points) {\n        let maxY = points[0].y;\n        for (let point of points) {\n            if (point.y > maxY)\n                maxY = point.y;\n        }\n        return maxY;\n    }\n    getSumY(points) {\n        let sumY = 0;\n        for (let point of points) {\n            sumY += point.y;\n        }\n        return sumY;\n    }\n    /**\n     * Returns the isotopic distribution as an array of peaks\n     * @param {object} [options={}]\n     * @param {number} [options.maxValue=100]\n     * @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored\n     * @return {Array<{x:number,y:number}|{x:number,y:number,label:string,shortComposition:string,shortLabel:string,deltaNeutrons:number}>}\n     */\n    getPeaks(options = {}) {\n        const { maxValue = 100, sumValue } = options;\n        let peaks = this.getDistribution().array;\n        if (peaks.length === 0)\n            return [];\n        let factor = 1;\n        if (sumValue) {\n            let sumY = this.getSumY(peaks);\n            factor = sumY / sumValue;\n            if (factor !== 1) {\n                peaks = structuredClone(peaks);\n                for (const peak of peaks) {\n                    peak.y = peak.y / factor;\n                }\n            }\n        }\n        else if (maxValue) {\n            let maxY = this.getMaxY(peaks);\n            if (maxValue !== maxY) {\n                // we need to copy the array because we prefer no side effects\n                peaks = structuredClone(peaks);\n                for (const peak of peaks) {\n                    // we rescale the Y values by first dividing by maxY and then multiplying by maxValue in order to avoid approximation errors\n                    peak.y = (peak.y / maxY) * maxValue;\n                }\n            }\n        }\n        return peaks;\n    }\n    /**\n     * Returns the isotopic distirubtion\n     * @param {object} [options={}]\n     * @param {number} [options.maxValue=100]\n     * @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored\n     * @return {{x:number[],y:number[]}|{x:number[],y:number[],label:string[],shortComposition:string[],shortLabel:string[],deltaNeutrons:[]}}\n     */\n    getXY(options = {}) {\n        let peaks = this.getPeaks(options);\n        if (peaks.length === 0) {\n            return { x: [], y: [] };\n        }\n        const result = {\n            x: peaks.map((a) => a.x),\n            y: peaks.map((a) => a.y),\n        };\n        for (let key of Object.keys(peaks[0]).filter((k) => k !== 'x' && k !== 'y')) {\n            result[key] = peaks.map((a) => a[key]);\n        }\n        return result;\n    }\n    /**\n     * Returns the isotopic distirubtion\n     * @param {object} [options={}]\n     * @param {number} [options.maxValue=100]\n     * @param {number} [options.sumValue] // if sumValue is defined, maxValue is ignored\n     * @return {import('cheminfo-types').MeasurementXYVariables} an object containing at least the 2 properties: x:[] and y:[]\n     */\n    getVariables(options = {}) {\n        const xy = this.getXY(options);\n        return {\n            x: { data: xy.x, label: 'm/z', units: 'u' },\n            y: { data: xy.y, label: 'Relative intensity', units: '%' },\n        };\n    }\n    /**\n     * Returns the isotopic distribution as the sum of gaussian\n     * @param {object} [options={}]\n     * @param {number} [options.gaussianWidth=10] // how good should look the gaussian ? By default we take 10 times the fwhm as number of points\n     * @param {number} [options.threshold=0.00001] // minimal height to return point\n     * @param {number} [options.maxLength=1e6] // minimal height to return point\n     * @param {number} [options.maxValue] // rescale Y to reach maxValue\n     * @param {number} [options.from] // minimal x value, default to the first point - 2\n     * @param {number} [options.to] // maximal x value, default to the last point + 2\n     * @param {function} [options.peakWidthFct=(mz)=>(this.fwhm)]\n     * @return {XY} isotopic distribution as an object containing 2 properties: x:[] and y:[]\n     */\n    getGaussian(options = {}) {\n        const { peakWidthFct = () => this.fwhm, threshold = 0.00001, gaussianWidth = 10, maxValue, maxLength = 1e6, } = options;\n        let points = this.getTable({ maxValue });\n        if (points.length === 0)\n            return { x: [], y: [] };\n        const from = options.from || points[0].x - 2;\n        const to = options.to || points.at(-1).x + 2;\n        const nbPoints = Math.round(((to - from) * gaussianWidth) / this.fwhm + 1);\n        if (nbPoints > maxLength) {\n            throw new Error(`Number of points is over the maxLength: ${nbPoints}>${maxLength}`);\n        }\n        let gaussianOptions = {\n            from,\n            to,\n            nbPoints,\n            peakWidthFct,\n        };\n        let spectrumGenerator = new spectrum_generator_1.SpectrumGenerator(gaussianOptions);\n        for (let point of points) {\n            spectrumGenerator.addPeak([point.x, point.y]);\n        }\n        let spectrum = spectrumGenerator.getSpectrum({ threshold });\n        if (maxValue) {\n            spectrum.y = (0, ml_spectra_processing_1.xNormed)(spectrum.y, {\n                algorithm: 'max',\n                value: maxValue,\n                output: spectrum.y,\n            });\n        }\n        return spectrum;\n    }\n}\nexports.IsotopicDistribution = IsotopicDistribution;\n//# sourceMappingURL=IsotopicDistribution.js.map","\"use strict\";\n/**\n * @param {object}   [entry={}]\n * @param {object}   [options={}]\n * @param {number}   [options.min=-Infinity] - Minimal unsaturation\n * @param {number}   [options.max=+Infinity] - Maximal unsaturation\n * @param {boolean}   [options.onlyInteger=false] - Integer unsaturation\n * @param {boolean}   [options.onlyNonInteger=false] - Non integer unsaturation\n * @return {boolean}\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unsaturationMatcher = unsaturationMatcher;\nfunction unsaturationMatcher(entry, options = {}) {\n    const { min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER, onlyInteger, onlyNonInteger, } = options;\n    if (entry.unsaturation !== undefined) {\n        if (entry.unsaturation < min || entry.unsaturation > max)\n            return false;\n        if (onlyInteger && !Number.isInteger(entry.unsaturation))\n            return false;\n        if (onlyNonInteger && Number.isInteger(entry.unsaturation))\n            return false;\n    }\n    return true;\n}\n//# sourceMappingURL=unsaturationMatcher.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generalMatcher = generalMatcher;\nconst unsaturationMatcher_js_1 = require(\"./unsaturationMatcher.js\");\n/**\n * Returns true if the entry containing MF information match\n * @param {object}   [entry={}] - object containing mw, ...\n * @param {object}   [options={}]\n * @param {number}   [options.minMW=0] - Minimal molecular weight\n * @param {number}   [options.maxMW=+Infinity] - Maximal molecular weight\n * @param {number}   [options.minEM=0] - Minimal monoisotopic mass\n * @param {number}   [options.maxEM=+Infinity] - Maximal monoisotopic mass\n * @param {number}   [options.minCharge=-Infinity] - Minimal charge\n * @param {number}   [options.maxCharge=+Infinity] - Maximal charge\n * @param {boolean}  [options.absoluteCharge=false] - If true, the charge is absolute (so between 0 and +Infinity by default)\n * @param {object}   [options.unsaturation={}]\n * @param {number}   [options.unsaturation.min=-Infinity] - Minimal unsaturation\n * @param {number}   [options.unsaturation.max=+Infinity] - Maximal unsaturation\n * @param {boolean}   [options.unsaturation.onlyInteger=false] - Integer unsaturation\n * @param {boolean}   [options.unsaturation.onlyNonInteger=false] - Non integer unsaturation\n * @param {object}   [options.atoms] - object of atom:{min, max}\n * @return {boolean}\n */\nfunction generalMatcher(entry, options = {}) {\n    const { minMW = 0, maxMW = +Infinity, minEM = 0, maxEM = +Infinity, minCharge = Number.MIN_SAFE_INTEGER, maxCharge = Number.MAX_SAFE_INTEGER, absoluteCharge = false, unsaturation = {}, atoms, } = options;\n    if (entry.mw !== undefined && (entry.mw < minMW || entry.mw > maxMW)) {\n        return false;\n    }\n    if (entry.em !== undefined && (entry.em < minEM || entry.em > maxEM)) {\n        return false;\n    }\n    if (entry.charge !== undefined) {\n        let charge = absoluteCharge ? Math.abs(entry.charge) : entry.charge;\n        if (charge < minCharge || charge > maxCharge)\n            return false;\n    }\n    if (unsaturation !== undefined &&\n        entry.unsaturation !== undefined &&\n        !(0, unsaturationMatcher_js_1.unsaturationMatcher)(entry, unsaturation)) {\n        return false;\n    }\n    if (entry.atoms !== undefined && atoms) {\n        // all the atoms of the entry must fit in the range\n        for (let atom in entry.atoms) {\n            if (!atoms[atom])\n                return false;\n            if (entry.atoms[atom] < atoms[atom].min)\n                return false;\n            if (entry.atoms[atom] > atoms[atom].max)\n                return false;\n        }\n    }\n    return true;\n}\n//# sourceMappingURL=generalMatcher.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.msemMatcher = msemMatcher;\nconst mf_utilities_1 = require(\"mf-utilities\");\nconst ml_spectra_processing_1 = require(\"ml-spectra-processing\");\nconst unsaturationMatcher_js_1 = require(\"./unsaturationMatcher.js\");\n/**\n * @typedef {object} MSEMFilterOptions\n * @property {object}         [ionization={ mf: '', em: 0, charge: 0 }] - ionization method\n * @property {boolean}        [forceIonization=false] - If true ignore existing ionizations\n * @property {number}         [precision=1000] - The precision on the experimental mass\n * @property {number}         [targetMass] - Target mass, allows to calculate error and filter results\n * @property {number[]}       [targetMasses] - Target masses: SORTED array of numbers\n * @property {number[]}       [targetIntensities] - Target intensities: SORTED array of numbers\n * @property {number}         [minMW=-Infinity] - Minimal monoisotopic mass\n * @property {number}         [maxMW=+Infinity] - Maximal monoisotopic mass\n * @property {number}         [minEM=-Infinity] - Minimal monoisotopic mass\n * @property {number}         [maxEM=+Infinity] - Maximal monoisotopic mass\n * @property {number}         [minMSEM=-Infinity] - Minimal monoisotopic mass observed by mass\n * @property {number}         [maxMSEM=+Infinity] - Maximal monoisotopic mass observed by mass\n * @property {number}         [minCharge=-Infinity] - Minimal charge\n * @property {number}         [maxCharge=+Infinity] - Maximal charge\n * @property {boolean}        [absoluteCharge=false] - If true, the charge is absolute (so between 0 and +Infinity by default)\n * @property {boolean}        [allowNegativeAtoms=false] - Allow to have negative number of atoms\n * @property {object}         [unsaturation={}]\n * @property {number}         [unsaturation.min=-Infinity] - Minimal unsaturation\n * @property {number}         [unsaturation.max=+Infinity] - Maximal unsaturation\n * @property {boolean}        [unsaturation.onlyInteger=false] - Integer unsaturation\n * @property {boolean}        [unsaturation.onlyNonInteger=false] - Non integer unsaturation\n * @property {boolean}        [atoms] - object of atom:{min, max}\n * @property {Function}       [callback] - a function that contains information about the current MF\n */\n/**\n * @param {object}             [entry={}]\n * @param {MSEMFilterOptions}  [options={}]\n * @return {boolean}\n */\n/**\n * We always recalculate msem\n */\nfunction msemMatcher(entry, options = {}) {\n    const { ionization = { mf: '', em: 0, charge: 0, atoms: {} }, forceIonization = false, precision = 1000, minCharge = Number.MIN_SAFE_INTEGER, maxCharge = Number.MAX_SAFE_INTEGER, absoluteCharge = false, unsaturation = {}, targetMass, // if present we will calculate the errors\n    targetMasses, // if present we will calculate the smallest error\n    targetIntensities, // if present it will be added in the report\n    minEM = -Infinity, maxEM = +Infinity, minMSEM = -Infinity, maxMSEM = +Infinity, minMW = -Infinity, maxMW = +Infinity, allowNegativeAtoms = false, atoms, callback, } = options;\n    if (entry.mw !== undefined && (entry.mw < minMW || entry.mw > maxMW)) {\n        return false;\n    }\n    let msInfo = (0, mf_utilities_1.getMsInfo)(entry, {\n        ionization,\n        forceIonization,\n        targetMass,\n    });\n    let ms = msInfo.ms;\n    if (entry.em !== undefined && (entry.em < minEM || entry.em > maxEM)) {\n        return false;\n    }\n    if (ms.em !== undefined && (ms.em < minMSEM || ms.em > maxMSEM)) {\n        return false;\n    }\n    if (targetMass && Math.abs(ms.ppm) > precision) {\n        return false;\n    }\n    if (ms.charge !== undefined) {\n        let charge = absoluteCharge ? Math.abs(ms.charge) : ms.charge;\n        if (charge < minCharge || charge > maxCharge)\n            return false;\n    }\n    if (unsaturation !== undefined &&\n        entry.unsaturation !== undefined &&\n        !(0, unsaturationMatcher_js_1.unsaturationMatcher)(entry, unsaturation)) {\n        return false;\n    }\n    if (entry.atoms !== undefined && atoms) {\n        // all the atoms of the entry must fit in the range\n        for (let atom in entry.atoms) {\n            if (!atoms[atom])\n                return false;\n            if (entry.atoms[atom] < atoms[atom].min)\n                return false;\n            if (entry.atoms[atom] > atoms[atom].max)\n                return false;\n        }\n    }\n    if (entry.atoms !== undefined && !allowNegativeAtoms) {\n        const ionizationAtoms = (msInfo.ionization && msInfo.ionization.atoms) || {};\n        const atomKeys = new Set(Object.keys(ionizationAtoms).concat(Object.keys(entry.atoms)));\n        for (let atom of atomKeys) {\n            if ((entry.atoms[atom] || 0) + (ionizationAtoms[atom] || 0) < 0) {\n                return false;\n            }\n        }\n    }\n    if (targetMasses && targetMasses.length > 0) {\n        let index = (0, ml_spectra_processing_1.xFindClosestIndex)(targetMasses, ms.em);\n        let closestMass = targetMasses[index];\n        msInfo = (0, mf_utilities_1.getMsInfo)(entry, {\n            ionization,\n            forceIonization,\n            targetMass: closestMass,\n        });\n        msInfo.ms.target = { mass: closestMass };\n        if (targetIntensities) {\n            msInfo.ms.target.intensity = targetIntensities[index];\n        }\n        // need to find the closest targetMasses\n        if (Math.abs(msInfo.ms.ppm) > precision)\n            return false;\n    }\n    if (callback && !callback(entry))\n        return false;\n    return msInfo;\n}\n//# sourceMappingURL=msemMatcher.js.map","'use strict';\n\n/**\n * Modify object a to join it with b and make the sum of each of the keys\n * @param {*} a\n * @param {*} source1\n *\n * @return {object}\n */\n\nfunction sum(target) {\n    for (var i = 1; i < arguments.length; i++) {\n        let toSum = arguments[i];\n        for (var key of Object.keys(toSum)) {\n            if (target[key]) {\n                target[key] += toSum[key];\n            } else {\n                target[key] = toSum[key];\n            }\n        }\n    }\n    return target;\n}\n\nmodule.exports = sum;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n    return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateMFs = generateMFs;\nconst chemical_elements_1 = require(\"chemical-elements\");\nconst mf_matcher_1 = require(\"mf-matcher\");\nconst mf_parser_1 = require(\"mf-parser\");\nconst mf_utilities_1 = require(\"mf-utilities\");\nconst sum_object_keys_1 = __importDefault(require(\"sum-object-keys\"));\n/**\n * Generate all the possible combinations of molecular formula and calculate\n * for each of them the monoisotopic mass and observed monoisotopic mass (m/z)\n * In the molecular formula there may be a comment after the '$' symbol\n *\n * @param {Array}         ranges\n * @param {object}        [options={}]\n * @param {number}        [options.limit=10000000] - Maximum number of results\n * @param {boolean}       [options.estimate=false] - estimate the number of MF without filters\n * @param {boolean}       [options.canonizeMF=true] - Canonize molecular formula\n * @param {boolean}       [options.uniqueMFs=true] - Force canonization and make MF unique\n * @param {string}        [options.ionizations=''] - Comma separated list of ionizations (to charge the molecule)\n * @param {function}      [options.onStep] - Callback to do after each step\n * @param {import('mf-matcher').MSEMFilterOptions}        [options.filter={}]\n * @param {string}        [options.filterFct]\n * @param {object}        [options.links]\n * @param {boolean}       [options.links.filter] We filter all the MF that do not match the '*X'\n * @returns {Promise}\n */\nasync function generateMFs(ranges, options = {}) {\n    if (!Array.isArray(ranges)) {\n        throw new Error('Ranges must be an array of string or object');\n    }\n    options = { ...options };\n    let { limit = 100000, uniqueMFs = true, estimate = false, onStep } = options;\n    options.filterFctVariables = {};\n    for (let i = 0; i < ranges.length; i++) {\n        const range = ranges[i];\n        if (typeof range === 'object' && range.name) {\n            options.filterFctVariables[range.name] = i;\n            ranges[i] = range.value;\n        }\n    }\n    if (options.filterFct) {\n        // we create a real javascript function\n        let variables = Object.keys(options.filterFctVariables);\n        variables.push('mm', 'mz', 'charge', 'unsaturation', 'atoms');\n        // eslint-disable-next-line no-new-func\n        options.filterFct = new Function(...variables, `return ${options.filterFct}`);\n    }\n    if (uniqueMFs === true)\n        options.canonizeMF = true;\n    if (options.canonizeMF === undefined)\n        options.canonizeMF = true;\n    options.ionizations = (0, mf_utilities_1.preprocessIonizations)(options.ionizations);\n    // we allow String delimited by \". or ;\" instead of an array\n    for (let i = 0; i < ranges.length; i++) {\n        if (!Array.isArray(ranges[i])) {\n            ranges[i] = ranges[i].split(/[,.]/);\n        }\n    }\n    // we allow ranges in a string ...\n    // problem with ranges is that we need to know to what the range applies\n    for (let i = 0; i < ranges.length; i++) {\n        let parts = ranges[i];\n        let newParts = [];\n        for (let j = 0; j < parts.length; j++) {\n            let part = parts[j];\n            if (part.match(/\\d-[\\d-]/)) {\n                // deal with negative numbers\n                // there are ranges ... we are in trouble !\n                newParts = newParts.concat(new mf_parser_1.MF(part).flatten({ groupIdentical: false, limit }));\n            }\n            else {\n                newParts.push(parts[j]); // the part with the comments !\n            }\n        }\n        ranges[i] = newParts;\n    }\n    if (estimate) {\n        let total = ranges.reduce((previous, current) => previous * current.length, 1);\n        return total * options.ionizations.length;\n    }\n    let results = [];\n    let sizes = [];\n    let currents = [];\n    for (let i = 0; i < ranges.length; i++) {\n        sizes.push(ranges[i].length - 1);\n        currents.push(0);\n    }\n    let position = 0;\n    let evolution = 0;\n    while (position < currents.length) {\n        if (currents[position] < sizes[position]) {\n            if (onStep)\n                await onStep(evolution);\n            evolution++;\n            appendResult(results, currents, ranges, options);\n            currents[position]++;\n            for (let i = 0; i < position; i++) {\n                currents[i] = 0;\n            }\n            position = 0;\n        }\n        else {\n            position++;\n        }\n        if (evolution > limit) {\n            throw new Error(`You have reached the limit of ${limit}. You could still change this value using the limit option but it is likely to crash.`);\n        }\n    }\n    appendResult(results, currents, ranges, options);\n    if (uniqueMFs) {\n        let uniqueMFsObject = {};\n        for (const result of results) {\n            uniqueMFsObject[result.mf + result.ionization.mf] = result;\n        }\n        results = Object.keys(uniqueMFsObject).map((k) => uniqueMFsObject[k]);\n    }\n    results.sort((a, b) => a.em - b.em);\n    return results;\n}\nlet ems = {};\n// internal method used as a cache\nfunction getMonoisotopicMass(mfString) {\n    if (!ems[mfString]) {\n        // we need to calculate based on the mf but not very often ...\n        let mf = new mf_parser_1.MF(mfString);\n        let info = mf.getInfo();\n        ems[mfString] = {\n            em: info.monoisotopicMass,\n            charge: info.charge,\n            mw: info.mass,\n            unsaturation: (info.unsaturation - 1) * 2,\n            atoms: info.atoms,\n        };\n    }\n    return ems[mfString];\n}\nfunction getEMFromParts(parts, currents, ionization) {\n    let charge = 0;\n    let em = 0;\n    let mw = 0;\n    let unsaturation = 0;\n    let validUnsaturation = true;\n    let atoms = {};\n    for (let i = 0; i < parts.length; i++) {\n        let part = parts[i][currents[i]];\n        if (part) {\n            let info = getMonoisotopicMass(part);\n            charge += info.charge;\n            em += info.em;\n            mw += info.mw;\n            (0, sum_object_keys_1.default)(atoms, info.atoms);\n            if (info.unsaturation && validUnsaturation) {\n                unsaturation += info.unsaturation;\n            }\n        }\n    }\n    return {\n        charge,\n        em,\n        mw,\n        ionization,\n        unsaturation: validUnsaturation ? unsaturation / 2 + 1 : undefined,\n        atoms,\n    };\n}\nfunction appendResult(results, currents, keys, options = {}) {\n    const { canonizeMF, filter, ionizations, links = {} } = options;\n    // this script is designed to combine molecular formula\n    // that may contain comments after a \"$\" sign\n    // therefore we should put all the comments at the ned\n    if (links.filter) {\n        let sharps = [];\n        for (let i = 0; i < keys.length; i++) {\n            let anchors = keys[i][currents[i]].match(/#\\d+/g);\n            if (anchors)\n                sharps.push(...anchors);\n        }\n        if (sharps.length % 2 === 1)\n            return;\n        sharps = sharps.toSorted();\n        for (let i = 0; i < sharps.length; i += 2) {\n            if (sharps[i] !== sharps[i + 1])\n                return;\n        }\n    }\n    for (let ionization of ionizations) {\n        let result = getEMFromParts(keys, currents, ionization);\n        if (options.filterFct) {\n            let variables = [];\n            for (let key in options.filterFctVariables) {\n                variables.push(currents[options.filterFctVariables[key]]);\n            }\n            variables.push(result.em, (result.em + ionization.em - ionization.charge * chemical_elements_1.ELECTRON_MASS) /\n                Math.abs(ionization.charge), result.charge + result.ionization.charge, result.unsaturation, result.atoms);\n            if (!options.filterFct.apply(null, variables))\n                continue;\n        }\n        result.parts = [];\n        result.mf = '';\n        let comments = [];\n        for (let i = 0; i < keys.length; i++) {\n            let key = keys[i][currents[i]];\n            if (key) {\n                if (key.includes('$')) {\n                    comments.push(key.replace(/^[^$]*\\$/, ''));\n                    key = key.replace(/\\$.*/, '');\n                }\n                result.parts[i] = key;\n                result.mf += key;\n            }\n        }\n        if (comments.length > 0) {\n            result.comment = comments.join(' ');\n        }\n        let match = (0, mf_matcher_1.msemMatcher)(result, filter);\n        if (!match)\n            continue;\n        result.ms = match.ms;\n        result.ionization = match.ionization;\n        if (canonizeMF) {\n            result.mf = new mf_parser_1.MF(result.mf).toMF();\n        }\n        results.push(result);\n    }\n}\n//# sourceMappingURL=generateMFs.js.map","import { Matrix } from 'ml-matrix';\n\nexport function zeroInsteadOfNegative(X) {\n  let rows = X.rows;\n  let columns = X.columns;\n  let newMatrix = new Matrix(X);\n  for (let r = 0; r < rows; r++) {\n    for (let c = 0; c < columns; c++) {\n      if (newMatrix.get(r, c) < 0) {\n        newMatrix.set(r, c, 0);\n      }\n    }\n  }\n  return newMatrix;\n}\n","import { Matrix } from 'ml-matrix';\n\nimport { zeroInsteadOfNegative } from '../util/zeroInsteadOfNegative';\n\nexport function checkMatrixS(data, originalMatrix) {\n  let { A, S } = data;\n  //check if is there at least one element cero\n  let indices = [];\n  let sum = S.sum('row');\n\n  for (let i = 0; i < sum.length; i++) {\n    if (sum[i] === 0) {\n      indices.push(i);\n      continue;\n    } else {\n      for (let j = 0; j < S.columns; j++) {\n        if (isNaN(S.get(i, j))) {\n          indices.push(i);\n          break;\n        }\n      }\n    }\n  }\n  // if there than just one zero or NaN element\n  // run a NMF with the residual matrix Y - A*B\n  if (indices.length > 0) {\n    let temp = fastExtractNMF(\n      originalMatrix.clone().subM(A.mmul(S)),\n      indices.length,\n    );\n    for (let i = 0; i < indices.length; i++) {\n      for (let j = 0; j < S.columns; j++) {\n        S.set(indices[i], j, temp.S.get(i, j));\n      }\n      for (let j = 0; j < A.rows; j++) {\n        A.set(j, indices[i], temp.A.get(j, i));\n      }\n    }\n  }\n\n  return Object.assign({}, data, { A, S });\n}\n\nfunction fastExtractNMF(residual, r) {\n  if (r <= 0) return { A: [], S: [] };\n\n  const { columns, rows } = residual;\n\n  let A = Matrix.zeros(rows, r);\n  let S = Matrix.zeros(r, columns);\n  for (let i = 0; i < r; i++) {\n    residual = zeroInsteadOfNegative(residual);\n    if (residual.sum() === 0) continue;\n    let res2 = Matrix.pow(residual, 2).sum('column');\n    //find the max of the first column\n\n    let maxIndex = 0;\n    for (let j = 1; j < res2.length; j++) {\n      if (res2[maxIndex] < res2[j]) maxIndex = j;\n    }\n\n    if (res2[maxIndex] > 0) {\n      let sqrtMaxValue = Math.sqrt(res2[maxIndex]);\n      for (let j = 0; j < rows; j++) {\n        let value = residual.get(j, maxIndex) / sqrtMaxValue;\n        A.set(j, i, value);\n      }\n      let temp = A.getColumnVector(i).transpose().mmul(residual);\n      for (let j = 0; j < columns; j++) {\n        S.set(i, j, Math.max(temp.get(0, j), 0));\n      }\n      let subtracting = A.getColumnVector(i).mmul(S.getRowVector(i));\n      residual = residual.sub(subtracting);\n    }\n  }\n  return { A, S };\n}\n","import { Matrix } from 'ml-matrix';\n\nexport function normBy(x, by = 'column') {\n  let norms = Matrix.mul(x, x).sum(by);\n  let length = norms.length;\n  for (let i = 0; i < length; i++) {\n    norms[i] = Math.sqrt(norms[i]);\n  }\n  return by === 'row'\n    ? Matrix.from1DArray(length, 1, norms)\n    : Matrix.from1DArray(1, length, norms);\n}\n","import { Matrix, EVD } from 'ml-matrix';\n\nimport { normBy } from '../util/normBy';\nimport { normProj } from '../util/normProj';\nimport { zeroInsteadOfNegative } from '../util/zeroInsteadOfNegative';\n\nexport function updateMatrixA(Ainit, S, originalMatrix, options) {\n  let {\n    maxFBIteration,\n    toleranceFB,\n    normConstrained = false,\n    lambda,\n  } = options;\n  let St = S.transpose();\n  let H = S.mmul(St);\n  let YSt = originalMatrix.mmul(St);\n  let evd = new EVD(H, { assumeSymmetric: true });\n  let L = Math.max(...evd.realEigenvalues);\n  let A = Ainit;\n  let prevA = A.clone();\n  let t = 1;\n\n  let gradient = (a) => a.mmul(H).sub(YSt);\n  let proximal;\n  if (normConstrained) {\n    let normLimits = normBy(Ainit, 'column');\n    proximal = (x, threshold) =>\n      normProj(zeroInsteadOfNegative(x.subS(threshold)), normLimits);\n  } else {\n    proximal = (x, threshold) => zeroInsteadOfNegative(x.subS(threshold));\n  }\n\n  for (let i = 0; i < maxFBIteration; i++) {\n    let tNext = (1 + Math.sqrt(1 + 4 * t * t)) / 2;\n    let w = (t - 1) / tNext;\n    t = tNext;\n    let B = Matrix.mul(A, w + 1).sub(Matrix.mul(prevA, w));\n    prevA = A.clone();\n    A = proximal(B.sub(gradient(B).divS(L)), lambda / L);\n    if (Matrix.sub(prevA, A).norm() / A.norm() < toleranceFB) {\n      break;\n    }\n  }\n  return A;\n}\n","import { normBy } from './normBy';\n\nexport function normProj(X, normLimits) {\n  let norms;\n  let r = X.rows;\n  let c = X.columns;\n  if (normLimits.rows === r) {\n    norms = normBy(X, 'row');\n    //select rows with norm > 0 then multiply twise by the min\n    for (let i = 0; i < r; i++) {\n      if (norms.get(i, 0) <= 0) continue;\n      for (let j = 0; j < c; j++) {\n        let value =\n          X.get(i, j) *\n          Math.min(norms.get(i, 0), normLimits.get(i, 0) / norms.get(i, 0));\n        X.set(i, j, value);\n      }\n    }\n  } else {\n    norms = normBy(X, 'column');\n    for (let i = 0; i < c; i++) {\n      if (norms.get(0, i) <= 0) continue;\n      for (let j = 0; j < r; j++) {\n        let value =\n          X.get(j, i) *\n          Math.min(norms.get(0, i), normLimits.get(0, i) / norms.get(0, i));\n        X.set(j, i, value);\n      }\n    }\n  }\n  return X;\n}\n","import { Matrix, EVD } from 'ml-matrix';\n\nimport { getMax } from '../util/getMax';\nimport { zeroInsteadOfNegative } from '../util/zeroInsteadOfNegative';\n\nexport function updateMatrixS(A, Sinit, originalMatrix, lambda, options) {\n  let { maxFBIteration, toleranceFB } = options;\n  let At = A.transpose();\n  let H = At.mmul(A);\n  let AtY = At.mmul(originalMatrix);\n  let evd = new EVD(H, { assumeSymmetric: true });\n  let L = getMax(evd.realEigenvalues);\n  let t = 1;\n  let S = Sinit.clone();\n  let prevS = S.clone();\n  let gradient = (s) => H.mmul(s).sub(AtY);\n  let proximal = (x, threshold) => zeroInsteadOfNegative(x.subS(threshold));\n\n  for (let i = 0; i < maxFBIteration; i++) {\n    let tNext = (1 + Math.sqrt(1 + 4 * t * t)) / 2;\n    let w = (t - 1) / tNext;\n    t = tNext;\n    // R = S_k + w [S_k - S_(k-1)] = (1 + w) .* S_k - w .* S_(k-1)\n    let R = Matrix.mul(S, 1 + w).sub(Matrix.mul(prevS, w));\n    prevS = S.clone();\n    S = proximal(R.sub(gradient(R).divS(L)), lambda / L);\n    if (Matrix.sub(prevS, S).norm() / S.norm() < toleranceFB) {\n      break;\n    }\n  }\n  return S;\n}\n","export function getMax(array = []) {\n  let max = Number.MIN_SAFE_INTEGER;\n  for (let i = 0; i < array.length; i++) {\n    if (max < array[i]) max = array[i];\n  }\n  return max;\n}\n","import { Matrix } from 'ml-matrix';\n\nimport { normBy } from '../util/normBy';\n\nexport function normalize(data, options) {\n  const { normOnA } = options;\n  let DS = normBy(data.S.transpose(), 'column');\n  let DA = normBy(data.A, 'column');\n  let D = Matrix.mul(DS, DA);\n  let onS, onA;\n  if (normOnA) {\n    onS = (index, c) =>\n      (data.S.get(index, c) * D.get(0, index)) / DS.get(0, index);\n    onA = (index, r) => data.A.get(r, index) / DA.get(0, index);\n  } else {\n    onS = (index, c) => data.S.get(index, c) / DS.get(0, index);\n    onA = (index, r) =>\n      (data.A.get(r, index) * D.get(0, index)) / DA.get(0, index);\n  }\n  const sColumns = data.S.columns;\n  const aRows = data.A.rows;\n  for (let index = 0; index < D.columns; index++) {\n    let valueForS, valueForA;\n    if (D.get(0, index) > 0) {\n      valueForS = onS;\n      valueForA = onA;\n    } else {\n      valueForA = () => 0;\n      valueForS = () => 0;\n    }\n    for (let c = 0; c < sColumns; c++) {\n      data.S.set(index, c, valueForS(index, c));\n    }\n    for (let r = 0; r < aRows; r++) {\n      data.A.set(r, index, valueForA(index, r));\n    }\n  }\n  return data;\n}\n","(function(){function a(d){for(var e=0,f=d.length-1,g=void 0,h=void 0,i=void 0,j=c(e,f);!0;){if(f<=e)return d[j];if(f==e+1)return d[e]>d[f]&&b(d,e,f),d[j];for(g=c(e,f),d[g]>d[f]&&b(d,g,f),d[e]>d[f]&&b(d,e,f),d[g]>d[e]&&b(d,g,e),b(d,g,e+1),h=e+1,i=f;!0;){do h++;while(d[e]>d[h]);do i--;while(d[i]>d[e]);if(i<h)break;b(d,h,i)}b(d,e,i),i<=j&&(e=h),i>=j&&(f=i-1)}}var b=function b(d,e,f){var _ref;return _ref=[d[f],d[e]],d[e]=_ref[0],d[f]=_ref[1],_ref},c=function c(d,e){return~~((d+e)/2)};'undefined'!=typeof module&&module.exports?module.exports=a:window.median=a})();\n","import median from 'median-quickselect';\nimport { Matrix } from 'ml-matrix';\n\nexport function getMedians(X, by) {\n  let medians = [];\n  let rows = X.rows;\n  let columns = X.columns;\n  switch (by) {\n    case 'column':\n      for (let i = 0; i < columns; i++) {\n        medians.push(median(X.getColumn(i)));\n      }\n      medians = Matrix.from1DArray(1, columns, medians);\n      break;\n    default:\n      for (let i = 0; i < rows; i++) {\n        medians.push(median(X.getRow(i)));\n      }\n      medians = Matrix.from1DArray(rows, 1, medians);\n  }\n  return medians;\n}\n","import { Matrix } from 'ml-matrix';\n\nimport { dimMADstd } from '../util/dimMADstd';\n\nexport function updateLambda(data, originalMatrix, options = {}) {\n  let { refinementBeginning, tauMAD } = options;\n  let { iteration, lambda, A, S } = data;\n\n  if (refinementBeginning <= iteration) return lambda;\n\n  let sigmaResidue;\n  if (options.lambdaInf !== undefined) {\n    sigmaResidue = options.lambdaInf / options.tauMAD;\n  } else if (options.addStd !== undefined) {\n    sigmaResidue = options.addStd;\n  } else {\n    let alY = Matrix.sub(originalMatrix, A.mmul(S)).to1DArray();\n    let result = dimMADstd(Matrix.from1DArray(1, alY.length, alY), 'row');\n    sigmaResidue = result.get(0, 0);\n  }\n  let nextLambda = Math.max(\n    tauMAD * sigmaResidue,\n    lambda - 1 / (refinementBeginning - iteration),\n  );\n  return nextLambda;\n}\n","import { Matrix } from 'ml-matrix';\n\nimport { getMedians } from './getMedians';\n\nexport function dimMADstd(X, by) {\n  let medians = getMedians(X, by);\n  let matrix = X.clone();\n  matrix =\n    by === 'column'\n      ? matrix.subRowVector(medians.to1DArray())\n      : matrix.subColumnVector(medians.to1DArray());\n  return Matrix.mul(getMedians(matrix.abs(), by), 1.4826);\n}\n","import { Matrix } from 'ml-matrix';\n\nimport { checkMatrixS } from './stages/checkMatrixS';\nimport { initialize } from './stages/initialize';\nimport { normalize } from './stages/normalize';\nimport { updateLambda } from './stages/updateLambda';\nimport { updateMatrixA } from './stages/updateMatrixA';\nimport { updateMatrixS } from './stages/updateMatrixS';\n\n/**\n * Performing non-negative matrix factorization solving argmin_(A >= 0, S >= 0) 1 / 2 * ||Y - AS||_2^2 + lambda * ||S||_1\n * @param {Matrix||Array<Array>} originalMatrix - Matrix to be separated.\n * @param {Number} rank - The maximum number of linearly independent column/row vectors in the matrix.\n * @param {Object} [options = {}] - Options of ngmca factorization method.\n * @param {Number} [options.maximumIteration = 500] - Maximum number of iterations.\n * @param {Number} [options.maxFBIteration = 80] - Maximum number of iterations of the Forward-Backward subroutine.\n * @param {Object} [options.randGenerator = Math.random] - Random number generator for the subroutine of initialization.\n * @param {Number} [options.maxInitFBIteration = 50] - Maximum number of iterations of the Forward-Backward subroutine at the initialization.\n * @param {Number} [options.toleranceFB = 1e-5] - relative difference tolerance for convergence of the Forward-Backward sub-iterations.\n * @param {Number} [options.toleranceFBInit = 0] - relative difference tolerance for convergence of the Forward-Backward sub-iterations at the initialization.\n * @param {Number} [options.phaseRatio = 0.8] - transition between decreasing thresholding phase and refinement phase in percent of the iterations.\n * @param {Number} [options.tauMAD = 1] - constant coefficient for the final threshold computation.\n * @param {Boolean} [options.useTranspose = false] - if true the originalMatrix is transposed.\n */\n\nexport function nGMCA(originalMatrix, rank, options = {}) {\n  const {\n    maximumIteration = 500,\n    maxFBIteration = 80,\n    maxInitFBIteration = 50,\n    toleranceFBInit = 0,\n    toleranceFB = 0.00001,\n    phaseRatio = 0.8,\n    randGenerator = Math.random,\n    tauMAD = 1,\n    useTranspose = false,\n  } = options;\n\n  let { normConstrained = false } = options;\n  originalMatrix = Matrix.checkMatrix(originalMatrix);\n  if (useTranspose) originalMatrix = originalMatrix.transpose();\n  let refinementBeginning = Math.floor(phaseRatio * maximumIteration);\n\n  let data = initialize(originalMatrix, {\n    rank,\n    randGenerator,\n    maxInitFBIteration,\n    toleranceFBInit,\n    maxFBIteration,\n    toleranceFB,\n  });\n\n  data = normalize(data, { normOnA: true });\n  data.lambda = data.A.transpose()\n    .mmul(data.A.mmul(data.S).sub(originalMatrix))\n    .abs()\n    .max();\n\n  for (let iter = 0; iter < maximumIteration; iter++) {\n    data.iteration = iter;\n    data.S = updateMatrixS(\n      data.A,\n      data.S,\n      originalMatrix,\n      data.lambda,\n      options,\n    );\n    data = checkMatrixS(data, originalMatrix);\n    data = normalize(data, { normOnA: false });\n\n    if (iter > refinementBeginning) normConstrained = true;\n\n    data.A = updateMatrixA(data.A, data.S, originalMatrix, {\n      maxFBIteration,\n      toleranceFB,\n      normConstrained,\n      lambda: 0,\n    });\n\n    data = normalize(data, { normOnA: true });\n\n    data.lambda = updateLambda(data, originalMatrix, {\n      refinementBeginning,\n      tauMAD,\n    });\n  }\n\n  if (useTranspose) {\n    let temp = data.A.transpose();\n    data.A = data.S.transpose();\n    data.S = temp;\n  }\n  return data;\n}\n","import { Matrix, solve } from 'ml-matrix';\n\nimport { zeroInsteadOfNegative } from '../util/zeroInsteadOfNegative';\n\nimport { checkMatrixS } from './checkMatrixS';\nimport { updateMatrixA } from './updateMatrixA';\nimport { updateMatrixS } from './updateMatrixS';\n\nexport function initialize(originalMatrix, options = {}) {\n  const {\n    rank,\n    randGenerator,\n    maxInitFBIteration,\n    toleranceFBInit,\n    maxFBIteration,\n    toleranceFB,\n    normConstrained,\n  } = options;\n\n  let result = {};\n  let rows = originalMatrix.rows;\n\n  result.A = Matrix.rand(rows, rank, { random: randGenerator });\n\n  for (let iter = 0; iter < maxInitFBIteration; iter++) {\n    //select columns with sum positive from A\n    let sumC = result.A.sum('column');\n    for (let i = 0; i < sumC.length; i++) {\n      while (sumC[i] === 0) {\n        sumC[i] = 0;\n        for (let j = 0; j < rows; j++) {\n          result.A.set(j, i, randGenerator());\n          sumC[i] += result.A.get(j, i);\n        }\n      }\n    }\n\n    //resolve the system of equation Lx = D for x, then select just non negative values;\n    result.S = zeroInsteadOfNegative(solve(result.A, originalMatrix));\n\n    //select rows with positive sum by row\n    let sumR = result.S.sum('row');\n    let positiveSumRowIndexS = [];\n    let positiveSumRowS = [];\n    for (let i = 0; i < sumR.length; i++) {\n      if (sumR[i] > 0) {\n        positiveSumRowIndexS.push(i);\n        positiveSumRowS.push(result.S.getRow(i));\n      }\n    }\n\n    positiveSumRowS = Matrix.checkMatrix(positiveSumRowS);\n\n    // solve the system of linear equation xL = D for x. knowing that D/L = (L'\\D')'.\n    let candidateA = zeroInsteadOfNegative(\n      solve(positiveSumRowS.transpose(), originalMatrix.transpose()),\n    );\n\n    //then, set the columns of A with an index equal to the row index with sum > 0 into S\n    //this step complete the last transpose of D/L = (L'\\D')'.\n    for (let i = 0; i < positiveSumRowIndexS.length; i++) {\n      let colCandidate = candidateA.getRow(i);\n      for (let j = 0; j < rows; j++) {\n        result.A.set(j, positiveSumRowIndexS[i], colCandidate[j]);\n      }\n    }\n\n    let prevS = result.S.clone();\n    result.S = updateMatrixS(result.A, result.S, originalMatrix, 0, {\n      maxFBIteration,\n      toleranceFB,\n    });\n\n    result = checkMatrixS(result, originalMatrix);\n\n    result.A = updateMatrixA(result.A, result.S, originalMatrix, 0, {\n      maxFBIteration,\n      toleranceFB,\n      normConstrained,\n    });\n\n    if (\n      Matrix.sub(prevS, result.S).norm() / result.S.norm() <\n      toleranceFBInit\n    ) {\n      break;\n    }\n  }\n  return result;\n}\n","import { Matrix, MatrixTransposeView, EVD, SVD, NIPALS, } from 'ml-matrix';\n/**\n * Creates new PCA (Principal Component Analysis) from the dataset\n * @param {MaybeMatrix} dataset - dataset or covariance matrix.\n * @param {PCAOptions} [options]\n * @param {boolean} [options.isCovarianceMatrix=false] - true if the dataset is a covariance matrix.\n * @param {string} [options.method='SVD'] - select which method to use: SVD (default), covarianceMatrirx or NIPALS.\n * @param {number} [options.nCompNIPALS=2] - number of components to be computed with NIPALS.\n * @param {boolean} [options.center=true] - should the data be centered (subtract the mean).\n * @param {boolean} [options.scale=false] - should the data be scaled (divide by the standard deviation).\n * @param {boolean} [options.ignoreZeroVariance=false] - ignore columns with zero variance if `scale` is `true`.\n * */\nexport class PCA {\n    constructor(dataset, options = {}, model) {\n        /* eslint-disable @typescript-eslint/naming-convention */\n        this.U = null;\n        this.S = null;\n        if (model) {\n            this.center = model.center;\n            this.scale = model.scale;\n            this.means = model.means;\n            this.stdevs = model.stdevs;\n            this.U = Matrix.checkMatrix(model.U);\n            this.S = model.S;\n            this.R = model.R;\n            this.excludedFeatures = model.excludedFeatures || [];\n            return;\n        }\n        let datasetMatrix;\n        if (Array.isArray(dataset)) {\n            datasetMatrix = new Matrix(dataset);\n        }\n        else {\n            datasetMatrix = new Matrix(dataset);\n        }\n        const { isCovarianceMatrix = false, method = 'SVD', nCompNIPALS = 2, center = true, scale = false, ignoreZeroVariance = false, } = options;\n        this.center = center;\n        this.scale = scale;\n        this.means = null;\n        this.stdevs = null;\n        this.excludedFeatures = [];\n        if (isCovarianceMatrix) {\n            // User provided a covariance matrix instead of dataset.\n            this._computeFromCovarianceMatrix(datasetMatrix);\n            return;\n        }\n        this._adjust(datasetMatrix, ignoreZeroVariance);\n        switch (method) {\n            case 'covarianceMatrix': {\n                // User provided a dataset but wants us to compute and use the covariance matrix.\n                const covarianceMatrix = new MatrixTransposeView(datasetMatrix)\n                    .mmul(datasetMatrix)\n                    .div(datasetMatrix.rows - 1);\n                this._computeFromCovarianceMatrix(covarianceMatrix);\n                break;\n            }\n            case 'NIPALS': {\n                this._computeWithNIPALS(datasetMatrix, nCompNIPALS);\n                break;\n            }\n            case 'SVD': {\n                const svd = new SVD(datasetMatrix, {\n                    computeLeftSingularVectors: false,\n                    computeRightSingularVectors: true,\n                    autoTranspose: true,\n                });\n                this.U = svd.rightSingularVectors;\n                const singularValues = svd.diagonal;\n                const eigenvalues = [];\n                for (const singularValue of singularValues) {\n                    eigenvalues.push((singularValue * singularValue) / (datasetMatrix.rows - 1));\n                }\n                this.S = eigenvalues;\n                break;\n            }\n            default: {\n                throw new Error(`unknown method: ${method}`);\n            }\n        }\n    }\n    /**\n     * Load a PCA model from JSON\n     * @param {PCAModel} model\n     * @return {PCA}\n     */\n    static load(model) {\n        if (typeof model.name !== 'string') {\n            throw new TypeError('model must have a name property');\n        }\n        if (model.name !== 'PCA') {\n            throw new RangeError(`invalid model: ${model.name}`);\n        }\n        return new PCA(undefined, undefined, model);\n    }\n    /**\n     * Project the dataset into the PCA space\n     * @param {MaybeMatrix} dataset\n     * @param {PredictOptions} options\n     * @return {Matrix} dataset projected in the PCA space\n     */\n    predict(dataset, options = {}) {\n        const { nComponents = this.U.columns } = options;\n        let datasetmatrix;\n        if (Array.isArray(dataset)) {\n            datasetmatrix = new Matrix(dataset);\n        }\n        else {\n            datasetmatrix = new Matrix(dataset);\n        }\n        if (this.center) {\n            datasetmatrix.subRowVector(this.means);\n            if (this.scale) {\n                for (let i of this.excludedFeatures) {\n                    datasetmatrix.removeColumn(i);\n                }\n                datasetmatrix.divRowVector(this.stdevs);\n            }\n        }\n        let predictions = datasetmatrix.mmul(this.U);\n        return predictions.subMatrix(0, predictions.rows - 1, 0, nComponents - 1);\n    }\n    /**\n     * Calculates the inverse PCA transform\n     * @param {Matrix} dataset\n     * @return {Matrix} dataset projected in the PCA space\n     */\n    invert(dataset) {\n        dataset = Matrix.checkMatrix(dataset);\n        let inverse = dataset.mmul(this.U.transpose());\n        if (this.center) {\n            if (this.scale) {\n                inverse.mulRowVector(this.stdevs);\n            }\n            inverse.addRowVector(this.means);\n        }\n        return inverse;\n    }\n    /**\n     * Returns the proportion of variance for each component\n     * @return {[number]}\n     */\n    getExplainedVariance() {\n        let sum = 0;\n        if (this.S) {\n            for (const s of this.S) {\n                sum += s;\n            }\n        }\n        if (this.S) {\n            return this.S.map((value) => value / sum);\n        }\n        return [];\n    }\n    /**\n     * Returns the cumulative proportion of variance\n     * @return {[number]}\n     */\n    getCumulativeVariance() {\n        let explained = this.getExplainedVariance();\n        for (let i = 1; i < explained.length; i++) {\n            explained[i] += explained[i - 1];\n        }\n        return explained;\n    }\n    /**\n     * Returns the Eigenvectors of the covariance matrix\n     * @returns {Matrix}\n     */\n    getEigenvectors() {\n        return this.U;\n    }\n    /**\n     * Returns the Eigenvalues (on the diagonal)\n     * @returns {[number]}\n     */\n    getEigenvalues() {\n        return this.S;\n    }\n    /**\n     * Returns the standard deviations of the principal components\n     * @returns {[number]}\n     */\n    getStandardDeviations() {\n        return this.S.map((x) => Math.sqrt(x));\n    }\n    /**\n     * Returns the loadings matrix\n     * @return {Matrix}\n     */\n    getLoadings() {\n        return this.U.transpose();\n    }\n    /**\n     * Export the current model to a JSON object\n     * @return {Object} model\n     */\n    toJSON() {\n        return {\n            name: 'PCA',\n            center: this.center,\n            scale: this.scale,\n            means: this.means,\n            stdevs: this.stdevs,\n            U: this.U,\n            S: this.S,\n            excludedFeatures: this.excludedFeatures,\n        };\n    }\n    _adjust(dataset, ignoreZeroVariance) {\n        if (this.center) {\n            const mean = dataset.mean('column');\n            const stdevs = this.scale\n                ? dataset.standardDeviation('column', { mean })\n                : null;\n            this.means = mean;\n            dataset.subRowVector(mean);\n            if (this.scale) {\n                for (let i = 0; i < stdevs.length; i++) {\n                    if (stdevs[i] === 0) {\n                        if (ignoreZeroVariance) {\n                            dataset.removeColumn(i);\n                            stdevs.splice(i, 1);\n                            this.excludedFeatures.push(i);\n                            i--;\n                        }\n                        else {\n                            throw new RangeError(`Cannot scale the dataset (standard deviation is zero at index ${i}`);\n                        }\n                    }\n                }\n                this.stdevs = stdevs;\n                dataset.divRowVector(stdevs);\n            }\n        }\n    }\n    _computeFromCovarianceMatrix(dataset) {\n        const evd = new EVD(dataset, { assumeSymmetric: true });\n        this.U = evd.eigenvectorMatrix;\n        this.U.flipRows();\n        this.S = evd.realEigenvalues;\n        this.S.reverse();\n    }\n    _computeWithNIPALS(dataset, nCompNIPALS) {\n        this.U = new Matrix(nCompNIPALS, dataset.columns);\n        this.S = [];\n        let x = dataset;\n        for (let i = 0; i < nCompNIPALS; i++) {\n            let dc = new NIPALS(x);\n            this.U.setRow(i, dc.w.transpose());\n            this.S.push(Math.pow(dc.s.get(0, 0), 2));\n            x = dc.xResidual;\n        }\n        this.U = this.U.transpose(); // to be compatible with API\n    }\n}\n//# sourceMappingURL=pca.js.map","import { nGMCA } from 'ml-ngmca';\n\nimport { estimateNbPureComponents } from '../util/estimateNbPureComponents';\n\n/**\n * Performing non-negative matrix factorization solving argmin_(A >= 0, S >= 0) 1 / 2 * ||Y - AS||_2^2 + lambda * ||S||_1\n * @param {Chromatogram} chromatogram - GC/MS chromatogram where make the estimation.\n * @param {object} [options = {}] - Options of ngmca factorization method\n * @param {number} [options.rank] - number of pure components, if it's undefined it will be estimated by explained variance of PCA.\n * @param {object} [options.range] - Range with from to.\n * @param {number} [options.range.from] - lower limit in the retention time.\n * @param {number} [options.range.to] - upper limit in the retention time.\n * @param {number} [options.nmfOptions = {}] - options to Non negative factorization (deconvolution method).\n * @param {number} [options.nmfOptions.maximumIteration = 500] - Maximum number of iterations.\n * @param {number} [options.nmfOptions.maxFBIteration = 80] - Maximum number of iterations of the Forward-Backward subroutine.\n * @param {number} [options.nmfOptions.toleranceFB = 1e-5] - relative difference tolerance for convergence of the Forward-Backward sub-iterations.\n * @param {number} [options.nmfOptions.phaseRatio = 0.8] - transition between decreasing thresholding phase and refinement phase in percent of the iterations.\n * @param {boolean} [options.useTranspose = false] - if true the originalMatrix is transposed.\n */\n\nexport function deconvolution(chromatogram, options = {}) {\n  let { range, rank, nmfOptions = {} } = options;\n  let { matrix, mzAxis, times } = chromatogram.getMzVsTimesMatrix(range);\n\n  if (!rank) rank = estimateNbPureComponents(chromatogram, { range, matrix });\n\n  if (rank < 1) {\n    throw new RangeError(\n      `Rank should be a positive number for ${range.from} - ${range.to}`,\n    );\n  }\n\n  let result = nGMCA(matrix, rank, nmfOptions);\n  let maxByRow = [];\n  for (let i = 0; i < result.S.rows; i++) {\n    maxByRow.push(result.S.maxRow(i));\n  }\n\n  result.S.scale('row', { scale: maxByRow });\n  result.A.scale('column', {\n    scale: maxByRow.map((e) => 1 / e),\n  });\n\n  return {\n    matrix,\n    times,\n    mzAxis,\n    rank,\n    profile: result.A,\n    component: result.S,\n  };\n}\n","import { PCA } from 'ml-pca';\n\n/**\n * Estimate the number of pure components of each range by NIPALS PCA\n * @param {Chromatogram} chromatogram - GC/MS chromatogram where make the estimation\n * @param {object} options - options with range and the matrix\n * @param {object} [options.range] - Range of retention times.\n * @param {number} [options.range.from] - lower limit in the retention time.\n * @param {number} [options.range.to] - upper limit in the retention time.\n * @param {Array<Array>} [options.matrix] - matrix to compute the number of pure components, if does not exist it will be computed.\n */\n\nexport function estimateNbPureComponents(chromatogram, options = {}) {\n  let { range, matrix } = options;\n\n  if (!matrix) matrix = chromatogram.getMzVsTimesMatrix(range).matrix;\n\n  let pca = new PCA(matrix, {\n    method: 'NIPALS',\n    nCompNIPALS: 10,\n    scale: true,\n    ignoreZeroVariance: true,\n  });\n  let s = pca.getExplainedVariance();\n  let rank = 1;\n  let cumulative = s[0];\n  while ((cumulative - s[rank]) / cumulative < 0.88 && rank < s.length) {\n    cumulative += s[rank];\n    rank++;\n  }\n  return rank;\n}\n","import {\n  xGetFromToIndex,\n  xyArrayWeightedMerge,\n  xySortX,\n} from 'ml-spectra-processing';\n\nexport function merge(chromatogram, options = {}) {\n  let { mergeThreshold = 0.3, seriesName = 'ms', range = {} } = options;\n\n  const time = chromatogram.getTimes();\n\n  chromatogram.requiresSeries(seriesName);\n  let series = chromatogram.series[seriesName];\n  if (series.dimension !== 2) {\n    throw new Error(`The series \"${seriesName}\" is not of dimension 2`);\n  }\n\n  if (!range || range.from > time.at(-1) || range.to < time[0]) {\n    return { x: [], y: [] };\n  }\n  let { fromIndex, toIndex } = xGetFromToIndex(time, range);\n\n  let data = series.data\n    .slice(fromIndex, toIndex + 1)\n    .map((datum) => xySortX({ x: datum[0], y: datum[1] }));\n\n  return {\n    ...xyArrayWeightedMerge(data, { delta: mergeThreshold }),\n    from: {\n      index: fromIndex,\n      time: time[fromIndex],\n    },\n    to: {\n      index: toIndex,\n      time: time[toIndex],\n    },\n  };\n}\n","import { matrixCuthillMckee } from 'ml-spectra-processing';\n/**\n * Updates the system matrix with new weights and computes the weighted right-hand side vector.\n * @param matrix - The lower triangular non-zeros matrix in triplet format.\n * @param y - The original data vector.\n * @param weights - The weights vector.\n * @returns A tuple of the updated matrix and the weighted right-hand side vector.\n */\nexport function updateSystem(matrix, y, weights) {\n    const nbPoints = y.length;\n    const l = nbPoints - 1;\n    const newMatrix = new Array(matrix.length);\n    const newVector = new Float64Array(nbPoints);\n    for (let i = 0; i < l; i++) {\n        const w = weights[i];\n        const diag = i * 2;\n        const next = diag + 1;\n        newMatrix[diag] = matrix[diag].slice();\n        newMatrix[next] = matrix[next].slice();\n        if (w === 0) {\n            newVector[i] = 0;\n        }\n        else {\n            newVector[i] = y[i] * w;\n            newMatrix[diag][2] += w;\n        }\n    }\n    newVector[l] = y[l] * weights[l];\n    newMatrix[l * 2] = matrix[l * 2].slice();\n    newMatrix[l * 2][2] += weights[l];\n    return [newMatrix, newVector];\n}\n/**\n * Constructs the delta matrix and applies Cuthill-McKee permutation.\n * @param nbPoints - Number of data points.\n * @param lambda - Smoothing parameter.\n * @returns An object containing the lower triangular non-zeros matrix and the permutation array.\n */\nexport function getDeltaMatrix(nbPoints, lambda) {\n    const matrix = [];\n    const last = nbPoints - 1;\n    for (let i = 0; i < last; i++) {\n        matrix.push([i, i, lambda * 2], [i + 1, i, -1 * lambda]);\n    }\n    matrix[0][2] = lambda;\n    matrix.push([last, last, lambda]);\n    return {\n        lowerTriangularNonZeros: matrix,\n        permutationEncodedArray: matrixCuthillMckee(matrix, nbPoints),\n    };\n}\n//# sourceMappingURL=utils.js.map","import { matrixCholeskySolver, xAbsoluteSum, xBinning, xFindClosestIndex, xNoiseSanPlot, xSubtract, xyInterpolateLinear, } from 'ml-spectra-processing';\nimport { getDeltaMatrix, updateSystem } from \"./utils.js\";\n/**\n * Fit the baseline drift by iteratively changing weights of sum square error between the fitted baseline and original signals,\n * for further information about the parameters you can get the {@link https://github.com/zmzhang/airPLS/blob/main/airPLS_manuscript.pdf paper of airPLS}.\n * @param x - X axis data useful when control points or zones are submitted.\n * @param y - Original data.\n * @param options - Options object.\n * @returns An object containing the corrected data, baseline, iteration count, and error.\n */\nexport default function airPLS(x, y, options = {}) {\n    const { xWork, yWork, optionsWork, shouldDownsample } = getDownSampleData(x, y, options);\n    const { weights, controlPoints } = getControlPoints(xWork, yWork, optionsWork);\n    const { maxIterations = 100, lambda = 10, tolerance = 0.001 } = optionsWork;\n    let baseline = [];\n    let iteration;\n    let sumNegDifferences = Number.MAX_SAFE_INTEGER;\n    const corrected = Float64Array.from(yWork);\n    const stopCriterion = getStopCriterion(yWork, tolerance);\n    const { length } = yWork;\n    const { lowerTriangularNonZeros, permutationEncodedArray } = getDeltaMatrix(length, lambda);\n    let threshold = 1;\n    const l = length - 1;\n    let prevNegSum = Number.MAX_SAFE_INTEGER;\n    for (iteration = 0; iteration < maxIterations && Math.abs(sumNegDifferences) > stopCriterion; iteration++) {\n        const [leftHandSide, rightHandSide] = updateSystem(lowerTriangularNonZeros, yWork, weights);\n        const cho = matrixCholeskySolver(leftHandSide, length, permutationEncodedArray);\n        if (cho === null) {\n            throw new Error('Cholesky decomposition failed');\n        }\n        baseline = cho(rightHandSide);\n        sumNegDifferences = applyCorrection(yWork, baseline, corrected);\n        if (iteration === 1) {\n            const { positive } = xNoiseSanPlot(corrected);\n            threshold = positive;\n        }\n        else {\n            const absChange = Math.abs(prevNegSum / sumNegDifferences);\n            if (absChange < 1.01 && absChange > 0.99) {\n                break;\n            }\n        }\n        prevNegSum = sumNegDifferences + 0;\n        for (let i = 1; i < l; i++) {\n            const diff = Math.abs(corrected[i]);\n            if (controlPoints[i] < 1 && diff > threshold * 2) {\n                weights[i] = 0;\n            }\n            else {\n                weights[i] = Math.exp(-((diff / threshold) ** 2));\n            }\n        }\n        weights[0] = 1;\n        weights[l] = 1;\n    }\n    // Interpolate results back to original resolution if downsampling was applied\n    let finalBaseline = baseline;\n    let finalCorrected = corrected;\n    if (shouldDownsample) {\n        finalBaseline = xyInterpolateLinear({ x: xWork, y: baseline }, x);\n        finalCorrected = xSubtract(y, finalBaseline);\n    }\n    return {\n        corrected: finalCorrected,\n        baseline: finalBaseline,\n        iteration,\n        error: sumNegDifferences,\n    };\n}\nfunction applyCorrection(y, baseline, corrected) {\n    let sumNegDifferences = 0;\n    for (let i = 0; i < y.length; i++) {\n        const diff = y[i] - baseline[i];\n        if (diff < 0)\n            sumNegDifferences += diff;\n        corrected[i] = diff;\n    }\n    return sumNegDifferences;\n}\nfunction getDownSampleData(x, y, options = {}) {\n    const { autoDownsample = false, maxResolution = 5000, controlPoints, } = options;\n    const shouldDownsample = autoDownsample && y.length > maxResolution;\n    if (!shouldDownsample) {\n        return { xWork: x, yWork: y, optionsWork: options, shouldDownsample };\n    }\n    const binSize = getDownsampleFactor(y.length, maxResolution);\n    const xWork = xBinning(x, {\n        binSize,\n        keepFirstAndLast: true,\n    });\n    const yWork = xBinning(y, {\n        binSize,\n        keepFirstAndLast: true,\n    });\n    let optionsWork = options;\n    // Downsample controlPoints if provided, to match downsampled x and y\n    if (controlPoints) {\n        const downsampledControlPoints = new Int8Array(xWork.length);\n        for (let i = 0; i < x.length; i++) {\n            if (controlPoints[i] > 0) {\n                const closestIndex = xFindClosestIndex(xWork, x[i]);\n                downsampledControlPoints[closestIndex] = 1;\n            }\n        }\n        optionsWork = {\n            ...options,\n            controlPoints: downsampledControlPoints,\n        };\n    }\n    return { xWork, yWork, optionsWork, shouldDownsample };\n}\nfunction getStopCriterion(y, tolerance) {\n    const sum = xAbsoluteSum(y);\n    return tolerance * sum;\n}\nfunction getControlPoints(x, y, options = {}) {\n    const { length } = x;\n    const { controlPoints = Int8Array.from({ length }).fill(0) } = options;\n    const { zones = [], weights = Float64Array.from({ length }).fill(1) } = options;\n    if (x.length !== y.length) {\n        throw new RangeError('Y should match the length with X');\n    }\n    else if (controlPoints.length !== x.length) {\n        throw new RangeError('controlPoints should match the length with X');\n    }\n    else if (weights.length !== x.length) {\n        throw new RangeError('weights should match the length with X');\n    }\n    for (const range of zones) {\n        let indexFrom = xFindClosestIndex(x, range.from);\n        let indexTo = xFindClosestIndex(x, range.to);\n        if (indexFrom > indexTo)\n            [indexFrom, indexTo] = [indexTo, indexFrom];\n        for (let i = indexFrom; i < indexTo; i++) {\n            controlPoints[i] = 1;\n        }\n    }\n    return {\n        weights,\n        controlPoints,\n    };\n}\n/**\n * Calculate the downsampling factor to reduce data to target resolution.\n * @param originalLength - Original data length.\n * @param targetResolution - Target number of points.\n * @returns Downsampling factor.\n */\nfunction getDownsampleFactor(originalLength, targetResolution) {\n    return Math.max(1, Math.ceil(originalLength / targetResolution));\n}\n//# sourceMappingURL=index.js.map","import { isAnyArray } from 'is-any-array';\n/**\n * Apply Savitzky Golay algorithm\n * @param [ys] Array of y values\n * @param [xs] Array of X or deltaX\n * @return  Array containing the new ys (same length)\n */\nexport function sgg(ys, xs, options = {}) {\n    const { windowSize = 9, derivative = 0, polynomial = 3 } = options;\n    if (windowSize % 2 === 0 || windowSize < 5 || !Number.isInteger(windowSize)) {\n        throw new RangeError('Invalid window size (should be odd and at least 5 integer number)');\n    }\n    if (!isAnyArray(ys)) {\n        throw new TypeError('Y values must be an array');\n    }\n    if (typeof xs === 'undefined') {\n        throw new TypeError('X must be defined');\n    }\n    if (windowSize > ys.length) {\n        throw new RangeError(`Window size is higher than the data length ${windowSize}>${ys.length}`);\n    }\n    if (derivative < 0 || !Number.isInteger(derivative)) {\n        throw new RangeError('Derivative should be a positive integer');\n    }\n    if (polynomial < 1 || !Number.isInteger(polynomial)) {\n        throw new RangeError('Polynomial should be a positive integer');\n    }\n    if (polynomial >= 6) {\n        // eslint-disable-next-line no-console\n        console.warn('You should not use polynomial grade higher than 5 if you are' +\n            ' not sure that your data arises from such a model. Possible polynomial oscillation problems');\n    }\n    const half = Math.floor(windowSize / 2);\n    const np = ys.length;\n    const ans = new Float64Array(np);\n    const weights = fullWeights(windowSize, polynomial, derivative);\n    let hs = 0;\n    let constantH = true;\n    if (isAnyArray(xs)) {\n        constantH = false;\n    }\n    else {\n        hs = xs ** derivative;\n    }\n    //For the borders\n    for (let i = 0; i < half; i++) {\n        const wg1 = weights[half - i - 1];\n        const wg2 = weights[half + i + 1];\n        let d1 = 0;\n        let d2 = 0;\n        for (let l = 0; l < windowSize; l++) {\n            d1 += wg1[l] * ys[l];\n            d2 += wg2[l] * ys[np - windowSize + l];\n        }\n        if (constantH) {\n            ans[half - i - 1] = d1 / hs;\n            ans[np - half + i] = d2 / hs;\n        }\n        else {\n            hs = getHs(xs, half - i - 1, half, derivative);\n            ans[half - i - 1] = d1 / hs;\n            hs = getHs(xs, np - half + i, half, derivative);\n            ans[np - half + i] = d2 / hs;\n        }\n    }\n    //For the internal points\n    const wg = weights[half];\n    for (let i = windowSize; i <= np; i++) {\n        let d = 0;\n        for (let l = 0; l < windowSize; l++)\n            d += wg[l] * ys[l + i - windowSize];\n        if (!constantH) {\n            hs = getHs(xs, i - half - 1, half, derivative);\n        }\n        ans[i - half - 1] = d / hs;\n    }\n    return ans;\n}\nfunction getHs(h, center, half, derivative) {\n    let hs = 0;\n    let count = 0;\n    for (let i = center - half; i < center + half; i++) {\n        if (i >= 0 && i < h.length - 1) {\n            hs += h[i + 1] - h[i];\n            count++;\n        }\n    }\n    return (hs / count) ** derivative;\n}\nfunction gramPoly(i, m, k, s) {\n    let Grampoly = 0;\n    if (k > 0) {\n        Grampoly =\n            ((4 * k - 2) / (k * (2 * m - k + 1))) *\n                (i * gramPoly(i, m, k - 1, s) + s * gramPoly(i, m, k - 1, s - 1)) -\n                (((k - 1) * (2 * m + k)) / (k * (2 * m - k + 1))) *\n                    gramPoly(i, m, k - 2, s);\n    }\n    else if (k === 0 && s === 0) {\n        Grampoly = 1;\n    }\n    else {\n        Grampoly = 0;\n    }\n    return Grampoly;\n}\nfunction genFact(a, b) {\n    let gf = 1;\n    if (a >= b) {\n        for (let j = a - b + 1; j <= a; j++) {\n            gf *= j;\n        }\n    }\n    return gf;\n}\nfunction weight(i, t, m, n, s) {\n    let sum = 0;\n    for (let k = 0; k <= n; k++) {\n        sum +=\n            (2 * k + 1) *\n                (genFact(2 * m, k) / genFact(2 * m + k + 1, k + 1)) *\n                gramPoly(i, m, k, 0) *\n                gramPoly(t, m, k, s);\n    }\n    return sum;\n}\n/**\n * @private\n * @param m  Number of points\n * @param n  Polynomial grade\n * @param s  Derivative\n */\nfunction fullWeights(m, n, s) {\n    const weights = new Array(m);\n    const np = Math.floor(m / 2);\n    for (let t = -np; t <= np; t++) {\n        weights[t + np] = new Float64Array(m);\n        for (let j = -np; j <= np; j++) {\n            weights[t + np][j + np] = weight(j, t, np, n, s);\n        }\n    }\n    return weights;\n}\n//# sourceMappingURL=index.js.map","export function getMinMaxIntervalsDy(y, x, dY, dX) {\n    let lastMax = null;\n    let lastMin = null;\n    const intervalL = [];\n    const intervalR = [];\n    for (let i = 1; i < y.length - 1; ++i) {\n        if ((dY[i] < dY[i - 1] && dY[i] <= dY[i + 1]) ||\n            (dY[i] <= dY[i - 1] && dY[i] < dY[i + 1])) {\n            lastMin = {\n                x: x[i],\n                index: i,\n            };\n            if (dX > 0 && lastMax !== null) {\n                intervalL.push(lastMax);\n                intervalR.push(lastMin);\n            }\n        }\n        // Maximum in first derivative\n        if ((dY[i] >= dY[i - 1] && dY[i] > dY[i + 1]) ||\n            (dY[i] > dY[i - 1] && dY[i] >= dY[i + 1])) {\n            lastMax = {\n                x: x[i],\n                index: i,\n            };\n            if (dX < 0 && lastMin !== null) {\n                intervalL.push(lastMax);\n                intervalR.push(lastMin);\n            }\n        }\n    }\n    return { intervalL, intervalR };\n}\n//# sourceMappingURL=getMinMaxIntervals.js.map","export function tryMatchOneIntervalWithMinData(options) {\n    const { x, lastK, minData, yThreshold, intervalWidth, intervalCenter, yData, } = options;\n    let minDistance = Number.POSITIVE_INFINITY;\n    let possible = -1;\n    let newLastIndex = lastK;\n    for (let k = newLastIndex + 1; k < minData.length; k++) {\n        const centerIndex = minData[k];\n        if (yData[centerIndex] <= yThreshold) {\n            continue;\n        }\n        const deltaX = x[centerIndex];\n        const currentDistance = Math.abs(deltaX - intervalCenter);\n        if (currentDistance < intervalWidth) {\n            if (currentDistance < minDistance) {\n                possible = k;\n            }\n            newLastIndex = k;\n        }\n        if (currentDistance >= minDistance)\n            break;\n        minDistance = currentDistance;\n    }\n    return { lastIndex: newLastIndex, possible };\n}\n//# sourceMappingURL=tryMatchOneIntervalWithMinData.js.map","import { tryMatchOneIntervalWithMinData } from \"./tryMatchOneIntervalWithMinData.js\";\nexport function getPeakFromIntervals(options) {\n    let lastK = -1;\n    const peaks = [];\n    const { x, ddY, yData, yThreshold, intervalR, intervalL, minData } = options;\n    for (let i = 0; i < intervalL.length; i++) {\n        const intervalWidth = (intervalR[i].x - intervalL[i].x) / 2;\n        const intervalCenter = (intervalR[i].x + intervalL[i].x) / 2;\n        const { possible = -1, lastIndex } = tryMatchOneIntervalWithMinData({\n            x,\n            lastK,\n            minData,\n            yThreshold,\n            intervalWidth,\n            intervalCenter,\n            yData,\n        });\n        if (possible !== -1) {\n            const centerIndex = minData[possible];\n            const width = Math.abs(intervalR[i].x - intervalL[i].x);\n            peaks.push({\n                id: crypto.randomUUID(),\n                x: x[centerIndex],\n                y: yData[centerIndex],\n                width,\n                index: centerIndex,\n                ddY: ddY[centerIndex],\n                inflectionPoints: {\n                    from: intervalL[i],\n                    to: intervalR[i],\n                },\n            });\n        }\n        lastK = lastIndex;\n    }\n    return peaks;\n}\n//# sourceMappingURL=getPeaksFromIntervals.js.map","/**\n * Finds the indices where the first derivative crosses zero (sign change),\n * which are potential peak positions. This function does not detect zero-crossings\n * in regions with consecutive zero values in the derivative (flat regions).\n *\n * @param input - Object containing the y values and their first derivative (dY).\n * @returns Array of indices where the first derivative crosses zero (excluding consecutive zeros).\n */\nexport function xGetCrossZeroPoints(input) {\n    const { y, dY } = input;\n    const crossDy = [];\n    for (let i = 1; i < y.length - 1; ++i) {\n        if (isLessAndGreaterThanZero(dY[i], dY[i + 1])) {\n            // push the index of the element closer to zero\n            crossDy.push(Math.abs(dY[i]) < Math.abs(dY[i + 1]) ? i : i + 1);\n        }\n        else if (\n        // Handle exact zero\n        dY[i] === 0 &&\n            isLessAndGreaterThanZero(dY[i - 1], dY[i + 1])) {\n            crossDy.push(i);\n        }\n    }\n    return crossDy;\n}\nfunction isLessAndGreaterThanZero(back, next) {\n    return (back < 0 && next > 0) || (back > 0 && next < 0);\n}\n//# sourceMappingURL=xGetCrossZeroPoints.js.map","import { getMinMaxIntervalsDy } from \"./getMinMaxIntervals.js\";\nimport { getPeakFromIntervals } from \"./getPeaksFromIntervals.js\";\nimport { xGetCrossZeroPoints } from \"./xGetCrossZeroPoints.js\";\nexport function firstDerivative(input) {\n    const { y, x, dY, dX, yData, yThreshold, ddY } = input;\n    const crossDy = xGetCrossZeroPoints(input);\n    const { intervalL, intervalR } = getMinMaxIntervalsDy(y, x, dY, dX);\n    return getPeakFromIntervals({\n        minData: crossDy,\n        intervalL,\n        intervalR,\n        x,\n        yData,\n        yThreshold,\n        ddY,\n    });\n}\n//# sourceMappingURL=firstDerivative.js.map","import { sgg } from 'ml-savitzky-golay-generalized';\nimport { xIsEquallySpaced, xIsMonotonic, xMinMaxValues, xNoiseStandardDeviation, } from 'ml-spectra-processing';\nimport { autoAlgorithm } from \"./algorithms/autoAlgorithm.js\";\nimport { firstDerivative } from \"./algorithms/firstDerivative.js\";\nimport { secondDerivative } from \"./algorithms/secondDerivative.js\";\nimport { optimizeTop } from \"./utils/optimizeTop.js\";\n/**\n * Global spectra deconvolution\n * @param  data - Object data with x and y arrays. Values in x has to be growing\n * @param options\n * @param {number} [options.broadRatio = 0.00] - If `broadRatio` is higher than 0, then all the peaks which second derivative\n * smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.\n */\nexport function gsd(data, options = {}) {\n    let { noiseLevel } = options;\n    const { sgOptions = {\n        windowSize: 9,\n        polynomial: 3,\n    }, smoothY = false, maxCriteria = true, minMaxRatio = 0.00025, realTopDetection = false, peakDetectionAlgorithm = 'second', } = options;\n    const { x } = data;\n    let { y } = data;\n    if (xIsMonotonic(x) !== 1) {\n        throw new Error('GSD only accepts monotone increasing x values');\n    }\n    //rescale;\n    y = y.slice();\n    // If the max difference between delta x is less than 5%, then,\n    // we can assume it to be equally spaced variable\n    const isEquallySpaced = xIsEquallySpaced(x);\n    if (noiseLevel === undefined) {\n        if (isEquallySpaced) {\n            const noiseInfo = xNoiseStandardDeviation(y);\n            if (maxCriteria) {\n                noiseLevel = noiseInfo.median + 1.5 * noiseInfo.sd;\n            }\n            else {\n                noiseLevel = -noiseInfo.median + 1.5 * noiseInfo.sd;\n            }\n        }\n        else {\n            noiseLevel = 0;\n        }\n    }\n    else if (!maxCriteria) {\n        noiseLevel *= -1;\n    }\n    if (!maxCriteria) {\n        for (let i = 0; i < y.length; i++) {\n            y[i] *= -1;\n        }\n    }\n    if (noiseLevel !== undefined) {\n        for (let i = 0; i < y.length; i++) {\n            if (y[i] < noiseLevel) {\n                y[i] = noiseLevel;\n            }\n        }\n    }\n    const xValue = isEquallySpaced ? x[1] - x[0] : x;\n    const yData = smoothY\n        ? sgg(y, xValue, {\n            ...sgOptions,\n            derivative: 0,\n        })\n        : y;\n    const { min: minY, max: maxY } = xMinMaxValues(yData);\n    if (minY > maxY || minY === maxY)\n        return [];\n    const dY = sgg(y, xValue, {\n        ...sgOptions,\n        derivative: 1,\n    });\n    const ddY = sgg(y, xValue, {\n        ...sgOptions,\n        derivative: 2,\n    });\n    const yThreshold = Math.max(noiseLevel, minY + (maxY - minY) * minMaxRatio);\n    const dX = x[1] - x[0];\n    const peakData = { x, y, yData, dY, ddY, dX, yThreshold };\n    let peaks = [];\n    if (peakDetectionAlgorithm === 'first') {\n        peaks = firstDerivative(peakData);\n    }\n    else if (peakDetectionAlgorithm === 'second') {\n        peaks = secondDerivative(peakData);\n    }\n    else {\n        peaks = autoAlgorithm(peakData);\n    }\n    if (realTopDetection) {\n        optimizeTop({ x, y: yData }, peaks);\n    }\n    peaks.forEach((peak) => {\n        if (!maxCriteria) {\n            peak.y *= -1;\n            peak.ddY = peak.ddY * -1;\n        }\n    });\n    peaks.sort((a, b) => {\n        return a.x - b.x;\n    });\n    return peaks;\n}\n//# sourceMappingURL=gsd.js.map","import { getMinMaxIntervalsDy } from \"./getMinMaxIntervals.js\";\nimport { getPeakFromIntervals } from \"./getPeaksFromIntervals.js\";\nexport function secondDerivative(input) {\n    const { x, y, yData, dY, ddY, dX, yThreshold } = input;\n    const minddY = [];\n    const { intervalL, intervalR } = getMinMaxIntervalsDy(y, x, dY, dX);\n    // By the intermediate value theorem We cannot find 2 consecutive maximum or minimum\n    for (let i = 1; i < y.length - 1; ++i) {\n        // Minimum in second derivative\n        if (ddY[i] < ddY[i - 1] && ddY[i] < ddY[i + 1]) {\n            minddY.push(i);\n        }\n    }\n    return getPeakFromIntervals({\n        minData: minddY,\n        intervalL,\n        intervalR,\n        x,\n        yData,\n        yThreshold,\n        ddY,\n    });\n}\n//# sourceMappingURL=secondDerivative.js.map","import { getMinMaxIntervalsDy } from \"./getMinMaxIntervals.js\";\nimport { tryMatchOneIntervalWithMinData } from \"./tryMatchOneIntervalWithMinData.js\";\nexport function autoAlgorithm(input) {\n    const { x, y, yData, dY, ddY, dX, yThreshold } = input;\n    const minddY = [];\n    const crossDy = [];\n    const { intervalL, intervalR } = getMinMaxIntervalsDy(y, x, dY, dX);\n    for (let i = 1; i < y.length - 1; ++i) {\n        if ((dY[i] < 0 && dY[i + 1] > 0) || (dY[i] > 0 && dY[i + 1] < 0)) {\n            // push the index of the element closer to zero\n            crossDy.push(Math.abs(dY[i]) < Math.abs(dY[i + 1]) ? i : i + 1);\n        }\n        // Handle exact zero\n        if (dY[i] === 0 &&\n            dY[i] < Math.abs(dY[i + 1]) &&\n            dY[i] < Math.abs(dY[i - 1])) {\n            crossDy.push(i);\n        }\n        // Minimum in second derivative\n        if (ddY[i] < ddY[i - 1] && ddY[i] < ddY[i + 1]) {\n            minddY.push(i);\n        }\n    }\n    const peaks = [];\n    let [lastK, lastJ] = [-1, -1];\n    for (let i = 0; i < intervalL.length; i++) {\n        const intervalWidth = (intervalR[i].x - intervalL[i].x) / 2;\n        const intervalCenter = (intervalR[i].x + intervalL[i].x) / 2;\n        let yIndex = -1;\n        let match = tryMatchOneIntervalWithMinData({\n            x,\n            yData,\n            lastK,\n            yThreshold,\n            intervalWidth,\n            intervalCenter,\n            minData: crossDy,\n        });\n        lastK = match.lastIndex;\n        if (match.possible !== -1) {\n            yIndex = crossDy[match.possible];\n        }\n        else {\n            match = tryMatchOneIntervalWithMinData({\n                x,\n                yData,\n                yThreshold,\n                lastK: lastJ,\n                intervalWidth,\n                intervalCenter,\n                minData: minddY,\n            });\n            if (match.possible !== -1) {\n                yIndex = minddY[match.possible];\n            }\n            lastJ = match.lastIndex;\n        }\n        if (yIndex !== -1) {\n            const width = Math.abs(intervalR[i].x - intervalL[i].x);\n            peaks.push({\n                id: crypto.randomUUID(),\n                x: x[yIndex],\n                y: y[yIndex],\n                width,\n                index: yIndex,\n                ddY: ddY[yIndex],\n                inflectionPoints: {\n                    from: intervalL[i],\n                    to: intervalR[i],\n                },\n            });\n        }\n    }\n    return peaks;\n}\n//# sourceMappingURL=autoAlgorithm.js.map","/**\n * Correction of the x and y coordinates using a quadratic optimizations with the peak and its 3 closest neighbors to determine the true x,y values of the peak.\n * This process is done in place and is very fast.\n * @param data\n * @param peaks\n */\nexport function optimizeTop(data, peaks) {\n    const { x, y } = data;\n    for (const peak of peaks) {\n        let currentIndex = peak.index;\n        // The detected peak could be moved 1 or 2 units to left or right.\n        if (y[currentIndex - 1] >= y[currentIndex - 2] &&\n            y[currentIndex - 1] >= y[currentIndex]) {\n            currentIndex--;\n        }\n        else if (y[currentIndex + 1] >= y[currentIndex] &&\n            y[currentIndex + 1] >= y[currentIndex + 2]) {\n            currentIndex++;\n        }\n        else if (y[currentIndex - 2] >= y[currentIndex - 3] &&\n            y[currentIndex - 2] >= y[currentIndex - 1]) {\n            currentIndex -= 2;\n        }\n        else if (y[currentIndex + 2] >= y[currentIndex + 1] &&\n            y[currentIndex + 2] >= y[currentIndex + 3]) {\n            currentIndex += 2;\n        }\n        // interpolation to a sin() function\n        if (y[currentIndex - 1] > 0 &&\n            y[currentIndex + 1] > 0 &&\n            y[currentIndex] >= y[currentIndex - 1] &&\n            y[currentIndex] >= y[currentIndex + 1] &&\n            (y[currentIndex] !== y[currentIndex - 1] ||\n                y[currentIndex] !== y[currentIndex + 1])) {\n            const alpha = 20 * Math.log10(y[currentIndex - 1]);\n            const beta = 20 * Math.log10(y[currentIndex]);\n            const gamma = 20 * Math.log10(y[currentIndex + 1]);\n            const p = (0.5 * (alpha - gamma)) / (alpha - 2 * beta + gamma);\n            const xCurrent = x[currentIndex];\n            const xPrevious = x[currentIndex - 1];\n            peak.x = xCurrent + (xCurrent - xPrevious) * p;\n            peak.y =\n                y[currentIndex] -\n                    0.25 * (y[currentIndex - 1] - y[currentIndex + 1]) * p;\n        }\n    }\n}\n//# sourceMappingURL=optimizeTop.js.map","import airpls from 'ml-airpls';\nimport { broadenPeaks, gsd } from 'ml-gsd';\nimport { xMedianAbsoluteDeviation } from 'ml-spectra-processing';\n\n/**\n * Returns the result of a peak picking in the chromatogram\n *\n * Make a peak picking on a chromatogram is not obvious because the baseline is often not close to 0\n * and it is therefore difficult to filter by height.\n * We will therefore consider as height of a peak 2 times the height between the top and the middle\n * of the inflection points.\n *\n * In order to calculate the noise the same problem occurs, baseline is not horizontal.\n * We therefore calculate the median absolute deviation after baseline correction using airpls.\n * This noise will be used to filter the peak based on the 'heightFilter'.\n * @param {*} chromatogram\n * @param {object} [options={}]\n * @param {number} [options.heightFilter=5] - Peak height should be this factor times the noise (Median Absolute Deviation)\n * @param {string} [options.seriesName='tic']\n * @param {object} [options.broadenPeaksOptions='tic']\n * @returns\n */\n\nexport function getPeaks(chromatogram, options = {}) {\n  const {\n    heightFilter = 5,\n    seriesName = 'tic',\n    broadenPeaksOptions = { factor: 1, overlap: false },\n  } = options;\n\n  const series = chromatogram.getSeries(seriesName).data;\n  const times = chromatogram.getTimes();\n  const dataXY = { x: times, y: series };\n  // first peak selection\n  let peakList = gsd(dataXY, {\n    noiseLevel: 0,\n    realTopDetection: false,\n    smoothY: true,\n    sgOptions: { windowSize: 5, polynomial: 2 },\n  });\n\n  const noiseHeight =\n    xMedianAbsoluteDeviation(airpls(dataXY.x, dataXY.y).corrected).mad *\n    heightFilter;\n\n  peakList = peakList.filter(\n    (peak) =>\n      (peak.y -\n        (dataXY.y[peak.inflectionPoints.from.index] +\n          dataXY.y[peak.inflectionPoints.to.index]) /\n          2) *\n        2 >\n      noiseHeight,\n  );\n\n  peakList.sort((a, b) => a.x - b.x);\n\n  const broadenPeaksList = broadenPeaks(peakList, broadenPeaksOptions);\n\n  return broadenPeaksList.map((peak) => ({\n    from: peak.from.x,\n    to: peak.to.x,\n    width: peak.width,\n    retentionTime: peak.x,\n    intensity: peak.y,\n  }));\n}\n","import { getShape1D } from 'ml-peak-shape-generator';\n/**\n * This method will allow to enlarge peaks while preventing overlap between peaks\n * A typical application in chromatography peak picking.\n * We should not make the hypothesis that x is equidistant\n * Because peaks may not be symmetric after we add 2 properties, from and to.\n * @return {Array} peakList\n */\nexport function broadenPeaks(peakList, options = {}) {\n    const { factor = 2, overlap = false } = options;\n    const peaks = mapPeaks(peakList, factor);\n    if (!overlap) {\n        for (let i = 0; i < peaks.length - 1; i++) {\n            const peak = peaks[i];\n            const nextPeak = peaks[i + 1];\n            if (peak.to.x > nextPeak.from.x) {\n                // we do it proportional to the width of the peaks\n                peak.to.x =\n                    (peak.width / (nextPeak.width + peak.width)) * (nextPeak.x - peak.x) +\n                        peak.x;\n                nextPeak.from.x = peak.to.x;\n            }\n        }\n    }\n    for (const peak of peaks) {\n        peak.width = peak.to.x - peak.from.x;\n        if (peak.shape) {\n            const { shape, width } = peak;\n            if (shape.fwhm !== undefined) {\n                const shapeFct = getShape1D(shape);\n                peak.shape.fwhm = shapeFct.widthToFWHM(width);\n            }\n        }\n    }\n    return peaks;\n}\nfunction mapPeaks(peaks, factor) {\n    return peaks.map((peak) => {\n        const { id, shape } = peak;\n        const xFrom = peak.x - (peak.x - peak.inflectionPoints.from.x) * factor;\n        const xTo = peak.x + (peak.inflectionPoints.to.x - peak.x) * factor;\n        let result = {\n            x: peak.x,\n            y: peak.y,\n            index: peak.index,\n            width: xTo - xFrom,\n            from: { x: xFrom },\n            to: { x: xTo },\n        };\n        if (id) {\n            result = { ...result, id };\n        }\n        if (shape) {\n            result = { ...result, shape };\n        }\n        return result;\n    });\n}\n//# sourceMappingURL=broadenPeaks.js.map","import { xGetFromToIndex, xyIntegration } from 'ml-spectra-processing';\n\nimport { baselineCorrection } from './baselineCorrection';\n\nexport function integrate(chromatogram, ranges, options = {}) {\n  const { baseline, seriesName = 'tic' } = options;\n\n  if (!Array.isArray(ranges)) {\n    throw new Error('Ranges must be an array of type [{from,to}]');\n  }\n  if (ranges.length === 0) {\n    return [];\n  }\n\n  chromatogram.requiresSeries(seriesName);\n  let series = chromatogram.series[seriesName];\n  if (series.dimension !== 1) {\n    throw new Error(`The series \"${seriesName}\" is not of dimension 1`);\n  }\n\n  const time = chromatogram.getTimes();\n  let results = [];\n\n  for (let range of ranges) {\n    const fromTo = xGetFromToIndex(time, range);\n    const integral = integrateRange(\n      { x: time, y: series.data },\n      fromTo,\n      baseline,\n    );\n    results.push(integral);\n  }\n\n  return results;\n}\n\nfunction integrateRange(points, fromTo, baseline) {\n  let integration = xyIntegration(points, fromTo);\n\n  if (baseline) {\n    let correction = baselineCorrection(points, fromTo, baseline);\n    return {\n      integration: integration - correction.value,\n      from: {\n        time: points.x[fromTo.fromIndex],\n        index: fromTo.fromIndex,\n        baseline: correction.from,\n      },\n      to: {\n        time: points.x[fromTo.toIndex],\n        index: fromTo.toIndex,\n        baseline: correction.to,\n      },\n    };\n  } else {\n    return {\n      integration,\n      from: {\n        time: points.x[fromTo.fromIndex],\n        index: fromTo.fromIndex,\n        baseline: 0,\n      },\n      to: {\n        time: points.x[fromTo.toIndex],\n        index: fromTo.toIndex,\n        baseline: 0,\n      },\n    };\n  }\n}\n","export function baselineCorrection(points, fromTo, kind) {\n  const deltaTime = points.x[fromTo.toIndex] - points.x[fromTo.fromIndex];\n  const fromHeight = points.y[fromTo.fromIndex];\n  const toHeight = points.y[fromTo.toIndex];\n  let baseline = 0;\n  let from = 0;\n  let to = 0;\n  switch (kind) {\n    case 'trapezoid':\n      baseline = (deltaTime * (fromHeight + toHeight)) / 2;\n      from = fromHeight;\n      to = toHeight;\n      break;\n    case 'min':\n      from = Math.min(fromHeight, toHeight);\n      to = from;\n      baseline = deltaTime * from;\n      break;\n    default:\n      throw new Error(`Unknown baseline method \"${kind}\"`);\n  }\n  return {\n    value: baseline,\n    from,\n    to,\n  };\n}\n","import { isAnyArray } from 'is-any-array';\nimport { xFindClosestIndex } from 'ml-spectra-processing';\n\nimport { meanFilter } from './filter/meanFilter';\nimport { percentageFilter } from './filter/percentageFilter';\nimport { applyLockMass } from './ms/applyLockMass';\nimport { calculateBpc } from './ms/calculateBpc';\nimport { calculateEic } from './ms/calculateEic';\nimport { calculateForMF } from './ms/calculateForMF';\nimport { calculateLength } from './ms/calculateLength';\nimport { calculateTic } from './ms/calculateTic';\nimport { deconvolution } from './ms/deconvolution';\nimport { merge } from './ms/merge';\nimport { getPeaks } from './peaks/getPeaks';\nimport { seriesFromArray } from './seriesFromArray';\nimport { filter } from './util/filter';\nimport { getClosestData } from './util/getClosestData';\nimport { getMzVsTimesMatrix } from './util/getMzVsTimesMatrix';\nimport { integrate } from './util/integrate';\n\nexport class Chromatogram {\n  constructor(times, series, options = {}) {\n    this.meta = options.meta || {};\n    this.series = {};\n    this.times = [];\n    if (!isAnyArray(times)) {\n      throw new TypeError('times must be an array');\n    }\n    this.times = times;\n    if (series) {\n      for (const [name, value] of Object.entries(series)) {\n        this.addSeries(name, value);\n      }\n    }\n  }\n\n  get length() {\n    return this.times.length;\n  }\n\n  getSeries(seriesName) {\n    this.requiresSeries(seriesName);\n    return this.series[seriesName];\n  }\n\n  getSeries1D(seriesName) {\n    const series = this.getSeries(seriesName);\n    if (!series.is1D()) {\n      throw new Error(`series ${seriesName} is not a 1D series`);\n    }\n    return series;\n  }\n\n  getSeries2D(seriesName) {\n    const series = this.getSeries(seriesName);\n    if (!series.is2D()) {\n      throw new Error(`series ${seriesName} is not a 2D series`);\n    }\n    return series;\n  }\n\n  getSeriesNames() {\n    return Object.keys(this.series);\n  }\n\n  hasMass() {\n    return this.hasSeries('ms');\n  }\n\n  deleteSeries(seriesName) {\n    this.requiresSeries(seriesName);\n    delete this.series[seriesName];\n    return this;\n  }\n\n  addSeries(seriesName, array, options = {}) {\n    if (this.hasSeries(seriesName) && !options.force) {\n      throw new Error(`A series with name \"${seriesName}\" already exists`);\n    }\n    if (this.times.length !== array.length) {\n      throw new Error(`The series size is not the same as the times size`);\n    }\n    this.series[seriesName] = seriesFromArray(array);\n    this.series[seriesName].name = seriesName;\n    return this;\n  }\n\n  hasSeries(seriesName) {\n    return this.series[seriesName] !== undefined;\n  }\n\n  requiresSeries(seriesName) {\n    if (!this.hasSeries(seriesName)) {\n      throw new Error(`The series \"${seriesName}\" does not exist`);\n    }\n  }\n\n  get firstTime() {\n    return this.times[0];\n  }\n\n  get lastTime() {\n    return this.times[this.length - 1];\n  }\n\n  getTimes() {\n    return this.times;\n  }\n\n  setTimes(times) {\n    if (times.length !== this.times.length) {\n      throw new Error('New times must have the same length as the old ones');\n    }\n    this.times = times;\n  }\n\n  rescaleTime(conversionFunction) {\n    this.times = this.times.map((time) => conversionFunction(time));\n    return this;\n  }\n\n  filter(callback, options) {\n    return filter(this, callback, options);\n  }\n\n  getPeaks(options) {\n    return getPeaks(this, options);\n  }\n\n  calculateTic(options = {}) {\n    if (!this.hasSeries('tic') || options.force) {\n      const tic = calculateTic(this);\n      this.addSeries('tic', tic, { force: true });\n    }\n\n    return this;\n  }\n\n  calculateLength(seriesName, options = {}) {\n    if (!this.hasSeries('length') || options.force) {\n      const length = calculateLength(this, seriesName);\n      this.addSeries('length', length, { force: true });\n    }\n    return this;\n  }\n\n  calculateBpc(options = {}) {\n    if (!this.hasSeries('bpc') || options.force) {\n      const bpc = calculateBpc(this);\n      this.addSeries('bpc', bpc, { force: true });\n    }\n    return this;\n  }\n\n  calculateEic(targetMass, options = {}) {\n    const {\n      seriesName = `ms${targetMass}±${options.slotWidth / 2 || 0.5}`,\n      cache = false,\n    } = options;\n    if (cache && this.hasSeries(seriesName)) return this.getSeries(seriesName);\n    const result = calculateEic(this, targetMass, options);\n    this.addSeries(seriesName, result, options);\n    return this.getSeries(seriesName);\n  }\n\n  async calculateForMF(targetMF, options = {}) {\n    const {\n      seriesName = `${targetMF}(${options.ionizations || 'H+'})±${\n        options.slotWidth / 2 || 0.5\n      }${options.threshold ? `(${options.threshold})` : ''}`,\n      cache = false,\n    } = options;\n    if (cache && this.hasSeries(seriesName)) return this.getSeries(seriesName);\n    const result = await calculateForMF(this, targetMF, options);\n    this.addSeries(seriesName, result, options);\n    return this.getSeries(seriesName);\n  }\n\n  integrate(ranges, options) {\n    return integrate(this, ranges, options);\n  }\n\n  merge(options) {\n    return merge(this, options);\n  }\n\n  getClosestTime(time) {\n    return xFindClosestIndex(this.getTimes(), time);\n  }\n\n  getClosestData(time, options = {}) {\n    return getClosestData(this, time, options);\n  }\n\n  copy() {\n    const json = structuredClone(this);\n    return fromJSON(json);\n  }\n\n  meanFilter(seriesName, options = {}) {\n    const { seriesName: newSeriesName = 'msMean' } = options;\n    if (this.hasSeries(newSeriesName) && !options.force) {\n      throw new Error(`A series with name \"${seriesName}\" already exists`);\n    }\n    const newSeries = meanFilter(this, seriesName, options);\n    this.series[newSeriesName] = newSeries;\n    return newSeries;\n  }\n\n  percentageFilter(seriesName, options = {}) {\n    const { seriesName: newSeriesName = 'msPercentage' } = options;\n    if (this.hasSeries(newSeriesName) && !options.force) {\n      throw new Error(`A series with name \"${seriesName}\" already exists`);\n    }\n    const newSeries = percentageFilter(this, seriesName, options);\n    this.series[newSeriesName] = newSeries;\n    return newSeries;\n  }\n\n  applyLockMass(mfs, options) {\n    return applyLockMass(this, mfs, options);\n  }\n\n  getMzVsTimesMatrix(range = {}) {\n    return getMzVsTimesMatrix(this, range);\n  }\n\n  deconvolution(options = {}) {\n    return deconvolution(this, options);\n  }\n\n  toJSON() {\n    return {\n      times: this.times,\n      series: this.series,\n    };\n  }\n}\n\nexport function fromJSON(json) {\n  const { series, times, meta = {} } = json;\n  let chromatogram = new Chromatogram(times, undefined, { meta });\n\n  if (Array.isArray(series)) {\n    for (let i = 0; i < series.length; i++) {\n      chromatogram.addSeries(series[i].name, series[i].data);\n    }\n  } else {\n    for (let key of Object.keys(series)) {\n      chromatogram.addSeries(key, series[key].data, {\n        meta: series[key].meta,\n      });\n    }\n  }\n  return chromatogram;\n}\n","export function filter(chromatogram, callback, options = {}) {\n  const { copy = false } = options;\n  if (copy) {\n    chromatogram = chromatogram.copy();\n  }\n\n  let times = chromatogram.getTimes();\n  let newTimes = [];\n  let indexToKeep = [];\n  for (let i = 0; i < times.length; i++) {\n    if (callback(i, times[i])) {\n      indexToKeep.push(i);\n      newTimes.push(times[i]);\n    }\n  }\n  chromatogram.times = newTimes;\n\n  for (let key of chromatogram.getSeriesNames()) {\n    const series = chromatogram.getSeries(key);\n    series.keep(indexToKeep);\n  }\n\n  return chromatogram;\n}\n","import sum from 'ml-array-sum';\n\nexport function calculateTic(chromatogram) {\n  const ms = chromatogram.getSeries('ms');\n  const massSpectra = ms.data;\n  const tic = [];\n  for (const massSpectrum of massSpectra) {\n    if (massSpectrum[1].length > 0) {\n      tic.push(sum(massSpectrum[1]));\n    } else {\n      tic.push(0);\n    }\n  }\n\n  return tic;\n}\n","export function calculateLength(chromatogram, seriesName) {\n  const series2D = chromatogram.getSeries(seriesName);\n  const spectra = series2D.data;\n  const length = spectra.map((spectrum) => spectrum[0].length);\n  return length;\n}\n","import max from 'ml-array-max';\n\n/**\n * Calculate bpc\n * @param {Chromatogram} chromatogram - GC/MS chromatogram where make the peak picking\n * @returns {Array} - Calculated bpc\n */\nexport function calculateBpc(chromatogram) {\n  const ms = chromatogram.getSeries('ms');\n  const massSpectra = ms.data;\n  const bpc = [];\n  for (const massSpectrum of massSpectra) {\n    if (massSpectrum[1].length > 0) {\n      bpc.push(max(massSpectrum[1]));\n    } else {\n      bpc.push(0);\n    }\n  }\n\n  return bpc;\n}\n","/**\n * Calculate the Extracted Ion Chromatogram\n * @param {object} chromatogram\n * @param {string|number} targetMass\n * @param {object} [options={}]\n * @param {number} [options.slotWidth=1]\n * @returns\n */\n\nexport function calculateEic(chromatogram, targetMass, options = {}) {\n  const { slotWidth = 1 } = options;\n  if (!targetMass) {\n    throw new Error(\n      'targetMass must be defined and a number or string of comma separated numbers',\n    );\n  }\n  let targetMasses;\n  if (!Number.isNaN(Number(targetMass))) {\n    targetMasses = [Number(targetMass)];\n  } else if (typeof targetMass === 'string') {\n    targetMasses = targetMass.split(/[\\t\\n\\r ,;]+/).map(Number);\n  }\n  for (let mass of targetMasses) {\n    if (Number.isNaN(mass)) {\n      throw new Error(\n        'targetMass must be defined and a number or string of comma separated numbers',\n      );\n    }\n  }\n\n  const halfWidth = slotWidth / 2;\n  const ms = chromatogram.getSeries('ms');\n  const massSpectra = ms.data;\n\n  const result = new Array(massSpectra.length).fill(0);\n  for (let mass of targetMasses) {\n    for (let i = 0; i < massSpectra.length; i++) {\n      let massSpectrum = massSpectra[i];\n      for (let j = 0; j < massSpectrum[0].length; j++) {\n        if (Math.abs(massSpectrum[0][j] - mass) <= halfWidth) {\n          result[i] += massSpectrum[1][j];\n        }\n      }\n    }\n  }\n\n  return result;\n}\n","import { IsotopicDistribution } from 'isotopic-distribution';\nimport { generateMFs } from 'mf-generator';\nimport { xyObjectSlotX } from 'ml-spectra-processing';\n\n/**\n * Calculate tic for specific molecular formula and ionizations\n *\n * The system will take all the peaks with an intensity over 5% (default value)\n * @param {Chromatogram} chromatogram - GC/MS chromatogram where make the peak picking\n * @param {string} targetMF - mass for which to extract the spectrum\n * @param {object} [options={}]\n * @param {number} [options.slotWidth=1] - Width of the slot around the mass of targetMF\n * @param {number} [options.threshold=0.05] - Minimal height for peaks\n * @param {number} [options.ionizations='H+'] - List of allowed ionisation\n * @returns {Promise<Array>} - Calculated mass for targetMass\n */\nexport async function calculateForMF(chromatogram, targetMF, options = {}) {\n  const { threshold = 0.05, slotWidth = 1, ionizations = 'H+' } = options;\n\n  if (typeof targetMF !== 'string') {\n    throw new Error('targetMF must be defined and a string');\n  }\n\n  const mfInfos = await generateMFs([targetMF]);\n  const mfs = mfInfos.map((info) => info.mf);\n\n  const halfWidth = slotWidth / 2;\n\n  const ms = chromatogram.getSeries('ms');\n\n  let masses = [];\n  for (let mf of mfs) {\n    let isotopicDistribution = new IsotopicDistribution(mf, {\n      ionizations,\n    });\n    // we add isotopicDistribution in all the parts\n    isotopicDistribution.getDistribution();\n\n    let parts = isotopicDistribution.getParts();\n\n    masses = masses.concat(...parts.map((part) => part.isotopicDistribution));\n  }\n\n  masses.sort((a, b) => a.x - b.x);\n  masses = xyObjectSlotX(masses, { slotWidth }).filter(\n    (mass) => mass.y > threshold,\n  );\n\n  let massSpectra = ms.data;\n  let result = new Array(massSpectra.length).fill(0);\n  for (let targetMass of masses) {\n    for (let i = 0; i < massSpectra.length; i++) {\n      let massSpectrum = massSpectra[i];\n      for (let j = 0; j < massSpectrum[0].length; j++) {\n        if (Math.abs(massSpectrum[0][j] - targetMass.x) <= halfWidth) {\n          result[i] += massSpectrum[1][j];\n        }\n      }\n    }\n  }\n  return result;\n}\n","export function getClosestData(chromatogram, time, options = {}) {\n  const { seriesName = 'ms' } = options;\n  chromatogram.requiresSeries(seriesName);\n  let closest = chromatogram.getClosestTime(time);\n  return {\n    rt: chromatogram.getTimes()[closest],\n    index: closest,\n    data: chromatogram.getSeries(seriesName).data[closest],\n  };\n}\n","import { MF } from 'mf-parser';\n\nexport function applyLockMass(chromatogram, mfs, options = {}) {\n  const { oddReference = true, maxShift = 0.1 } = options;\n\n  // allows mf as string or array\n  if (typeof mfs === 'string') {\n    mfs = [mfs];\n  }\n\n  // calculate the mass reference values\n  const referenceMass = mfs.map((mf) => {\n    let info = new MF(mf).getInfo();\n    return info.observedMonoisotopicMass || info.monoisotopicMass;\n  });\n\n  const ms = chromatogram.getSeries('ms').data;\n\n  // check where is the reference values\n  let referenceIndexShift = Number(oddReference);\n  let msIndexShift = Number(!oddReference);\n  const newSize = ms.length >> 1;\n  let referencesCount = new Array(referenceMass.length).fill(0);\n\n  // applying the changes for all the spectra\n  let previousValidDifference = Number.MAX_VALUE;\n  let usingPreviousValidDifference = false;\n  for (let i = 0; i < newSize; i++) {\n    let massIndex = 2 * i + msIndexShift;\n    let referenceIndex = 2 * i + referenceIndexShift;\n\n    // calculate the difference between theory and experimental (the smallest)\n    let difference = Number.MAX_VALUE;\n    let closestIndex = -1;\n    for (let j = 0; j < referenceMass.length; j++) {\n      for (let k = 0; k < ms[referenceIndex][0].length; k++) {\n        if (\n          Math.abs(difference) >\n          Math.abs(referenceMass[j] - ms[referenceIndex][0][k])\n        ) {\n          difference = referenceMass[j] - ms[referenceIndex][0][k];\n          closestIndex = j;\n        }\n      }\n    }\n    if (\n      Math.abs(difference) > maxShift &&\n      Math.abs(previousValidDifference) < maxShift\n    ) {\n      difference = previousValidDifference;\n      usingPreviousValidDifference = true;\n    } else {\n      usingPreviousValidDifference = false;\n    }\n    // apply identified lock mass\n    if (Math.abs(difference) < maxShift) {\n      previousValidDifference = difference;\n      if (!usingPreviousValidDifference && closestIndex !== -1) {\n        referencesCount[closestIndex] += 1;\n      }\n      for (let m = 0; m < ms[massIndex][0].length; m++) {\n        ms[massIndex][0][m] += difference;\n      }\n    }\n  }\n\n  const referenceUsed = {\n    total: newSize,\n    totalFound: referencesCount.reduce((prev, current) => current + prev, 0),\n    mfs: {},\n    percent: 0,\n  };\n  for (let r = 0; r < referenceMass.length; r++) {\n    referenceUsed.mfs[mfs[r]] = referencesCount[r];\n  }\n  referenceUsed.percent =\n    (referenceUsed.totalFound / referenceUsed.total) * 100;\n\n  // remove the time and the mass spectra that contains the reference\n  chromatogram.filter((index) => index % 2 !== referenceIndexShift);\n\n  return referenceUsed;\n}\n","import { Matrix } from 'ml-matrix';\nimport { xFindClosestIndex } from 'ml-spectra-processing';\n\n/**\n * Return the submatrix, times, and mass x axis for each range\n * @param chromatogram\n * @param {object} range - from - to of the TIC\n * @param {number} [range.from] - lower limit in the retention time\n * @param {number} [range.to] - upper limit in the retention time\n * @returns {object} - submatrix, times and m/z axis of the range.\n */\nexport function getMzVsTimesMatrix(chromatogram, range) {\n  let { from, to } = range;\n  let fromIndex = chromatogram.getClosestTime(from);\n  let toIndex = chromatogram.getClosestTime(to);\n\n  let data = chromatogram.series.ms.data.slice(fromIndex, toIndex);\n  let times = chromatogram.times.slice(fromIndex, toIndex);\n\n  let mzAxis = new Set();\n  for (let i = 0; i < data.length; i++) {\n    let spectrum = data[i];\n    for (let j = 0; j < spectrum[0].length; j++) {\n      mzAxis.add(Math.round(spectrum[0][j]));\n    }\n  }\n  mzAxis = Array.from(mzAxis).sort((a, b) => a - b);\n  const nbPoints = mzAxis.length;\n  const matrix = new Matrix(data.length, nbPoints);\n  for (let i = 0; i < data.length; i++) {\n    let element = data[i];\n    for (let j = 0; j < element[0].length; j++) {\n      let xValue = Math.round(element[0][j]);\n      let index = xFindClosestIndex(mzAxis, xValue);\n      matrix.set(i, index, element[1][j]);\n    }\n  }\n  return { times, mzAxis, matrix };\n}\n","import { merge } from '../ms/merge';\n\n/**\n * Append MS spectra to a list of peaks\n * @param {Chromatogram} chromatogram\n * @param {Array<object>} peaks - Array of range {from:, to:}\n * @param {object} [options={}] - Options for the integral filtering\n * @param {number} [options.mergeThreshold=0.3] - Peaks that are closer than this value (in Da) will be merged\n * @param {number} [options.seriesName='ms'] - Maximum number of peaks for each mass spectra (when is Number.MAX_VALUE there's no filter)\n * @returns {Array<object>} - A copy of ranges with ms appended\n */\nexport function appendMass(chromatogram, peaks, options = {}) {\n  const { mergeThreshold = 0.3, seriesName = 'ms' } = options;\n  const result = [];\n  // integrate MS\n  for (const peak of peaks) {\n    const massSpectrum = merge(chromatogram, {\n      mergeThreshold,\n      seriesName,\n      range: peak,\n    });\n    result.push({\n      ...peak,\n      ms: massSpectrum,\n    });\n  }\n  return result;\n}\n","export function massFilter(massXYObject, options = {}) {\n  const {\n    thresholdFactor = 0,\n    maxNumberPeaks = Number.MAX_VALUE,\n    groupWidth = 0,\n  } = options;\n\n  let max = -1;\n  let massList = new Array(massXYObject.x.length);\n  for (let i = 0; i < massXYObject.x.length; ++i) {\n    massList[i] = {\n      x: massXYObject.x[i],\n      y: massXYObject.y[i],\n    };\n\n    if (massXYObject.y[i] > max) {\n      max = massXYObject.y[i];\n    }\n  }\n\n  // filters based in thresholdFactor\n  max *= thresholdFactor;\n  let filteredList = massList.filter((val) => val.y > max);\n\n  // filters based in maxNumberPeaks\n  if (filteredList.length > maxNumberPeaks || groupWidth !== 0) {\n    filteredList.sort((a, b) => b.y - a.y);\n\n    // filters based in groupWidth\n    filteredList = moreDistinct(filteredList, maxNumberPeaks, groupWidth);\n\n    filteredList.sort((a, b) => a.x - b.x);\n  }\n\n  let ans = {\n    x: new Array(filteredList.length),\n    y: new Array(filteredList.length),\n  };\n  for (let i = 0; i < filteredList.length; ++i) {\n    ans.x[i] = filteredList[i].x;\n    ans.y[i] = filteredList[i].y;\n  }\n\n  return ans;\n}\n\n/**\n * Filters based in groupWidth\n * @ignore\n * @param {Array<object>} list - Sorted list of XY-objects to be filtered\n * @param {number} maxNumberPeaks - Maximum number of peaks for each mass spectra\n * @param {number} groupWidth - When find a max can't be another max in a radius of this size\n * @returns {Array<object>} - List of XY-objects filtered\n */\nexport function moreDistinct(list, maxNumberPeaks, groupWidth) {\n  let len = 0;\n  if (maxNumberPeaks > list.length) {\n    maxNumberPeaks = list.length;\n  }\n  let filteredList = new Array(maxNumberPeaks);\n\n  for (let i = 0; i < list.length && len < maxNumberPeaks; ++i) {\n    let outRange = true;\n    for (let j = 0; j < len && outRange; ++j) {\n      outRange =\n        outRange &&\n        !(\n          list[i].x > filteredList[j].x - groupWidth &&\n          list[i].x < filteredList[j].x + groupWidth\n        );\n    }\n    if (outRange) {\n      filteredList[len++] = list[i];\n    }\n  }\n  filteredList.length = len;\n\n  return filteredList;\n}\n","import { massFilter } from './massFilter';\n\nexport function vectorify(ranges, options = {}) {\n  const { massPower = 3, intPower = 0.6 } = options;\n  let filter =\n    options.thresholdFactor || options.maxNumberPeaks || options.groupWidth;\n\n  let vector = new Array(ranges.length);\n  if (filter) {\n    const filterOptions = {\n      thresholdFactor: options.thresholdFactor,\n      maxNumberPeaks: options.maxNumberPeaks,\n      groupWidth: options.groupWidth,\n    };\n\n    for (let i = 0; i < ranges.length; ++i) {\n      let len = ranges[i].ms.x.length;\n      vector[i] = {\n        x: ranges[i].ms.x,\n        y: new Array(len),\n      };\n      for (let j = 0; j < len; ++j) {\n        vector[i].y[j] =\n          ranges[i].ms.x[j] ** massPower * ranges[i].ms.y[j] ** intPower;\n      }\n\n      vector[i] = massFilter(vector[i], filterOptions);\n    }\n  } else {\n    for (let i = 0; i < ranges.length; ++i) {\n      let len = ranges[i].ms.x.length;\n      vector[i] = {\n        x: ranges[i].ms.x,\n        y: new Array(len),\n      };\n      for (let j = 0; j < len; ++j) {\n        vector[i].y[j] =\n          ranges[i].ms.x[j] ** massPower * ranges[i].ms.y[j] ** intPower;\n      }\n    }\n  }\n\n  return vector;\n}\n","export function cosineSimilarity(ms1x, ms1y, ms2x, ms2y) {\n  let index1 = 0;\n  let index2 = 0;\n\n  let product = 0;\n  let norm1 = 0;\n  let norm2 = 0;\n\n  while (index1 < ms1x.length || index2 < ms2x.length) {\n    let w1 = ms1y[index1];\n    let w2 = ms2y[index2];\n    if (index2 === ms2x.length || ms1x[index1] < ms2x[index2]) {\n      norm1 += w1 * w1;\n      ++index1;\n    } else if (index1 === ms1x.length || ms2x[index2] < ms1x[index1]) {\n      norm2 += w2 * w2;\n      ++index2;\n    } else {\n      product += w1 * w2;\n      norm1 += w1 * w1;\n      norm2 += w2 * w2;\n      ++index1;\n      ++index2;\n    }\n  }\n\n  let norm1Norm2 = norm1 * norm2;\n  if (norm1Norm2 === 0) {\n    return 0;\n  } else {\n    return (product * product) / norm1Norm2;\n  }\n}\n","import { cosineSimilarity } from './ms/cosineSimilarity';\nimport { appendMass } from './peaks/appendMass';\nimport { getPeaks } from './peaks/getPeaks';\nimport { vectorify } from './vectorify';\n\n/**\n * Preprocessing task over the signalsj\n * @ignore\n * @param {Chromatogram} chromatogram - Chromatogram to process\n * @param {object} [options] - Options object (same as spectraComparison)\n * @returns {{peaks: Array<object>, integratedMs: Array<object>, vector: Array<object>}} - Array of peaks, integrated mass spectra and weighted mass spectra\n */\nfunction preprocessing(chromatogram, options) {\n  // peak picking\n  let peaks = getPeaks(chromatogram, options);\n  peaks = peaks.sort((a, b) => a.from - b.to);\n\n  // integrate mass in the peaks\n  let integratedMs = appendMass(chromatogram, peaks, options);\n  let vector = vectorify(integratedMs, options);\n  return {\n    peaks,\n    integratedMs,\n    vector,\n  };\n}\n\nconst defaultOptions = {\n  thresholdFactor: 0,\n  maxNumberPeaks: Number.MAX_VALUE,\n  groupWidth: 0,\n  heightFilter: 2,\n  massPower: 3,\n  intPower: 0.6,\n  similarityThreshold: 0.7,\n};\n\nexport function spectraComparison(chrom1, chrom2, options = {}) {\n  options = { ...defaultOptions, ...options };\n\n  // peak picking\n  let reference = preprocessing(chrom1, options);\n  let sample = preprocessing(chrom2, options);\n\n  // similarity between MS\n  const len = Math.max(sample.peaks.length, reference.peaks.length);\n  let similarityPeaks = {\n    chrom1: new Array(len),\n    chrom2: new Array(len),\n    similarity: new Array(len),\n  };\n  let similarLen = 0;\n\n  // Similarity matrix\n  for (let i = 0; i < sample.peaks.length; ++i) {\n    let max = { similarity: -3 };\n    let biggerCounter = 0;\n    for (let j = 0; j < reference.peaks.length; ++j) {\n      let sim = cosineSimilarity(\n        sample.vector[i].x,\n        sample.vector[i].y,\n        reference.vector[j].x,\n        reference.vector[j].y,\n      );\n\n      if (sim > options.similarityThreshold && sim > max.similarity) {\n        max = {\n          similarity: sim,\n          chrom1: reference.peaks[j],\n          chrom2: sample.peaks[i],\n        };\n      }\n      if (sim > options.similarityThreshold) {\n        ++biggerCounter;\n      }\n    }\n    if (biggerCounter === 1) {\n      similarityPeaks.chrom1[similarLen] = max.chrom1;\n      similarityPeaks.chrom2[similarLen] = max.chrom2;\n      similarityPeaks.similarity[similarLen++] = max.similarity;\n    }\n  }\n\n  similarityPeaks.chrom1.length = similarLen;\n  similarityPeaks.chrom2.length = similarLen;\n\n  let duplicates = {};\n  for (let i = 0; i < similarLen; ++i) {\n    if (duplicates[similarityPeaks.chrom1[i].retentionTime]) {\n      duplicates[similarityPeaks.chrom1[i].retentionTime].push(i);\n    } else {\n      duplicates[similarityPeaks.chrom1[i].retentionTime] = [i];\n    }\n  }\n\n  let peaksChrom1 = [];\n  let peaksChrom2 = [];\n  let peaksSimilarity = [];\n  for (let val in duplicates) {\n    if (duplicates[val].length === 1) {\n      peaksChrom1.push(similarityPeaks.chrom1[duplicates[val][0]]);\n      peaksChrom2.push(similarityPeaks.chrom2[duplicates[val][0]]);\n      peaksSimilarity.push(similarityPeaks.similarity[duplicates[val][0]]);\n    }\n  }\n\n  return {\n    peaksFirst: peaksChrom1,\n    peaksSecond: peaksChrom2,\n    peaksSimilarity,\n  };\n}\n","import { isAnyArray } from 'is-any-array';\n/**\n * Check that x and y are arrays with the same length.\n * @param x - first array\n * @param y - second array\n * @throws if x or y are not the same length, or if they are not arrays\n */\nexport function checkArrayLength(x, y) {\n    if (!isAnyArray(x) || !isAnyArray(y)) {\n        throw new TypeError('x and y must be arrays');\n    }\n    if (x.length !== y.length) {\n        throw new RangeError('x and y arrays must have the same length');\n    }\n}\n//# sourceMappingURL=checkArrayLength.js.map","import { isAnyArray } from 'is-any-array';\nimport { checkArrayLength } from './checkArrayLength';\nexport class BaseRegression {\n    constructor() {\n        if (new.target === BaseRegression) {\n            throw new Error('BaseRegression must be subclassed');\n        }\n    }\n    predict(x) {\n        if (typeof x === 'number') {\n            return this._predict(x);\n        }\n        else if (isAnyArray(x)) {\n            const y = [];\n            for (const xVal of x) {\n                y.push(this._predict(xVal));\n            }\n            return y;\n        }\n        else {\n            throw new TypeError('x must be a number or array');\n        }\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _predict(x) {\n        throw new Error('_predict must be implemented');\n    }\n    train() {\n        // Do nothing for this package\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    toString(precision) {\n        return '';\n    }\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    toLaTeX(precision) {\n        return '';\n    }\n    /**\n     * Return the correlation coefficient of determination (r) and chi-square.\n     * @param x - explanatory variable\n     * @param y - response variable\n     * @return - Object with further statistics.\n     */\n    score(x, y) {\n        checkArrayLength(x, y);\n        const n = x.length;\n        const y2 = new Array(n);\n        for (let i = 0; i < n; i++) {\n            y2[i] = this._predict(x[i]);\n        }\n        let xSum = 0;\n        let ySum = 0;\n        let chi2 = 0;\n        let rmsd = 0;\n        let xSquared = 0;\n        let ySquared = 0;\n        let xY = 0;\n        for (let i = 0; i < n; i++) {\n            xSum += y2[i];\n            ySum += y[i];\n            xSquared += y2[i] * y2[i];\n            ySquared += y[i] * y[i];\n            xY += y2[i] * y[i];\n            if (y[i] !== 0) {\n                chi2 += ((y[i] - y2[i]) * (y[i] - y2[i])) / y[i];\n            }\n            rmsd += (y[i] - y2[i]) * (y[i] - y2[i]);\n        }\n        const r = (n * xY - xSum * ySum) /\n            Math.sqrt((n * xSquared - xSum * xSum) * (n * ySquared - ySum * ySum));\n        return {\n            r,\n            r2: r * r,\n            chi2,\n            rmsd: Math.sqrt(rmsd / n),\n        };\n    }\n}\n//# sourceMappingURL=BaseRegression.js.map","/**\n * Cast `number` to string. Optionally `digits` specifies significant figures.\n * @param number\n * @param figures\n * @returns - A string representation of `number`.\n */\nexport function maybeToPrecision(number, figures) {\n    if (number < 0) {\n        number = 0 - number;\n        if (typeof figures === 'number') {\n            return `- ${number.toPrecision(figures)}`;\n        }\n        else {\n            return `- ${number.toString()}`;\n        }\n    }\n    else if (typeof figures === 'number') {\n        return number.toPrecision(figures);\n    }\n    else {\n        return number.toString();\n    }\n}\n//# sourceMappingURL=maybeToPrecision.js.map","import { Matrix, MatrixTransposeView, solve } from 'ml-matrix';\nimport { BaseRegression, checkArrayLength, maybeToPrecision, } from 'ml-regression-base';\nexport class PolynomialRegression extends BaseRegression {\n    degree;\n    powers;\n    coefficients;\n    /**\n     * Build a polynomial regression model from the given data set.\n     * @param x - independent or explanatory variable\n     * @param y - dependent or response variable\n     * @param degree - degree of the polynomial regression, or array of powers to be used. When degree is an array, intercept at zero is forced to false/ignored.\n     * @param options - regression options\n     * @example `new PolynomialRegression(x, y, 2)`, in this case, you can pass the option `interceptAtZero`, if you need it.\n     * @example `new PolynomialRegression(x, y, [1, 3, 5])`\n     * Each of the degrees corresponds to a column, so if you have them switched, just do:\n     * @example `new PolynomialRegression(x, y, [3, 1, 5])`\n     */\n    constructor(x, y, degree, options = {}) {\n        super();\n        // @ts-expect-error internal use only\n        if (x === true) {\n            // @ts-expect-error internal use only\n            this.degree = y.degree;\n            // @ts-expect-error internal use only\n            this.powers = y.powers;\n            // @ts-expect-error internal use only\n            this.coefficients = y.coefficients;\n        }\n        else {\n            checkArrayLength(x, y);\n            const result = regress(x, y, degree, options);\n            this.degree = result.degree;\n            this.powers = result.powers;\n            this.coefficients = result.coefficients;\n        }\n    }\n    _predict(x) {\n        const { coefficients, powers } = this;\n        let y = 0;\n        for (let k = 0; k < powers.length; k++) {\n            const coefficient = coefficients[k] ?? 0;\n            const power = powers[k] ?? 0;\n            y += coefficient * x ** power;\n        }\n        return y;\n    }\n    toJSON() {\n        return {\n            name: 'polynomialRegression',\n            degree: this.degree,\n            powers: this.powers,\n            coefficients: this.coefficients,\n        };\n    }\n    toString(precision) {\n        return this._toFormula(precision, false);\n    }\n    toLaTeX(precision) {\n        return this._toFormula(precision, true);\n    }\n    _toFormula(precision, isLaTeX) {\n        let sup = '^';\n        let closeSup = '';\n        let times = ' * ';\n        if (isLaTeX) {\n            sup = '^{';\n            closeSup = '}';\n            times = '';\n        }\n        let fn = '';\n        let str = '';\n        for (let k = 0; k < this.coefficients.length; k++) {\n            str = '';\n            const coefficient = this.coefficients[k] ?? 0;\n            const power = this.powers[k] ?? 0;\n            if (coefficient !== 0) {\n                if (power === 0) {\n                    str = maybeToPrecision(coefficient, precision);\n                }\n                else if (power === 1) {\n                    str = `${maybeToPrecision(coefficient, precision) + times}x`;\n                }\n                else {\n                    str = `${maybeToPrecision(coefficient, precision) + times}x${sup}${power}${closeSup}`;\n                }\n                if (coefficient > 0 && k !== this.coefficients.length - 1) {\n                    str = ` + ${str}`;\n                }\n                else if (k !== this.coefficients.length - 1) {\n                    str = ` ${str}`;\n                }\n            }\n            fn = str + fn;\n        }\n        if (fn.startsWith('+')) {\n            fn = fn.slice(1);\n        }\n        return `f(x) = ${fn}`;\n    }\n    static load(json) {\n        if (json.name !== 'polynomialRegression') {\n            throw new TypeError('not a polynomial regression model');\n        }\n        // @ts-expect-error internal use only\n        return new PolynomialRegression(true, json);\n    }\n}\n/**\n * Perform a polynomial regression on the given data set.\n * This is an internal function.\n * @param x - independent or explanatory variable\n * @param y - dependent or response variable\n * @param degree - degree of the polynomial regression\n * @param options - regression options\n * @returns degree, powers and coefficients of the fitted polynomial\n */\nfunction regress(x, y, degree, options = {}) {\n    const n = x.length;\n    let { interceptAtZero = false } = options;\n    let powers = [];\n    if (Array.isArray(degree)) {\n        powers = degree;\n        interceptAtZero = false;\n    }\n    else if (typeof degree === 'number') {\n        if (interceptAtZero) {\n            powers = new Array(degree);\n            for (let k = 0; k < degree; k++) {\n                powers[k] = k + 1;\n            }\n        }\n        else {\n            powers = new Array(degree + 1);\n            for (let k = 0; k <= degree; k++) {\n                powers[k] = k;\n            }\n        }\n    }\n    const nCoefficients = powers.length;\n    const F = new Matrix(n, nCoefficients);\n    const Y = new Matrix([Array.from(y)]);\n    for (let k = 0; k < nCoefficients; k++) {\n        const power = powers[k] ?? 0;\n        for (let i = 0; i < n; i++) {\n            if (power === 0) {\n                F.set(i, k, 1);\n            }\n            else {\n                F.set(i, k, (x[i] ?? 0) ** power);\n            }\n        }\n    }\n    const FT = new MatrixTransposeView(F);\n    const A = FT.mmul(F);\n    const B = FT.mmul(new MatrixTransposeView(Y));\n    return {\n        coefficients: solve(A, B).to1DArray(),\n        degree: Math.max(...powers),\n        powers,\n    };\n}\n//# sourceMappingURL=index.js.map","import max from 'ml-array-max';\n\n/**\n * @typedef KovatsReturn\n * @type {object}\n * @property {number} index - Kovats retention index\n * @property {number} numberFragments - Number of fragments\n * @property {number} percentFragments - Percentage of fragments\n */\n\n/**\n * Calculates the Kovats retention index for a mass spectra of a n-alkane\n * @param {object} ms - A mass spectra object\n * @param {Array<number>} ms.x - Array of masses\n * @param {Array<number>} ms.y - Array of intensities\n * @param options\n * @returns {KovatsReturn} - Kovats retention index\n */\nexport function kovats(ms, options = {}) {\n  const { threshold = 0.01 } = options;\n  // we normalize the data and filter them\n  let maxY = max(ms.y);\n  let masses = [];\n  let intensities = [];\n  for (let i = 0; i < ms.x.length; i++) {\n    if (ms.y[i] / maxY > threshold) {\n      masses.push(ms.x[i]);\n      intensities.push(ms.y[i] / maxY);\n    }\n  }\n\n  // we find candidates\n  let nbAlcaneMasses = [];\n  let fragmentMasses = [];\n\n  for (let i = 0; i < masses.length; i++) {\n    if ((masses[i] - 2) % 14 === 0) {\n      nbAlcaneMasses.push(masses[i]);\n    }\n    if ((masses[i] - 1) % 14 === 0) {\n      fragmentMasses.push(masses[i]);\n    }\n  }\n\n  if (nbAlcaneMasses.length === 0) return {};\n\n  let biggestMass = nbAlcaneMasses.sort((a, b) => b - a)[0];\n  fragmentMasses = fragmentMasses.filter((mass) => mass < biggestMass);\n\n  return {\n    index: (100 * (biggestMass - 2)) / 14,\n    numberFragments: fragmentMasses.length,\n    percentFragments: fragmentMasses.length / ((biggestMass - 2) / 14),\n  };\n}\n","module.exports = function(haystack, needle, comparator, low, high) {\n  var mid, cmp;\n\n  if(low === undefined)\n    low = 0;\n\n  else {\n    low = low|0;\n    if(low < 0 || low >= haystack.length)\n      throw new RangeError(\"invalid lower bound\");\n  }\n\n  if(high === undefined)\n    high = haystack.length - 1;\n\n  else {\n    high = high|0;\n    if(high < low || high >= haystack.length)\n      throw new RangeError(\"invalid upper bound\");\n  }\n\n  while(low <= high) {\n    // The naive `low + high >>> 1` could fail for array lengths > 2**31\n    // because `>>>` converts its operands to int32. `low + (high - low >>> 1)`\n    // works for array lengths <= 2**32-1 which is also Javascript's max array\n    // length.\n    mid = low + ((high - low) >>> 1);\n    cmp = +comparator(haystack[mid], needle, mid, haystack);\n\n    // Too low.\n    if(cmp < 0.0)\n      low  = mid + 1;\n\n    // Too high.\n    else if(cmp > 0.0)\n      high = mid - 1;\n\n    // Key found.\n    else\n      return mid;\n  }\n\n  // Key not found.\n  return ~low;\n}\n","import binarySearch from 'binary-search';\n\nconst ascValue = (a, b) => a.index - b.index;\nconst ascTime = (a, b) => a.time - b.time;\n\nexport function getKovatsConversionFunction(peaks, options = {}) {\n  const { revert = false } = options;\n\n  const kovatsConversionTable = peaks.map((peak) => ({\n    time: peak.x,\n    index: peak.kovats.index,\n  }));\n\n  if (revert) {\n    const indexes = kovatsConversionTable.sort(ascValue);\n\n    return (index) => {\n      let position = binarySearch(indexes, { index }, ascValue);\n\n      if (position < 0) {\n        position = ~position;\n\n        // handle extreme cases\n        if (position === 0 || position === indexes.length) {\n          return 0;\n        }\n\n        let smallerAlcane = indexes[position - 1].time;\n        let largerAlcane = indexes[position].time;\n        return (\n          ((index - indexes[position - 1].index) *\n            (largerAlcane - smallerAlcane)) /\n            100 +\n          smallerAlcane\n        );\n      } else {\n        return indexes[position].time;\n      }\n    };\n  } else {\n    const times = kovatsConversionTable.sort(ascTime);\n\n    return (time) => {\n      let position = binarySearch(times, { time }, ascTime);\n      if (position < 0) {\n        position = ~position;\n\n        // handle extreme cases\n        if (position === 0 || position === times.length) {\n          return 0;\n        }\n\n        let smallerAlcane = times[position - 1].time;\n        let largerAlcane = times[position].time;\n        return (\n          (100 * (time - smallerAlcane)) / (largerAlcane - smallerAlcane) +\n          times[position - 1].index\n        );\n      } else {\n        return times[position].index;\n      }\n    };\n  }\n}\n","/**\n * Ensure that the data is string. If it is an ArrayBuffer it will be converted to string using TextDecoder.\n * @param blob\n * @param options\n * @returns\n */\nexport function ensureString(blob, options = {}) {\n    if (typeof blob === 'string') {\n        return blob;\n    }\n    if (ArrayBuffer.isView(blob) || blob instanceof ArrayBuffer) {\n        if (options.encoding) {\n            return new TextDecoder(options.encoding).decode(blob);\n        }\n        else {\n            return decodeText(blob);\n        }\n    }\n    throw new TypeError(`blob must be a string, ArrayBuffer or ArrayBufferView`);\n}\nfunction decodeText(blob) {\n    const uint8 = ArrayBuffer.isView(blob)\n        ? new Uint8Array(blob.buffer, blob.byteOffset, blob.byteLength)\n        : new Uint8Array(blob);\n    if (uint8.length >= 2) {\n        if (uint8[0] === 0xfe && uint8[1] === 0xff) {\n            return new TextDecoder('utf-16be').decode(uint8);\n        }\n        if (uint8[0] === 0xff && uint8[1] === 0xfe) {\n            return new TextDecoder('utf-16le').decode(uint8);\n        }\n    }\n    try {\n        return new TextDecoder('utf-8', { fatal: true }).decode(uint8);\n    }\n    catch {\n        return new TextDecoder('latin1').decode(uint8);\n    }\n}\n//# sourceMappingURL=index.js.map","export function parseString(value) {\n    if (value.length === 4 || value.length === 5) {\n        const lowercase = value.toLowerCase();\n        if (lowercase === 'true')\n            return true;\n        if (lowercase === 'false')\n            return false;\n    }\n    const number = Number(value);\n    if (number === 0 && !value.includes('0')) {\n        return value;\n    }\n    if (!Number.isNaN(number))\n        return number;\n    return value;\n}\n//# sourceMappingURL=parseString.js.map","import { getGyromagneticNucleus, gyromagneticRatio } from '.';\n/**\n * Returns the gyromagnetic ratio for a given nucleus string.\n * @param nucleus - The name or symbol of the nucleus (e.g., '1H', 'proton').\n * @returns The gyromagnetic ratio for the nucleus, or null if not found.\n */\nexport function getGyromagneticRatio(nucleus) {\n    const realNucleus = getGyromagneticNucleus(nucleus);\n    if (realNucleus) {\n        return gyromagneticRatio[realNucleus];\n    }\n    return null;\n}\n//# sourceMappingURL=getGyromagneticRatio.js.map","import { gyromagneticRatio } from '.';\n/**\n * Attempts to resolve a nucleus string to a canonical gyromagnetic nucleus symbol.\n * @param nucleus - The name or symbol of the nucleus (e.g., '1H', 'proton').\n * @returns The canonical nucleus symbol if found, otherwise null.\n */\nexport function getGyromagneticNucleus(nucleus) {\n    nucleus = nucleus.toLowerCase();\n    if (nucleus === 'proton')\n        return '1H';\n    for (const key in gyromagneticRatio) {\n        if (key.toLowerCase() === nucleus)\n            return key;\n    }\n    if (nucleus in gyromagneticRatio) {\n        return nucleus;\n    }\n    // we try to use only the numbers\n    const nucleusNumber = nucleus.replaceAll(/[^0-9]/g, '');\n    if (!nucleusNumber)\n        return null;\n    const filteredNuclei = [];\n    for (const key in gyromagneticRatio) {\n        if (key.replaceAll(/[^0-9]/g, '') === nucleusNumber) {\n            filteredNuclei.push(key);\n        }\n    }\n    if (filteredNuclei.length === 1) {\n        return filteredNuclei[0];\n    }\n    return null;\n}\n//# sourceMappingURL=getGyromagneticNucleus.js.map","import { gyromagneticRatioMHzT } from './gyromagneticRatioMHzT';\nexport const gyromagneticRatio = Object.fromEntries(Object.entries(gyromagneticRatioMHzT).map(([key, value]) => [\n    key,\n    value * 2 * Math.PI * 1e6,\n]));\nexport * from './gyromagneticRatioMHzT';\nexport * from './getGyromagneticNucleus';\nexport * from './getGyromagneticRatio';\n//# sourceMappingURL=index.js.map","export const gyromagneticRatioMHzT = {\n    '1H': 42.577478615342585,\n    '2H': 6.5359028540009305,\n    '3H': 45.41483815473964,\n    '3He': -32.43604456417949,\n    '6Li': 6.266099405837534,\n    '7Li': 16.548177299618295,\n    '9Be': -5.983379963834242,\n    '10B': 4.57473388220653,\n    '11B': 13.66160796005943,\n    '13C': 10.707746367473973,\n    '14N': 3.076272817251739,\n    '15N': -4.3152552187859134,\n    '17O': -5.7734832203316975,\n    '19F': 40.06924371705693,\n    '21Ne': -3.362579959801532,\n    '22Na': 4.436349259342206,\n    '23Na': 11.268733657034753,\n    '25Mg': -2.607933066661972,\n    '26Al': 4.273225764239245,\n    '27Al': 11.100630067688776,\n    '29Si': -8.461871234008282,\n    '31P': 17.241162495263175,\n    '33S': 3.2688220630834754,\n    '35Cl': 4.175656570906633,\n    '36Cl': 4.897135020041924,\n    '37Cl': 3.4759025124743057,\n    '39Ar': -3.462835209795831,\n    '39K': 1.9893443809332112,\n    '40K': -2.4734743333970806,\n    '41K': 1.091921234883595,\n    '41Ca': -3.4724832349401047,\n    '43Ca': -2.8689916395725414,\n    '45Sc': 10.353659488911559,\n    '47Hi': -2.403068251036403,\n    '49Hi': -2.403730327705445,\n    '50V': 4.248579379465121,\n    '51V': 11.208261084083814,\n    '53Cr': -2.4103147963328766,\n    '53Mn': 10.961289063460638,\n    '55Mn': 10.570707386401027,\n    '57Fe': 1.3818237005731187,\n    '59Co': 10.050933643526891,\n    '60Co': 5.7916463354780205,\n    '61Ni': -3.809518009468367,\n    '63Ni': 7.561612483277437,\n    '63Cu': 11.311420179117773,\n    '65Cu': 12.116874196993763,\n    '67Zn': 2.6674502745948656,\n    '69Ga': 10.23978520568125,\n    '71Ga': 13.010902748192017,\n    '73Ge': -1.4876591727852992,\n    '75As': 7.3090505609529135,\n    '77Se': 8.134221686648205,\n    '79Se': -2.21708568778123,\n    '79Br': 10.695006473323717,\n    '81Br': 11.528409999706447,\n    '81Kr': -1.9753405882294455,\n    '83Kr': -1.6443288722876133,\n    '85Kr': -1.703226109304539,\n    '85Rb': 4.125530397832004,\n    '87Rb': 13.981309683545954,\n    '87Sr': -1.851714225407608,\n    '89Y': -2.0931336103407774,\n    '91Zr': -3.970456361178983,\n    '91Nb': 11.032433266932335,\n    '92Nb': 5.58627189504799,\n    '93Nb': 10.439564904668199,\n    '95Mo': -2.784380854729418,\n    '97Mo': -2.842922370728985,\n    '97Hc': 9.858553909649345,\n    '99Hc': 9.618018745530753,\n    '99Ru': -1.9544329039438861,\n    '101Ru': -2.1892087754004836,\n    '103Rh': -1.3459975123963002,\n    '105Pd': -1.9574819412355304,\n    '107Ag': -1.730633566737207,\n    '109Ag': 1.9896492846623755,\n    '111Cd': -9.05564075618306,\n    '113Cd': -9.471834346492482,\n    '113In': 9.351736155393834,\n    '115In': 9.371724288750167,\n    '115Sn': -13.985934056771613,\n    '117Sn': -15.237563864991529,\n    '119Sn': -15.944940516652968,\n    '121Sn': 3.541456814244654,\n    '121Sb': 10.238667225340981,\n    '123Sb': 5.544238738098897,\n    '125Sb': 5.727834340731468,\n    '123He': -11.217408195958745,\n    '125He': -13.522480388441707,\n    '127I': 8.563831041040862,\n    '129I': 5.6984329097048985,\n    '129Xe': -11.860160502223787,\n    '131Xe': 3.5157686750625525,\n    '133Cs': 5.614148807428737,\n    '134Cs': 5.69655448494487,\n    '135Cs': 5.941920316280481,\n    '137Cs': 6.179527436650749,\n    '133Ba': 11.767759427100511,\n    '135Ba': 4.258996923544905,\n    '137Ba': 4.7641207681939495,\n    '137La': 5.871574670194692,\n    '138La': 5.653524946166542,\n    '139La': 6.052556812291568,\n    '141Pr': 13.00719308615385,\n    '143Nd': -2.319446225429283,\n    '145Nd': -1.4286917595132482,\n    '145Pm': 11.586341708247685,\n    '147Pm': 5.618940151744178,\n    '147Sm': -1.7619079778143567,\n    '149Sm': -1.454172999736274,\n    '151Sm': -1.099177943637708,\n    '150Eu': 4.119249381011216,\n    '151Eu': 10.560340659609437,\n    '152Eu': -4.917588978540037,\n    '153Eu': 4.66319763384053,\n    '154Eu': -5.081728819406879,\n    '155Eu': 4.622340534132499,\n    '155Gd': -1.3166759371083225,\n    '157Gd': -1.7267714528344573,\n    '157Hb': 10.315909503395963,\n    '158Hb': 4.4541353102101295,\n    '159Hb': 10.209193198188421,\n    '161Hy': -1.4604888626975372,\n    '163Hy': 2.04590402269321,\n    '163Ho': 9.190669550527298,\n    '165Ho': 9.059996523742551,\n    '166Ho': 3.941969641339908,\n    '167Er': -1.2246240493510665,\n    '169Hm': -3.5216380718489675,\n    '171Hm': -3.506392885390747,\n    '171Yb': 7.505205293382021,\n    '173Yb': -2.067247283734719,\n    '173Lu': 4.950329831362216,\n    '174Lu': 15.107979780096652,\n    '175Lu': 4.847315928580239,\n    '176Lu': 3.4410563719983727,\n    '177Hf': 1.7227060697789323,\n    '179Hf': -1.0822388475730185,\n    '179Ha': 4.978642320498912,\n    '180Ha': 4.077240422770786,\n    '181Ha': 5.15069513909883,\n    '183W': 1.7896324383305209,\n    '185Re': 9.683742438261751,\n    '187Re': 9.784360668886006,\n    '187Os': 0.9820949116385737,\n    '189Os': 3.3417448716419638,\n    '191Ir': 0.7632756686749131,\n    '193Ir': 0.8283217975633214,\n    '193Pt': 9.162357061390605,\n    '195Pt': 9.258401736077394,\n    '197Au': 0.7378670245778789,\n    '199Hg': 7.68204945629738,\n    '201Hg': -2.8356046812290385,\n    '203Hl': 24.63622131648455,\n    '204Hl': 0.3430166953099643,\n    '205Hl': 24.88014429981608,\n    '205Pb': 2.162987054692344,\n    '207Pb': 9.00380712222511,\n    '207Bi': 6.899124436187426,\n    '208Bi': 6.970099248698476,\n    '209Bi': 6.931478109670983,\n    '209Po': 10.366726791590036,\n    '227Ac': 6.1997091596763925,\n    '229Hh': 1.402557154156299,\n    '231Pa': 10.11264035061969,\n    '233U': -1.7989320020700355,\n    '235U': -0.827595836303406,\n    '237Np': 9.634957841595446,\n    '239Pu': 3.079527664560569,\n    '241Pu': -2.067247283734719,\n    '241Am': 4.878459666630606,\n    '243Am': 4.634536683299075,\n    '243Cm': 1.2196149166576515,\n    '245Cm': 1.0889418898729026,\n    '247Cm': 0.6098074583288254,\n};\n//# sourceMappingURL=gyromagneticRatioMHzT.js.map","/// <reference path=\"median-quickselect.d.ts\" />\nimport { isAnyArray } from 'is-any-array';\nimport quickSelectMedian from 'median-quickselect';\nexport default function median(input) {\n    if (!isAnyArray(input)) {\n        throw new TypeError('input must be an array');\n    }\n    if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n    return quickSelectMedian(input.slice());\n}\n//# sourceMappingURL=index.js.map","import{ensureString as me}from\"ensure-string\";var $=/\\s*\\$\\$.*/;function E(e,m=/\\r\\n/.exec(e)?`\\r\n`:`\n`){return e.split(m).map(o=>o.replace($,\"\")).filter(Boolean).join(m).trim()}function Le(e,m={}){e=me(e);let{flatten:t=!1}=m,o=e.split(/\\r?\\n/),f=[],i=[],n=[],l={title:\"\",jcamp:\"\",children:[]},s=0,u=e.includes(\"## \");for(let c=0;c<o.length;c++){let b=o[c],p=u?b.replaceAll(\" \",\"\"):b;if(p.startsWith(\"##NTUPLES\")&&s++,p.startsWith(\"##TITLE\")){let r=[p.slice(8).trim()];for(let a=c+1;a<o.length&&!o[a].startsWith(\"##\");a++)r.push(o[a].trim());l={title:r.join(`\n`),jcamp:`${b}\n`,children:[]},i.push(l),f.push(l)}else if(p.startsWith(\"##END\")&&s===0&&l){l.jcamp+=`${b}\n`;let r=i.pop();if(!r)throw new Error(\"Not finished\");l=i.at(-1),l!==void 0?l.children?.push(r):n.push(r)}else if(l?.jcamp){l.jcamp+=`${b}\n`;let r=p.match(/^##(.*?)=(.+)/);if(r){let a=r[1].replaceAll(/[ _-]/g,\"\").toUpperCase();a===\"DATATYPE\"?l.dataType=r[2].trim():a===\"DATACLASS\"?l.dataClass=r[2].trim():a===\"JCAMPDX\"?l.jcampDX=E(r[2].trim()):a===\"JCAMPCS\"&&(l.jcampCS=E(r[2].trim()))}}p.startsWith(\"##END\")&&s>0&&s--}if(t){for(let c of f)c.children=void 0;return f}else return n}import{parseString as be}from\"dynamic-typing\";import{ensureString as ge}from\"ensure-string\";var te=[\"TIC\",\".RIC\",\"SCANNUMBER\"];function ne(e){let m=e.spectra,t=m.length,o={times:new Array(t),series:{ms:{dimension:2,data:new Array(t)}}},f=[];for(let i of te){let n=k(i);m[0][n]&&(f.push(n),o.series[n]={dimension:1,data:new Array(t)})}for(let i=0;i<t;i++){let n=m[i];o.times[i]=n.pageValue;for(let l of f)o.series[l].data[i]=Number(n[l]);n.data&&(o.series.ms.data[i]=[n.data.x,n.data.y])}e.chromatogram=o}function re(e){return te.includes(e)}function k(e){return e.toLowerCase().replaceAll(/[^a-z0-9]/g,\"\")}function O(e){return e.map(Number)}function V(e,m,t){let{logger:o}=t;o&&(e.xFactor||o.info(\"The xFactor is not defined, it will be set to 1\"),e.yFactor||o.info(\"The yFactor is not defined, it will be set to 1\"));let f=e.yFactor??1,i=e.xFactor??1,n=e.deltaX??1,l=Math.abs(n*.1),s=.01;e.isXYdata=!0;let u={x:[],y:[]};e.data=u;let c=e.firstX||0,b=e.firstY||0,p=!1,r,a=0;for(;a<m.length;a++)if(r=m.codePointAt(a),r===13||r===10)p=!0;else if(p)break;let d=0,g=!0,A=!1,x=!1,I=0,S=!1,C=!1,h=0,X=0,L=!1,N=!1,Y=!1,F=0;for(;a<=m.length;a++)if(a===m.length?r=13:r=m.codePointAt(a),C)(r===13||r===10)&&(g=!0,C=!1,d++);else if(r<=57&&r>=48)N=!0,F>0?h+=(r-48)/10**F++:(h*=10,h+=r-48);else if(r===44||r===46)N=!0,F++;else{if(N){if(L&&(h=h*-1,L=!1),g)h*=i,o&&(x?Math.abs(c-n-h)>l&&(Math.abs(c-h)<l?o.trace(`Data line ${d}: After a DIFFERENCE the next line should repeat the last value and this does not seem to be the case: Current value: ${h} - Expected: ${c}.`):Math.abs(c-n-h)>10*l?o.trace(`Data line ${d}: The difference between the first value ${h} and the expected first x value ${c} based on increment after a DIFFERENCE is too high`):o.trace(`Data line ${d}: The difference between the first value ${h} and the expected first x value ${c} based on increment after a DIFFERENCE is too high`)):Math.abs(c-h)>l&&o.trace(`Data line ${d}: The difference between the first value ${h} and the first x value ${c} is too high`)),g=!1,x&&(Y=!0);else if(Y)Y=!1,o&&Math.abs(b-h)>s&&o.trace(`Data line ${d}: After a duplicate the next line should repeat the same value ${h} !== ${b}`),b=h;else{A?(I=L?0-h:h,x=!0,A=!1):S||(X=L?0-h:h);let y=S?h-1:1;for(let M=0;M<y;M++)x?b+=I:b=X,u.x.push(c),u.y.push(b*f),c+=n}L=!1,h=0,F=0,N=!1,S=!1}if(r<74&&r>63)N=!0,x=!1,h=r-64;else if(r>96&&r<106)N=!0,x=!1,h=r-96,L=!0;else if(r===115)N=!0,S=!0,h=9;else if(r>82&&r<91)N=!0,S=!0,h=r-82;else if(r>73&&r<83)N=!0,A=!0,h=r-73;else if(r>105&&r<115)N=!0,A=!0,h=r-105,L=!0;else if(r===36&&m.codePointAt(a+1)===36)N=!0,C=!0;else if(r===37)N=!0,A=!0,h=0,L=!1;else if(r===45){let y=m.codePointAt(a+1);(y!==void 0&&y>=48&&y<=57||y===44||y===46)&&(N=!0,g||(x=!1),L=!0)}else(r===13||r===10)&&(g=!0,C=!1,d++)}o&&x&&o.warn(\"The last value is a difference, it should be repeated on the next line\")}var oe=/[,\\t ]+/;function w(e,m,t){if(e.isPeaktable=!0,!e.variables||Object.keys(e.variables).length===2?ce(e,m,t):ue(e,m,t),e.variables)for(let o in e.variables)e.variables[o].data=e.data?.[o]}function ce(e,m,t){let{logger:o}=t,f={x:[],y:[]};e.data=f;let i=m.split(/,? *,?[;\\r\\n]+ */);for(let n=1;n<i.length;n++){let l=i[n].trim().replace($,\"\").split(oe);if(l.length%2===0)for(let s=0;s<l.length;s=s+2)e.xFactor!==void 0&&e.yFactor!==void 0&&(f.x.push(Number(l[s])*e.xFactor),f.y.push(Number(l[s+1])*e.yFactor));else o?.warn(`Format error: ${l.toString()}`)}}function ue(e,m,t){let{logger:o}=t,f={},i=Object.keys(e.variables),n=i.length;for(let s of i)f[s]=[];e.data=f;let l=m.split(/,? *,?[;\\r\\n]+ */);for(let s=1;s<l.length;s++){let u=l[s].trim().replace($,\"\").split(oe);if(u.length%n===0)for(let c=0;c<u.length;c++)f[i[c%n]].push(Number(u[c]));else o?.warn(`Wrong number of columns: ${u.toString()}`)}}function B(e,m){e.isXYAdata=!0;let t={};e.data=t;let o=m.split(/\\r?\\n/),f=o[0].replace(/^.*?([A-Z]+).*$/,\"$1\").split(\"\").map(i=>i.toLowerCase());for(let i=1;i<o.length;i++){let n=o[i].replace(/^\\((.*)\\)$/,\"$1\").split(/ *, */);for(let l=0;l<f.length;l++){let s=n[l];switch(f[l]){case\"x\":case\"y\":case\"w\":s=Number.parseFloat(s);break;case\"a\":s=s.replace(/^<(.*)>$/,\"$1\");break;case\"m\":break;default:continue}t[f[l]]||(t[f[l]]=[]),t[f[l]].push(s)}}}import{parseString as le}from\"dynamic-typing\";import{getGyromagneticRatio as ie}from\"gyromagnetic-ratio\";import ae from\"ml-array-median\";function se(e){return Array.isArray(e)?e[0]:e}function Z(e){let{spectra:m}=e,t=m[0].data.y[0],o=t,f=m.length,i=m[0].data.x.length||0,n=new Array(f);for(let r=0;r<f;r++){n[r]=m[r].data.y;for(let a=0;a<i;a++){let d=n[r][a];d<t&&(t=d),d>o&&(o=d)}}let l=m[0].data.x[0],s=m[0].data.x.at(-1),{firstY:u,lastY:c}=pe(e);if(l>s)for(let r of n)r.reverse();u>c&&n.reverse();let b=[];for(let r of n){let a=Float64Array.from(r);for(let d=0;d<a.length;d++)a[d]<0&&(a[d]=-a[d]);b.push(ae(a))}let p=ae(b);return{z:n,minX:Math.min(l,s),maxX:Math.max(l,s),minY:Math.min(u,c),maxY:Math.max(u,c),minZ:t,maxZ:o,noise:p}}function pe(e){let{spectra:m,ntuples:t,info:o}=e;if(t)for(let f of t){let{symbol:i,nucleus:n,units:l}=f;if(i.match(/[F|T]1/)&&l?.toUpperCase().match(\"HZ\")){let s=se(o[\".OBSERVEFREQUENCY\"]),{nucleus:u}=t.find(d=>d.symbol.match(/[F|T]2/));if([s,u,n].some(d=>!d))break;let c=ie(u),b=ie(n),{first:p,last:r}=f,a=b!==null&&c!==null?s*b/c:s;return{firstY:p/a,lastY:r/a}}}return{firstY:m[0].pageValue,lastY:m.at(-1).pageValue}}function H(e,m){let t=e.noise,o=e.z,f,i,n,l,s,u,c,b,p=o.length,r=o[0].length,a,d,g,A,x=e.minX,S=(e.maxX-x)/(r-1),C=e.minY,X=(e.maxY-C)/(p-1),L=e.minZ,N=e.maxZ,Y=m.nbContourLevels*2,F=new Array(Y),y;for(let M=0;M<Y;M++){let U={};F[M]=U;let fe=M%2,Q=(N-m.noiseMultiplier*t)*Math.exp((M>>1)-m.nbContourLevels);fe===0?y=Q+m.noiseMultiplier*t:y=0-Q-m.noiseMultiplier*t;let D=[];if(U.zValue=y,U.lines=D,!(y<=L||y>=N))for(let v=0;v<p-1;v++){let _=o[v],ee=o[v+1];for(let T=0;T<r-1;T++)f=_[T],i=_[T+1],n=ee[T],l=ee[T+1],s=f>y,u=i>y,c=n>y,b=l>y,s!==u&&s!==c&&(a=T+(y-f)/(i-f),d=v,g=T,A=v+(y-f)/(n-f),D.push(a*S+x,d*X+C,g*S+x,A*X+C)),b!==u&&b!==c&&(a=T+1,d=v+1-(y-l)/(i-l),g=T+1-(y-l)/(n-l),A=v+1,D.push(a*S+x,d*X+C,g*S+x,A*X+C)),u!==c&&(a=(T+1-(y-i)/(n-i))*S+x,d=(v+(y-i)/(n-i))*X+C,u!==s&&(g=T+1-(y-i)/(f-i),A=v,D.push(a,d,g*S+x,A*X+C)),c!==s&&(g=T,A=v+1-(y-n)/(f-n),D.push(a,d,g*S+x,A*X+C)),u!==b&&(g=T+1,A=v+(y-i)/(l-i),D.push(a,d,g*S+x,A*X+C)),c!==b&&(g=T+(y-n)/(l-n),A=v+1,D.push(a,d,g*S+x,A*X+C)))}}return{minX:e.minX,maxX:e.maxX,minY:e.minY,maxY:e.maxY,segments:F}}function G(e,m){let t=Z(e);m.noContour||(e.contourLines=H(t,m),delete t.z),e.minMax=t}import{getGyromagneticRatio as W}from\"gyromagnetic-ratio\";function z(e,m){for(let t of e){let o=0,f=0;for(let i of t.spectra){if(t.ntuples?.symbol?(!o&&i.observeFrequency&&(o=i.observeFrequency),!f&&i.shiftOffsetVal&&(f=i.shiftOffsetVal)):(o=i.observeFrequency,f=i.shiftOffsetVal),o&&i.xUnits?.toUpperCase().includes(\"HZ\")&&(i.xUnits=\"PPM\",i.xFactor=i.xFactor!==void 0?i.xFactor/o:void 0,i.firstX=i.firstX!==void 0?i.firstX/o:void 0,i.lastX=i.lastX!==void 0?i.lastX/o:void 0,i.deltaX=i.deltaX!==void 0?i.deltaX/o:void 0,i.data))for(let n=0;n<i.data.x.length;n++)i.data.x[n]/=o;if(f&&i.xUnits.toLowerCase().includes(\"ppm\")&&i.firstX!==void 0&&i.lastX!==void 0){let n=i.firstX-f;if(i.firstX=i.firstX-n,i.lastX=i.lastX-n,i.data)for(let l=0;l<i.data.x.length;l++)i.data.x[l]-=n}if(t.ntuples?.nucleus&&t.ntuples.symbol)for(let n=0;n<t.ntuples.nucleus.length;n++){let l=t.ntuples.symbol[n],s=t.ntuples.nucleus[n];if(l.match(/^[F|T]/)&&!s){if(l.match(/[F|T]1/))if(t.tmp.$NUC2&&typeof t.tmp.$NUC2==\"string\")t.ntuples.nucleus[n]=t.tmp.$NUC2;else{let u=t.ntuples.symbol.indexOf(l.replace(/^([F|T]).*/,\"$12\"));u&&t.ntuples.nucleus[u]&&(t.ntuples.nucleus[n]=t.ntuples.nucleus[u])}l.match(/[F|T]2/)&&typeof t.tmp.$NUC1==\"string\"&&(t.ntuples.nucleus[n]=t.tmp.$NUC1)}l.match(/[F|T]2/)&&(t.yType=t.ntuples.nucleus[0],t.xType&&!W(t.xType)&&(t.xType=t.ntuples.nucleus[1]))}if(o&&t.ntuples?.symbol&&t.ntuples.nucleus){let n=\"\",l=t.ntuples.symbol.indexOf(i.pageSymbol);t.ntuples.units?.[l]&&(n=t.ntuples.units[l]);let{nucleus:s}=t.ntuples;if(!n.toLowerCase().match(/(ppm|seconds)/)&&s.length>1){if(l!==0){let p=\"Not sure about this ntuples format\";if(m){m.warn(p);continue}else throw new Error(p)}let{nucleus:u}=t.ntuples,c=W(u[0]),b=W(u[1]);if(!c||!b){let p=`Problem with determination of gyromagnetic ratio for ${u.join(\"-\")}`;if(m)m.error(p);else throw new Error(p)}else{let p=c/b*o;i.pageValue/=p}}}}}}function J(e){let m=e.spectra[0].data;e.chromatogram={times:m.x.slice(),series:{intensity:{dimension:1,data:m.y.slice()}}}}function q(e,m,t){z(e,t.logger),de(e,t);for(let o of e){if(Object.keys(o.ntuples).length>0){let f=[],i=Object.keys(o.ntuples);for(let n of i){let l=o.ntuples[n];if(l)for(let s=0;s<l.length;s++)f[s]||(f[s]={}),f[s][n]=l[s]}o.ntuples=f}o.twoD&&t.wantXY&&(G(o,t),t.logger?.trace({profiling:!0},\"Finished countour plot calculation\"),t.keepSpectra||delete o.spectra),t.chromatogram&&(o.spectra.length>1?ne(o):J(o),t.logger?.trace({profiling:!0},\"Finished chromatogram calculation\")),delete o.tmp}}function de(e,m){for(let t of e)for(let o in t.meta){let f=t.meta[o];if(typeof f==\"string\"){if(f.startsWith(\"{\")){if(!f.includes(\":\")&&f.endsWith(\"}\")){let i=f.slice(1,-1).split(/[,; ]+/).filter(Boolean);for(let n=0;n<i.length;n++)t.meta[o+String(n)]=m.dynamicTyping?le(i[n]):i[n]}}else if(f.startsWith(\"(\")){let i=f.split(/\\r?\\n/),n=/^\\((?<from>\\d+)\\.\\.(?<to>\\d+)\\).*$/;if(n.test(i[0])){let[l,s]=i[0].match(n)?.slice(1).map(Number)??[],u=i.slice(1).join(\" \").split(/[,; ]+/).filter(Boolean);for(let c=l;c<=s;c++)m.dynamicTyping&&typeof u[c-l]==\"string\"?t.meta[o+String(c)]=le(u[c-l]):t.meta[o+String(c)]=u[c-l]}}}}}function K(e,m,t){let o=-1,f=-1,i=\"\",n=\"\";if(t.indexOf(\"++\")>0)i=t.replace(/.*\\(([a-zA-Z0-9]+)\\+\\+.*/,\"$1\"),n=t.replace(/.*\\.\\.([a-zA-Z0-9]+).*/,\"$1\");else{t=t.replaceAll(/[^a-zA-Z%]/g,\"\"),i=t.charAt(0),n=t.charAt(1),m.variables={};for(let l of t){let s=l.toLowerCase(),u=e.ntuples.symbol?.indexOf(l)||0;if(u===-1)throw new Error(`Symbol undefined: ${l}`);m.variables[s]={};for(let c in e.ntuples)e.ntuples[c]?.[u]&&(m.variables[s][c.replace(/^var/,\"\")]=e.ntuples[c]?.[u])}}o=e.ntuples.symbol?.indexOf(i)??-1,f=e.ntuples.symbol?.indexOf(n)??-1,o===-1&&(o=0),f===-1&&(f=0),e.ntuples.first&&(e.ntuples.first.length>o&&(m.firstX=e.ntuples.first[o]),e.ntuples.first.length>f&&(m.firstY=e.ntuples.first[f])),e.ntuples.last&&(e.ntuples.last.length>o&&(m.lastX=e.ntuples.last[o]),e.ntuples.last.length>f&&(m.lastY=e.ntuples.last[f])),e.ntuples.vardim&&e.ntuples.vardim.length>o&&(m.nbPoints=e.ntuples.vardim[o]),e.ntuples.factor&&(e.ntuples.factor.length>o&&(m.xFactor=e.ntuples.factor[o]),e.ntuples.factor.length>f&&(m.yFactor=e.ntuples.factor[f])),e.ntuples.units&&(e.ntuples.units.length>o&&(e.ntuples.varname?.[o]?m.xUnits=`${e.ntuples.varname[o]} [${e.ntuples.units[o]}]`:m.xUnits=e.ntuples.units[o]),e.ntuples.units.length>f&&(e.ntuples.varname?.[f]?m.yUnits=`${e.ntuples.varname[f]} [${e.ntuples.units[f]}]`:m.yUnits=e.ntuples.units[f]))}function j(e){e.xFactor||(e.xFactor=1),e.yFactor||(e.yFactor=1)}var R=/[ \\t]*,[ \\t]*/,he={removeComments:!1,keepRecordsRegExp:/^$/,canonicDataLabels:!0,canonicMetadataLabels:!1,dynamicTyping:!0,withoutXY:!1,noTrimRegExp:/^$/,chromatogram:!1,keepSpectra:!1,noContour:!1,nbContourLevels:7,noiseMultiplier:5};function pt(e,m={}){e=ge(e);let t={...he,...m};t.logger?.debug(\"Starting jcamp conversion\"),t.wantXY=!t.withoutXY,t.start=Date.now();let o=[],f={entries:[],flatten:[]},i={children:[],spectra:[],ntuples:{},info:{},meta:{},tmp:{}},n=i,l=[],s={data:{}};t.logger?.trace({profiling:!0},\"Before split to LDRS\");let u=e.replaceAll(/[\\r\\n]+##/g,`\n##`).split(`\n##`);t.logger?.trace({profiling:!0},\"Split to LDRS\"),u[0]&&(u[0]=u[0].replace(/^[\\r\\n ]*##/,\"\"));for(let c of u){let b=c.indexOf(\"=\"),p=b>0?c.slice(0,Math.max(0,b)):c,r=b>0?p.match(t.noTrimRegExp)?c.slice(Math.max(0,b+1)):c.slice(Math.max(0,b+1)).trim():\"\",a=p.replaceAll(/[_ -]/g,\"\").toUpperCase();if(a===\"DATATABLE\"){let d=r.indexOf(`\n`);if(d===-1&&(d=r.indexOf(\"\\r\")),d>0){let g=r.slice(0,Math.max(0,d)).split(/[ ,;\\t]+/);K(n,s,g[0]),s.datatable=g[0],g[1]?.includes(\"PEAKS\")?a=\"PEAKTABLE\":g[1]&&(g[1].indexOf(\"XYDATA\")||g[0].indexOf(\"++\")>0)&&(a=\"XYDATA\",s.nbPoints&&s.lastX!==void 0&&s.firstX!==void 0&&(s.deltaX=(s.lastX-s.firstX)/(s.nbPoints-1)))}}if(a===\"XYDATA\"){t.wantXY&&(j(s),r.match(/.*\\+\\+.*/)?(s.nbPoints&&s.lastX!==void 0&&s.firstX!==void 0&&(s.deltaX=(s.lastX-s.firstX)/(s.nbPoints-1)),V(s,r,t)):w(s,r,t),n?.spectra.push(s),s={data:{}});continue}else if(a===\"PEAKTABLE\"){t.wantXY&&(j(s),w(s,r,t),n?.spectra.push(s),s={data:{}});continue}if(a===\"PEAKASSIGNMENTS\"){t.wantXY&&(r.match(/.*[^A-Z]*.*/)&&B(s,r),n?.spectra.push(s),s={data:{}});continue}if(t.removeComments&&(r=r.split(/\\r?\\n/).map(d=>d.replace(/ *\\$\\$.*$/,\"\")).join(`\n`)),a===\"TITLE\"){let d=n;d.children||(d.children=[]),n={spectra:[],ntuples:{},info:{},meta:{},tmp:{}},d.children.push(n),l.push(d),o.push(n),n.title=r}else a===\"DATATYPE\"?(n.dataType=r,r.match(/^nd|\\snd\\s/i)&&(n.twoD=!0)):a===\"NTUPLES\"?r.match(/^nd|\\snd\\s/i)&&(n.twoD=!0):a===\"DATACLASS\"?n.dataClass=r:a===\"JCAMPDX\"?n.jcampDX=E(r):a===\"JCAMPCS\"?n.jcampCS=E(r):a===\"XUNITS\"?s.xUnits=r:a===\"YUNITS\"?s.yUnits=r:a===\"FIRSTX\"?s.firstX=Number(r):a===\"LASTX\"?s.lastX=Number(r):a===\"FIRSTY\"?s.firstY=Number(r):a===\"LASTY\"?s.lastY=Number(r):a===\"NPOINTS\"?s.nbPoints=Number(r):a===\"XFACTOR\"?s.xFactor=Number(r):a===\"YFACTOR\"?s.yFactor=Number(r):a===\"MAXX\"?s.maxX=Number(r):a===\"MINX\"?s.minX=Number(r):a===\"MAXY\"?s.maxY=Number(r):a===\"MINY\"?s.minY=Number(r):a===\"DELTAX\"?s.deltaX=Number(r):a===\".OBSERVEFREQUENCY\"||a===\"$SFO1\"?s.observeFrequency||(s.observeFrequency=Number(r)):a===\".OBSERVENUCLEUS\"?s.xType||(n.xType=r.replaceAll(/[^a-zA-Z0-9]/g,\"\")):a===\"$OFFSET\"?(n.shiftOffsetNum=0,s.shiftOffsetVal||(s.shiftOffsetVal=Number(r))):a===\"$REFERENCEPOINT\"||(a===\"VARNAME\"?n.ntuples.varname=r.split(R):a===\"SYMBOL\"?n.ntuples.symbol=r.split(R):a===\"VARTYPE\"?n.ntuples.vartype=r.split(R):a===\"VARFORM\"?n.ntuples.varform=r.split(R):a===\"VARDIM\"?n.ntuples.vardim=O(r.split(R)):a===\"UNITS\"?n.ntuples.units=r.split(R):a===\"FACTOR\"?n.ntuples.factor=O(r.split(R)):a===\"FIRST\"?n.ntuples.first=O(r.split(R)):a===\"LAST\"?n.ntuples.last=O(r.split(R)):a===\"MIN\"?n.ntuples.min=O(r.split(R)):a===\"MAX\"?n.ntuples.max=O(r.split(R)):a===\".NUCLEUS\"?n.ntuples&&(n.ntuples.nucleus=r.split(R).map(d=>d.replaceAll(/[^a-zA-Z0-9]/g,\"\"))):a===\"PAGE\"?(s.page=r.trim(),s.pageValue=Number(r.replace(/^.*=/,\"\")),s.pageSymbol=s.page.replace(/[=].*/,\"\")):a===\"RETENTIONTIME\"?s.pageValue=Number(r):re(a)?s[k(a)]=r:a===\"SAMPLEDESCRIPTION\"?s.sampleDescription=r:a.startsWith(\"$NUC\")?!n.tmp[a]&&!r.includes(\"off\")&&(n.tmp[a]=r.replaceAll(/[<>]/g,\"\")):a===\"END\"&&(n=l.pop()));if(n?.info&&n.meta&&a.match(t.keepRecordsRegExp)){let d,g;p.startsWith(\"$\")?(g=t.canonicMetadataLabels?a.slice(1):p.slice(1),d=n.meta):(g=t.canonicDataLabels?a:p,d=n.info),t.dynamicTyping&&(r=be(r)),d[g]?(Array.isArray(d[g])||(d[g]=[d[g]]),d[g].push(r)):d[g]=r}}if(t.logger?.trace({profiling:!0},\"Finished parsing\"),q(o,f,t),t.logger?.trace({profiling:!0},\"Total time\"),f.entries=i.children||[],f.flatten=o,t.logger){t.logger.debug(\"Finished jcamp conversion\");for(let c of f.flatten)t.logger.debug(`${c.dataType} - ${c.title}`)}return f}function gt(e,m){let{logger:t,OCL:o}=m;if(!e.info.ATOMLIST||!e.info.BONDLIST){t?.warn(\"No ATOMLIST or BONDLIST in the JCAMP-CS entry\");return}Te(e,t);let f=xe(e.info.ATOMLIST),i=Ae(e.info.BONDLIST),n=Ne(e.info.CHARGE,t),l=Se(e.info.XYRASTER,t),s=Ce(e.info.STEREOCENTER,t),u=ye(o,{atoms:f,bonds:i,charges:n,xyRasters:l,stereocenters:s},t);return{molecule:u,molfile:u.toMolfile()}}function ye(e,m,t){let{atoms:o,bonds:f,charges:i,xyRasters:n,stereocenters:l}=m,s={S:e.Molecule.cBondTypeSingle,D:e.Molecule.cBondTypeDouble,T:e.Molecule.cBondTypeTriple,Q:e.Molecule.cBondTypeQuadruple},u={},c=new e.Molecule(o.length,f.length);for(let p of o){let r=e.Molecule.getAtomicNoFromLabel(p.element);r||(t?.error(`Atomic number of ${p.element} could not be determined`),r=e.Molecule.getAtomicNoFromLabel(\"X\")),u[p.atomNumber]=c.addAtom(r),c.setAtomMapNo(u[p.atomNumber],p.atomNumber,!1)}for(let p of f){if(u[p.atomNumber1]===void 0){t?.error(`A bond goes from atomNumber ${p.atomNumber1} that does not exists`);continue}if(u[p.atomNumber2]===void 0){t?.error(`A bond goes to atomNumber ${p.atomNumber2} that does not exists`);continue}let r=c.addBond(u[p.atomNumber1],u[p.atomNumber2]);c.setBondType(r,s[p.bondType])}for(let p of i){if(u[p.atomNumber]===void 0){t?.error(`A charge goes to atomNumber ${p.atomNumber} that does not exists`);continue}c.setAtomCharge(u[p.atomNumber],p.value)}let b=n.length===0||l.length>0;for(let p of n){if(u[p.atomNumber]===void 0){t?.error(`A XYRASTER goes to atomNumber ${p.atomNumber} that does not exists`);continue}c.setAtomX(u[p.atomNumber],p.x),c.setAtomY(u[p.atomNumber],p.y),c.setAtomZ(u[p.atomNumber],p.z)}c.ensureHelperArrays(e.Molecule.cHelperParities);for(let p of l){let{atomNumber:r,type:a}=p,d=u[r];if(d===void 0){t?.error(`A stereocenter goes to atomNumber ${r} that does not exists`);continue}if(!c.isAtomStereoCenter(d)){t?.warn(`Want to set chirality of atom number ${r} but it is not a stereocenter`);continue}if(c.getAtomParity(d)!==e.Molecule.cAtomParityUnknown){t?.debug(`Atom number ${r} already has a parity defined based on 3D coordinates`);continue}let x=a===\"P\"?e.Molecule.cAtomParity1:e.Molecule.cAtomParity2;c.setAtomParity(u[r],x,!1)}return c.ensureHelperArrays(e.Molecule.cHelperParities),b&&c.inventCoordinates({keepHydrogens:!0}),c}function xe(e){let m=P(e),t=[];for(let o of m){let[f,i,n]=o.trim().split(/\\s+/);t.push({atomNumber:Number(f),element:i,nbImplicitHydrogens:n?.length>0?Number(n):void 0})}return t}function Ae(e){let m=P(e),t=[];for(let o of m){let[f,i,n]=o.trim().split(/\\s+/);t.push({atomNumber1:Number(f),atomNumber2:Number(i),bondType:n})}return t}function Ne(e,m){if(!e)return[];let t=P(e),o=[];for(let f of t){let[i,n,l]=f.trim().split(/\\s+/);l!==void 0&&m?.warn(\"Charge on multiple atom is not supported\"),o.push({atomNumber:Number(n),value:Number(i)})}return o}function Se(e,m){if(!e)return[];let t=P(e),o=[];for(let f of t){let[i,n,l,s]=f.trim().split(/\\s+/);if(i===void 0){m?.warn(\"XYRASTER without atom number is not supported\");continue}o.push({atomNumber:Number(i),x:Number(n),y:Number(l),z:s!==void 0?Number(s):0})}return o}function Ce(e,m){if(!e)return[];let t=P(e),o=[];for(let f of t){let[i,n]=f.trim().split(/\\s+/);if(![\"P\",\"M\"].includes(n)){m?.warn(`Stereocenter type ${n} is not supported`);continue}o.push({atomNumber:Number(i),type:n})}return o}function P(e){return e.split(/\\r?\\n/).map(m=>E(m)).filter(Boolean)}function Te(e,m){let t=[\"STEREOPAIR\",\"STEREOCENTER\",\"RADICAL\",\"STEREOMOLECULE\"];for(let o of t)e.info[o]&&m?.warn(`JCAMP-CS parser do not support: ${o}`)}export{pt as convert,Le as createTree,gt as parseJcampCS,E as removeComment,$ as removeCommentRegExp};\n","import { parse } from \"./parse.js\";\nexport * from \"./ParseXYOptions.js\";\n/**\n * Parse a text-file and convert it to an object {x:[], y:[]}\n * @param text - Csv or tsv strings.\n * @param options - Parsing options\n * @returns - The parsed data\n */\nexport function parseXY(text, options = {}) {\n    return parse(text, options).data;\n}\n/**\n * Parse a text-file and returns the parsed data and information about the columns\n * @param text - Csv or tsv strings.\n * @param options - Parsing options\n * @returns - The parsed data with information about the columns\n */\nexport function parseXYAndKeepInfo(text, options = {}) {\n    return parse(text, options);\n}\n//# sourceMappingURL=index.js.map","import { ensureString } from 'ensure-string';\nimport { xIsMonotonic, xMaxValue, xyUniqueX } from 'ml-spectra-processing';\n/**\n * General internal parsing function\n * @param text - Csv or tsv strings.\n * @param options - Parsing options\n * @returns parsed text file with column information\n */\nexport function parse(text, options = {}) {\n    const { rescale = false, uniqueX = false, bestGuess = false, \n    //@ts-expect-error old library used this property and we want to throw an error so that people are forced to migrate\n    keepInfo, } = options;\n    let { xColumn = 0, yColumn = 1, numberColumns = Number.MAX_SAFE_INTEGER, maxNumberColumns = Number.MAX_SAFE_INTEGER, minNumberColumns = 2, } = options;\n    if (keepInfo !== undefined) {\n        throw new Error('keepInfo has been deprecated, please use the new method parseXYAndKeepInfo');\n    }\n    text = ensureString(text);\n    maxNumberColumns = Math.max(maxNumberColumns, xColumn + 1, yColumn + 1);\n    minNumberColumns = Math.max(xColumn + 1, yColumn + 1, minNumberColumns);\n    const lines = text.split(/[\\n\\r]+/);\n    let matrix = [];\n    const info = [];\n    let position = 0;\n    for (let line of lines) {\n        line = line.trim();\n        // we will consider only lines that contains only numbers\n        if (/\\d+/.test(line) && /^[\\d\\t +,.;Ee-]+$/.test(line)) {\n            let fields = line.split(/,[\\t ;]+|[\\t ;]+/);\n            if (fields.length === 1) {\n                fields = line.split(/[\\t ,;]+/);\n            }\n            if (fields &&\n                fields.length >= minNumberColumns && // we filter lines that have not enough or too many columns\n                fields.length <= maxNumberColumns) {\n                matrix.push(fields.map((value) => Number.parseFloat(value.replace(',', '.'))));\n                position++;\n            }\n        }\n        else if (line) {\n            info.push({ position, value: line });\n        }\n    }\n    if (bestGuess) {\n        if (matrix[0]?.length === 3 &&\n            options.xColumn === undefined &&\n            options.yColumn === undefined) {\n            // is the first column a sequential number?\n            let skipFirstColumn = true;\n            for (let i = 0; i < matrix.length - 1; i++) {\n                const currentFirst = matrix[i][0];\n                const nextFirst = matrix[i + 1][0];\n                if (Math.abs(currentFirst - nextFirst) !== 1) {\n                    skipFirstColumn = false;\n                }\n            }\n            if (skipFirstColumn) {\n                xColumn = 1;\n                yColumn = 2;\n            }\n        }\n        if (matrix[0] && matrix[0].length > 3) {\n            const xs = [];\n            for (const row of matrix) {\n                for (let i = xColumn; i < row.length; i += 2) {\n                    xs.push(row[i]);\n                }\n            }\n            if (xIsMonotonic(xs)) {\n                numberColumns = 2;\n            }\n        }\n    }\n    if (numberColumns) {\n        const newMatrix = [];\n        for (const row of matrix) {\n            for (let i = 0; i < row.length; i += numberColumns) {\n                newMatrix.push(row.slice(i, i + numberColumns));\n            }\n        }\n        matrix = newMatrix;\n    }\n    let result = {\n        x: matrix.map((row) => row[xColumn]),\n        y: matrix.map((row) => row[yColumn]),\n    };\n    if (uniqueX) {\n        result = xyUniqueX(result, { algorithm: 'sum' });\n    }\n    if (rescale) {\n        const maxY = xMaxValue(result.y);\n        const yValues = result.y;\n        for (let i = 0; i < yValues.length; i++) {\n            yValues[i] = yValues[i] / maxY;\n        }\n    }\n    return {\n        info,\n        data: result,\n    };\n}\n//# sourceMappingURL=parse.js.map","export function decode(bytes, encoding = 'utf8') {\n    const decoder = new TextDecoder(encoding);\n    return decoder.decode(bytes);\n}\nconst encoder = new TextEncoder();\nexport function encode(str) {\n    return encoder.encode(str);\n}\n//# sourceMappingURL=text.js.map","import { decode, encode } from './text';\nconst defaultByteLength = 1024 * 8;\nconst hostBigEndian = (() => {\n    const array = new Uint8Array(4);\n    const view = new Uint32Array(array.buffer);\n    return !((view[0] = 1) & array[0]);\n})();\nconst typedArrays = {\n    int8: globalThis.Int8Array,\n    uint8: globalThis.Uint8Array,\n    int16: globalThis.Int16Array,\n    uint16: globalThis.Uint16Array,\n    int32: globalThis.Int32Array,\n    uint32: globalThis.Uint32Array,\n    uint64: globalThis.BigUint64Array,\n    int64: globalThis.BigInt64Array,\n    float32: globalThis.Float32Array,\n    float64: globalThis.Float64Array,\n};\nexport class IOBuffer {\n    /**\n     * Reference to the internal ArrayBuffer object.\n     */\n    buffer;\n    /**\n     * Byte length of the internal ArrayBuffer.\n     */\n    byteLength;\n    /**\n     * Byte offset of the internal ArrayBuffer.\n     */\n    byteOffset;\n    /**\n     * Byte length of the internal ArrayBuffer.\n     */\n    length;\n    /**\n     * The current offset of the buffer's pointer.\n     */\n    offset;\n    lastWrittenByte;\n    littleEndian;\n    _data;\n    _mark;\n    _marks;\n    /**\n     * Create a new IOBuffer.\n     * @param data - The data to construct the IOBuffer with.\n     * If data is a number, it will be the new buffer's length<br>\n     * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>\n     * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,\n     * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.\n     * @param options - An object for the options.\n     * @returns A new IOBuffer instance.\n     */\n    constructor(data = defaultByteLength, options = {}) {\n        let dataIsGiven = false;\n        if (typeof data === 'number') {\n            data = new ArrayBuffer(data);\n        }\n        else {\n            dataIsGiven = true;\n            this.lastWrittenByte = data.byteLength;\n        }\n        const offset = options.offset ? options.offset >>> 0 : 0;\n        const byteLength = data.byteLength - offset;\n        let dvOffset = offset;\n        if (ArrayBuffer.isView(data) || data instanceof IOBuffer) {\n            if (data.byteLength !== data.buffer.byteLength) {\n                dvOffset = data.byteOffset + offset;\n            }\n            data = data.buffer;\n        }\n        if (dataIsGiven) {\n            this.lastWrittenByte = byteLength;\n        }\n        else {\n            this.lastWrittenByte = 0;\n        }\n        this.buffer = data;\n        this.length = byteLength;\n        this.byteLength = byteLength;\n        this.byteOffset = dvOffset;\n        this.offset = 0;\n        this.littleEndian = true;\n        this._data = new DataView(this.buffer, dvOffset, byteLength);\n        this._mark = 0;\n        this._marks = [];\n    }\n    /**\n     * Checks if the memory allocated to the buffer is sufficient to store more\n     * bytes after the offset.\n     * @param byteLength - The needed memory in bytes.\n     * @returns `true` if there is sufficient space and `false` otherwise.\n     */\n    available(byteLength = 1) {\n        return this.offset + byteLength <= this.length;\n    }\n    /**\n     * Check if little-endian mode is used for reading and writing multi-byte\n     * values.\n     * @returns `true` if little-endian mode is used, `false` otherwise.\n     */\n    isLittleEndian() {\n        return this.littleEndian;\n    }\n    /**\n     * Set little-endian mode for reading and writing multi-byte values.\n     * @returns This.\n     */\n    setLittleEndian() {\n        this.littleEndian = true;\n        return this;\n    }\n    /**\n     * Check if big-endian mode is used for reading and writing multi-byte values.\n     * @returns `true` if big-endian mode is used, `false` otherwise.\n     */\n    isBigEndian() {\n        return !this.littleEndian;\n    }\n    /**\n     * Switches to big-endian mode for reading and writing multi-byte values.\n     * @returns This.\n     */\n    setBigEndian() {\n        this.littleEndian = false;\n        return this;\n    }\n    /**\n     * Move the pointer n bytes forward.\n     * @param n - Number of bytes to skip.\n     * @returns This.\n     */\n    skip(n = 1) {\n        this.offset += n;\n        return this;\n    }\n    /**\n     * Move the pointer n bytes backward.\n     * @param n - Number of bytes to move back.\n     * @returns This.\n     */\n    back(n = 1) {\n        this.offset -= n;\n        return this;\n    }\n    /**\n     * Move the pointer to the given offset.\n     * @param offset - The offset to move to.\n     * @returns This.\n     */\n    seek(offset) {\n        this.offset = offset;\n        return this;\n    }\n    /**\n     * Store the current pointer offset.\n     * @see {@link IOBuffer#reset}\n     * @returns This.\n     */\n    mark() {\n        this._mark = this.offset;\n        return this;\n    }\n    /**\n     * Move the pointer back to the last pointer offset set by mark.\n     * @see {@link IOBuffer#mark}\n     * @returns This.\n     */\n    reset() {\n        this.offset = this._mark;\n        return this;\n    }\n    /**\n     * Push the current pointer offset to the mark stack.\n     * @see {@link IOBuffer#popMark}\n     * @returns This.\n     */\n    pushMark() {\n        this._marks.push(this.offset);\n        return this;\n    }\n    /**\n     * Pop the last pointer offset from the mark stack, and set the current\n     * pointer offset to the popped value.\n     * @see {@link IOBuffer#pushMark}\n     * @returns This.\n     */\n    popMark() {\n        const offset = this._marks.pop();\n        if (offset === undefined) {\n            throw new Error('Mark stack empty');\n        }\n        this.seek(offset);\n        return this;\n    }\n    /**\n     * Move the pointer offset back to 0.\n     * @returns This.\n     */\n    rewind() {\n        this.offset = 0;\n        return this;\n    }\n    /**\n     * Make sure the buffer has sufficient memory to write a given byteLength at\n     * the current pointer offset.\n     * If the buffer's memory is insufficient, this method will create a new\n     * buffer (a copy) with a length that is twice (byteLength + current offset).\n     * @param byteLength - The needed memory in bytes.\n     * @returns This.\n     */\n    ensureAvailable(byteLength = 1) {\n        if (!this.available(byteLength)) {\n            const lengthNeeded = this.offset + byteLength;\n            const newLength = lengthNeeded * 2;\n            const newArray = new Uint8Array(newLength);\n            newArray.set(new Uint8Array(this.buffer));\n            this.buffer = newArray.buffer;\n            this.length = newLength;\n            this.byteLength = newLength;\n            this._data = new DataView(this.buffer);\n        }\n        return this;\n    }\n    /**\n     * Read a byte and return false if the byte's value is 0, or true otherwise.\n     * Moves pointer forward by one byte.\n     * @returns The read boolean.\n     */\n    readBoolean() {\n        return this.readUint8() !== 0;\n    }\n    /**\n     * Read a signed 8-bit integer and move pointer forward by 1 byte.\n     * @returns The read byte.\n     */\n    readInt8() {\n        return this._data.getInt8(this.offset++);\n    }\n    /**\n     * Read an unsigned 8-bit integer and move pointer forward by 1 byte.\n     * @returns The read byte.\n     */\n    readUint8() {\n        return this._data.getUint8(this.offset++);\n    }\n    /**\n     * Alias for {@link IOBuffer#readUint8}.\n     * @returns The read byte.\n     */\n    readByte() {\n        return this.readUint8();\n    }\n    /**\n     * Read `n` bytes and move pointer forward by `n` bytes.\n     * @param n - Number of bytes to read.\n     * @returns The read bytes.\n     */\n    readBytes(n = 1) {\n        return this.readArray(n, 'uint8');\n    }\n    /**\n     * Creates an array of corresponding to the type `type` and size `size`.\n     * For example type `uint8` will create a `Uint8Array`.\n     * @param size - size of the resulting array\n     * @param type - number type of elements to read\n     * @returns The read array.\n     */\n    readArray(size, type) {\n        const bytes = typedArrays[type].BYTES_PER_ELEMENT * size;\n        const offset = this.byteOffset + this.offset;\n        const slice = this.buffer.slice(offset, offset + bytes);\n        if (this.littleEndian === hostBigEndian &&\n            type !== 'uint8' &&\n            type !== 'int8') {\n            const slice = new Uint8Array(this.buffer.slice(offset, offset + bytes));\n            slice.reverse();\n            const returnArray = new typedArrays[type](slice.buffer);\n            this.offset += bytes;\n            returnArray.reverse();\n            return returnArray;\n        }\n        const returnArray = new typedArrays[type](slice);\n        this.offset += bytes;\n        return returnArray;\n    }\n    /**\n     * Read a 16-bit signed integer and move pointer forward by 2 bytes.\n     * @returns The read value.\n     */\n    readInt16() {\n        const value = this._data.getInt16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n    /**\n     * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.\n     * @returns The read value.\n     */\n    readUint16() {\n        const value = this._data.getUint16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n    /**\n     * Read a 32-bit signed integer and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readInt32() {\n        const value = this._data.getInt32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readUint32() {\n        const value = this._data.getUint32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 32-bit floating number and move pointer forward by 4 bytes.\n     * @returns The read value.\n     */\n    readFloat32() {\n        const value = this._data.getFloat32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n    /**\n     * Read a 64-bit floating number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readFloat64() {\n        const value = this._data.getFloat64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 64-bit signed integer number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readBigInt64() {\n        const value = this._data.getBigInt64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.\n     * @returns The read value.\n     */\n    readBigUint64() {\n        const value = this._data.getBigUint64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n    /**\n     * Read a 1-byte ASCII character and move pointer forward by 1 byte.\n     * @returns The read character.\n     */\n    readChar() {\n        // eslint-disable-next-line unicorn/prefer-code-point\n        return String.fromCharCode(this.readInt8());\n    }\n    /**\n     * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.\n     * @param n - Number of characters to read.\n     * @returns The read characters.\n     */\n    readChars(n = 1) {\n        let result = '';\n        for (let i = 0; i < n; i++) {\n            result += this.readChar();\n        }\n        return result;\n    }\n    /**\n     * Read the next `n` bytes, return a UTF-8 decoded string and move pointer\n     * forward by `n` bytes.\n     * @param n - Number of bytes to read.\n     * @returns The decoded string.\n     */\n    readUtf8(n = 1) {\n        return decode(this.readBytes(n));\n    }\n    /**\n     * Read the next `n` bytes, return a string decoded with `encoding` and move pointer\n     * forward by `n` bytes.\n     * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}\n     * @param n - Number of bytes to read.\n     * @param encoding - The encoding to use. Default is 'utf8'.\n     * @returns The decoded string.\n     */\n    decodeText(n = 1, encoding = 'utf8') {\n        return decode(this.readBytes(n), encoding);\n    }\n    /**\n     * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer\n     * forward by 1 byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBoolean(value) {\n        this.writeUint8(value ? 0xff : 0x00);\n        return this;\n    }\n    /**\n     * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt8(value) {\n        this.ensureAvailable(1);\n        this._data.setInt8(this.offset++, value);\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as an 8-bit unsigned integer and move pointer forward by 1\n     * byte.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint8(value) {\n        this.ensureAvailable(1);\n        this._data.setUint8(this.offset++, value);\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * An alias for {@link IOBuffer#writeUint8}.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeByte(value) {\n        return this.writeUint8(value);\n    }\n    /**\n     * Write all elements of `bytes` as uint8 values and move pointer forward by\n     * `bytes.length` bytes.\n     * @param bytes - The array of bytes to write.\n     * @returns This.\n     */\n    writeBytes(bytes) {\n        this.ensureAvailable(bytes.length);\n        // eslint-disable-next-line @typescript-eslint/prefer-for-of\n        for (let i = 0; i < bytes.length; i++) {\n            this._data.setUint8(this.offset++, bytes[i]);\n        }\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 16-bit signed integer and move pointer forward by 2\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt16(value) {\n        this.ensureAvailable(2);\n        this._data.setInt16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 16-bit unsigned integer and move pointer forward by 2\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint16(value) {\n        this.ensureAvailable(2);\n        this._data.setUint16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit signed integer and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeInt32(value) {\n        this.ensureAvailable(4);\n        this._data.setInt32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit unsigned integer and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeUint32(value) {\n        this.ensureAvailable(4);\n        this._data.setUint32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 32-bit floating number and move pointer forward by 4\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeFloat32(value) {\n        this.ensureAvailable(4);\n        this._data.setFloat32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit floating number and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeFloat64(value) {\n        this.ensureAvailable(8);\n        this._data.setFloat64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit signed bigint and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBigInt64(value) {\n        this.ensureAvailable(8);\n        this._data.setBigInt64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8\n     * bytes.\n     * @param value - The value to write.\n     * @returns This.\n     */\n    writeBigUint64(value) {\n        this.ensureAvailable(8);\n        this._data.setBigUint64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n        this._updateLastWrittenByte();\n        return this;\n    }\n    /**\n     * Write the charCode of `str`'s first character as an 8-bit unsigned integer\n     * and move pointer forward by 1 byte.\n     * @param str - The character to write.\n     * @returns This.\n     */\n    writeChar(str) {\n        // eslint-disable-next-line unicorn/prefer-code-point\n        return this.writeUint8(str.charCodeAt(0));\n    }\n    /**\n     * Write the charCodes of all `str`'s characters as 8-bit unsigned integers\n     * and move pointer forward by `str.length` bytes.\n     * @param str - The characters to write.\n     * @returns This.\n     */\n    writeChars(str) {\n        for (let i = 0; i < str.length; i++) {\n            // eslint-disable-next-line unicorn/prefer-code-point\n            this.writeUint8(str.charCodeAt(i));\n        }\n        return this;\n    }\n    /**\n     * UTF-8 encode and write `str` to the current pointer offset and move pointer\n     * forward according to the encoded length.\n     * @param str - The string to write.\n     * @returns This.\n     */\n    writeUtf8(str) {\n        return this.writeBytes(encode(str));\n    }\n    /**\n     * Export a Uint8Array view of the internal buffer.\n     * The view starts at the byte offset and its length\n     * is calculated to stop at the last written byte or the original length.\n     * @returns A new Uint8Array view.\n     */\n    toArray() {\n        return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);\n    }\n    /**\n     *  Get the total number of bytes written so far, regardless of the current offset.\n     * @returns - Total number of bytes.\n     */\n    getWrittenByteLength() {\n        return this.lastWrittenByte - this.byteOffset;\n    }\n    /**\n     * Update the last written byte offset\n     * @private\n     */\n    _updateLastWrittenByte() {\n        if (this.offset > this.lastWrittenByte) {\n            this.lastWrittenByte = this.offset;\n        }\n    }\n}\n//# sourceMappingURL=IOBuffer.js.map","const types = {\n    BYTE: 1,\n    CHAR: 2,\n    SHORT: 3,\n    INT: 4,\n    FLOAT: 5,\n    DOUBLE: 6,\n};\n/**\n * Parse a number into their respective type\n * @param type - integer that represents the type\n * @return - parsed value of the type\n */\nexport function num2str(type) {\n    switch (Number(type)) {\n        case types.BYTE:\n            return 'byte';\n        case types.CHAR:\n            return 'char';\n        case types.SHORT:\n            return 'short';\n        case types.INT:\n            return 'int';\n        case types.FLOAT:\n            return 'float';\n        case types.DOUBLE:\n            return 'double';\n        default:\n            return 'undefined';\n    }\n}\n/**\n * Parse a number type identifier to his size in bytes\n * @param type - integer that represents the type\n * @return size of the type\n */\nexport function num2bytes(type) {\n    switch (Number(type)) {\n        case types.BYTE:\n            return 1;\n        case types.CHAR:\n            return 1;\n        case types.SHORT:\n            return 2;\n        case types.INT:\n            return 4;\n        case types.FLOAT:\n            return 4;\n        case types.DOUBLE:\n            return 8;\n        default:\n            return -1;\n    }\n}\n/**\n * Reverse search of num2str\n * @param type - string that represents the type\n * @return parsed value of the type\n */\nexport function str2num(type) {\n    switch (String(type)) {\n        case 'byte':\n            return types.BYTE;\n        case 'char':\n            return types.CHAR;\n        case 'short':\n            return types.SHORT;\n        case 'int':\n            return types.INT;\n        case 'float':\n            return types.FLOAT;\n        case 'double':\n            return types.DOUBLE;\n        /* istanbul ignore next */\n        default:\n            return -1;\n    }\n}\n/**\n * Auxiliary function to read numeric data\n * @param size - Size of the element to read\n * @param bufferReader - Function to read next value\n * @return\n */\nfunction readNumber(size, bufferReader) {\n    if (size !== 1) {\n        const numbers = new Array(size);\n        for (let i = 0; i < size; i++) {\n            numbers[i] = bufferReader();\n        }\n        return numbers;\n    }\n    else {\n        return bufferReader();\n    }\n}\n/**\n * Given a type and a size reads the next element\n * @param buffer - Buffer for the file data\n * @param type - Type of the data to read\n * @param size - Size of the element to read\n * @return\n */\nexport function readType(buffer, type, size) {\n    switch (type) {\n        case types.BYTE:\n            return Array.from(buffer.readBytes(size));\n        case types.CHAR:\n            return trimNull(buffer.readChars(size));\n        case types.SHORT:\n            return readNumber(size, buffer.readInt16.bind(buffer));\n        case types.INT:\n            return readNumber(size, buffer.readInt32.bind(buffer));\n        case types.FLOAT:\n            return readNumber(size, buffer.readFloat32.bind(buffer));\n        case types.DOUBLE:\n            return readNumber(size, buffer.readFloat64.bind(buffer));\n        default:\n            throw new Error(`non valid type ${type}`);\n    }\n}\n/**\n * Removes null terminate value\n * @param value - String to trim\n * @return - Trimmed string\n */\nfunction trimNull(value) {\n    if (value.charCodeAt(value.length - 1) === 0) {\n        return value.substring(0, value.length - 1);\n    }\n    return value;\n}\n//# sourceMappingURL=types.js.map","/**\n * Throws a non-valid NetCDF exception if the statement it's true\n * @ignore\n * @param statement - Throws if true\n * @param reason - Reason to throw\n */\nexport function notNetcdf(statement, reason) {\n    if (statement) {\n        throw new TypeError(`Not a valid NetCDF v3.x file: ${reason}`);\n    }\n}\n/**\n * Moves 1, 2, or 3 bytes to next 4-byte boundary\n * @param buffer - Buffer for the file data\n */\nexport function padding(buffer) {\n    if (buffer.offset % 4 !== 0) {\n        buffer.skip(4 - (buffer.offset % 4));\n    }\n}\n/**\n * Reads the name\n * @param buffer - Buffer for the file data\n * @return Name\n */\nexport function readName(buffer) {\n    // Read name\n    const nameLength = buffer.readUint32();\n    const name = buffer.readChars(nameLength);\n    // validate name\n    // TODO\n    // Apply padding\n    padding(buffer);\n    return name;\n}\n//# sourceMappingURL=utils.js.map","import { num2str, readType } from './types';\nimport { padding, notNetcdf, readName } from './utils';\n// Grammar constants\nconst ZERO = 0;\nconst NC_DIMENSION = 10;\nconst NC_VARIABLE = 11;\nconst NC_ATTRIBUTE = 12;\nconst NC_UNLIMITED = 0;\n/**\n * Reads the file header as @see {@link Header}\n * @param buffer - Buffer for the file data\n * @param version - Version of the file\n * @returns\n */\nexport function header(buffer, version) {\n    const header = { version };\n    const recordDimension = {\n        length: buffer.readUint32(),\n    };\n    const dimList = dimensionsList(buffer);\n    if (!Array.isArray(dimList)) {\n        recordDimension.id = dimList.recordId;\n        recordDimension.name = dimList.recordName;\n        header.dimensions = dimList.dimensions;\n    }\n    header.globalAttributes = attributesList(buffer);\n    const variables = variablesList(buffer, recordDimension?.id, version);\n    if (!Array.isArray(variables)) {\n        header.variables = variables.variables;\n        recordDimension.recordStep = variables.recordStep;\n    }\n    header.recordDimension = recordDimension;\n    return header;\n}\n/**\n * List of dimensions\n * @param buffer - Buffer for the file data\n * @return List of dimensions\n */\nfunction dimensionsList(buffer) {\n    const result = {};\n    let recordId, recordName;\n    const dimList = buffer.readUint32();\n    let dimensions;\n    if (dimList === ZERO) {\n        notNetcdf(buffer.readUint32() !== ZERO, 'wrong empty tag for list of dimensions');\n        return [];\n    }\n    else {\n        notNetcdf(dimList !== NC_DIMENSION, 'wrong tag for list of dimensions');\n        // Length of dimensions\n        const dimensionSize = buffer.readUint32();\n        dimensions = new Array(dimensionSize);\n        //populate `name` and `size` for each dimension\n        for (let dim = 0; dim < dimensionSize; dim++) {\n            // Read name\n            const name = readName(buffer);\n            // Read dimension size\n            const size = buffer.readUint32();\n            if (size === NC_UNLIMITED) {\n                // in netcdf 3 one field can be of size unlimited\n                recordId = dim;\n                recordName = name;\n            }\n            dimensions[dim] = {\n                name,\n                size,\n            };\n        }\n    }\n    if (recordId !== undefined) {\n        result.recordId = recordId;\n    }\n    if (recordName !== undefined) {\n        result.recordName = recordName;\n    }\n    result.dimensions = dimensions;\n    return result;\n}\n/**\n * List of attributes\n * @param buffer - Buffer for the file data\n * @return - List of attributes with:\n */\nfunction attributesList(buffer) {\n    const gAttList = buffer.readUint32();\n    let attributes;\n    if (gAttList === ZERO) {\n        notNetcdf(buffer.readUint32() !== ZERO, 'wrong empty tag for list of attributes');\n        return [];\n    }\n    else {\n        notNetcdf(gAttList !== NC_ATTRIBUTE, 'wrong tag for list of attributes');\n        // Length of attributes\n        const attributeSize = buffer.readUint32();\n        attributes = new Array(attributeSize);\n        // Populate `name`, `type` and `value` for each attribute\n        for (let gAtt = 0; gAtt < attributeSize; gAtt++) {\n            // Read name\n            const name = readName(buffer);\n            // Read type\n            const type = buffer.readUint32();\n            notNetcdf(type < 1 || type > 6, `non valid type ${type}`);\n            // Read attribute\n            const size = buffer.readUint32();\n            const value = readType(buffer, type, size);\n            // Apply padding\n            padding(buffer);\n            attributes[gAtt] = {\n                name,\n                type: num2str(type),\n                value,\n            };\n        }\n    }\n    return attributes;\n}\n/**\n * @param buffer - Buffer for the file data\n * @param recordId - Id of the unlimited dimension (also called record dimension)\n * This value may be undefined if there is no unlimited dimension\n * @param version - Version of the file\n * @return - Number of recordStep and list of variables @see {@link Variables}\n */\nfunction variablesList(buffer, recordId, version) {\n    const varList = buffer.readUint32();\n    let recordStep = 0;\n    let variables;\n    if (varList === ZERO) {\n        notNetcdf(buffer.readUint32() !== ZERO, 'wrong empty tag for list of variables');\n        return [];\n    }\n    else {\n        notNetcdf(varList !== NC_VARIABLE, 'wrong tag for list of variables');\n        // Length of variables\n        const variableSize = buffer.readUint32();\n        variables = new Array(variableSize);\n        for (let v = 0; v < variableSize; v++) {\n            // Read name\n            const name = readName(buffer);\n            // Read dimensionality of the variable\n            const dimensionality = buffer.readUint32();\n            // Index into the list of dimensions\n            const dimensionsIds = new Array(dimensionality);\n            for (let dim = 0; dim < dimensionality; dim++) {\n                dimensionsIds[dim] = buffer.readUint32();\n            }\n            // Read variables size\n            const attributes = attributesList(buffer);\n            // Read type\n            const type = buffer.readUint32();\n            notNetcdf(type < 1 && type > 6, `non valid type ${type}`);\n            // Read variable size\n            // The 32-bit varSize field is not large enough to contain the size of variables that require\n            // more than 2^32 - 4 bytes, so 2^32 - 1 is used in the varSize field for such variables.\n            const varSize = buffer.readUint32();\n            // Read offset\n            let offset = buffer.readUint32();\n            if (version === 2) {\n                notNetcdf(offset > 0, 'offsets larger than 4GB not supported');\n                offset = buffer.readUint32();\n            }\n            let record = false;\n            // Count amount of record variables\n            if (typeof recordId !== 'undefined' && dimensionsIds[0] === recordId) {\n                recordStep += varSize;\n                record = true;\n            }\n            variables[v] = {\n                name,\n                dimensions: dimensionsIds,\n                attributes,\n                type: num2str(type),\n                size: varSize,\n                offset,\n                record,\n            };\n        }\n    }\n    return {\n        variables,\n        recordStep,\n    };\n}\n//# sourceMappingURL=header.js.map","export function toString() {\n    const result = [];\n    result.push('DIMENSIONS');\n    for (const dimension of this.dimensions) {\n        result.push(`  ${dimension.name.padEnd(30)} = size: ${dimension.size}`);\n    }\n    result.push('');\n    result.push('GLOBAL ATTRIBUTES');\n    for (const attribute of this.globalAttributes) {\n        result.push(`  ${attribute.name.padEnd(30)} = ${attribute.value}`);\n    }\n    const variables = JSON.parse(JSON.stringify(this.variables));\n    result.push('');\n    result.push('VARIABLES:');\n    for (const variable of variables) {\n        variable.value = this.getDataVariable(variable);\n        let stringify = JSON.stringify(variable.value);\n        if (stringify.length > 50)\n            stringify = stringify.substring(0, 50);\n        if (!isNaN(variable.value.length)) {\n            stringify += ` (length: ${variable.value.length})`;\n        }\n        result.push(`  ${variable.name.padEnd(30)} = ${stringify}`);\n    }\n    return result.join('\\n');\n}\n//# sourceMappingURL=toString.js.map","import { IOBuffer } from 'iobuffer';\nimport { record, nonRecord } from './data';\nimport { header } from './header';\nimport { toString } from './toString';\nimport { notNetcdf } from './utils';\n/**\n * Reads a NetCDF v3.x file\n * [See specification](https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications.html)\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @constructor\n */\nexport class NetCDFReader {\n    constructor(data) {\n        this.toString = toString;\n        const buffer = new IOBuffer(data);\n        buffer.setBigEndian();\n        // Validate that it's a NetCDF file\n        notNetcdf(buffer.readChars(3) !== 'CDF', 'should start with CDF');\n        // Check the NetCDF format\n        const version = buffer.readByte();\n        notNetcdf(version > 2, 'unknown version');\n        // Read the header\n        this.header = header(buffer, version);\n        this.buffer = buffer;\n    }\n    /**\n     * @return - Version for the NetCDF format\n     */\n    get version() {\n        if (this.header.version === 1) {\n            return 'classic format';\n        }\n        else {\n            return '64-bit offset format';\n        }\n    }\n    /**\n     * @return {object} - Metadata for the record dimension\n     *  * `length`: Number of elements in the record dimension\n     *  * `id`: Id number in the list of dimensions for the record dimension\n     *  * `name`: String with the name of the record dimension\n     *  * `recordStep`: Number with the record variables step size\n     */\n    get recordDimension() {\n        return this.header.recordDimension;\n    }\n    /**\n     * @return - Array - List of dimensions with:\n     *  * `name`: String with the name of the dimension\n     *  * `size`: Number with the size of the dimension\n     */\n    get dimensions() {\n        return this.header.dimensions;\n    }\n    /**\n     * @return - Array - List of global attributes with:\n     *  * `name`: String with the name of the attribute\n     *  * `type`: String with the type of the attribute\n     *  * `value`: A number or string with the value of the attribute\n     */\n    get globalAttributes() {\n        return this.header.globalAttributes;\n    }\n    /**\n     * Returns the value of an attribute\n     * @param - AttributeName\n     * @return - Value of the attributeName or null\n     */\n    getAttribute(attributeName) {\n        const attribute = this.globalAttributes.find((val) => val.name === attributeName);\n        if (attribute)\n            return attribute.value;\n        return null;\n    }\n    /**\n     * Returns the value of a variable as a string\n     * @param - variableName\n     * @return - Value of the variable as a string or null\n     */\n    getDataVariableAsString(variableName) {\n        const variable = this.getDataVariable(variableName);\n        if (variable)\n            return variable.join('');\n        return null;\n    }\n    get variables() {\n        return this.header.variables;\n    }\n    /**\n     * Retrieves the data for a given variable\n     * @param variableName - Name of the variable to search or variable object\n     * @return The variable values\n     */\n    getDataVariable(variableName) {\n        let variable;\n        if (typeof variableName === 'string') {\n            // search the variable\n            variable = this.header.variables.find((val) => {\n                return val.name === variableName;\n            });\n        }\n        else {\n            variable = variableName;\n        }\n        // throws if variable not found\n        if (variable === undefined) {\n            throw new Error('Not a valid NetCDF v3.x file: variable not found');\n        }\n        // go to the offset position\n        this.buffer.seek(variable.offset);\n        if (variable.record) {\n            // record variable case\n            return record(this.buffer, variable, this.header.recordDimension);\n        }\n        else {\n            // non-record variable case\n            return nonRecord(this.buffer, variable);\n        }\n    }\n    /**\n     * Check if a dataVariable exists\n     * @param variableName - Name of the variable to find\n     * @return boolean\n     */\n    dataVariableExists(variableName) {\n        const variable = this.header.variables.find((val) => {\n            return val.name === variableName;\n        });\n        return variable !== undefined;\n    }\n    /**\n     * Check if an attribute exists\n     * @param attributeName - Name of the attribute to find\n     * @return boolean\n     */\n    attributeExists(attributeName) {\n        const attribute = this.globalAttributes.find((val) => val.name === attributeName);\n        return attribute !== undefined;\n    }\n}\n//# sourceMappingURL=parser.js.map","import { num2bytes, str2num, readType } from './types';\n// const STREAMING = 4294967295;\n/**\n * Read data for the given non-record variable\n * @param buffer - Buffer for the file data\n * @param variable - Variable metadata\n * @return - Data of the element\n */\nexport function nonRecord(buffer, variable) {\n    // variable type\n    const type = str2num(variable.type);\n    // size of the data\n    const size = variable.size / num2bytes(type);\n    // iterates over the data\n    const data = new Array(size);\n    for (let i = 0; i < size; i++) {\n        data[i] = readType(buffer, type, 1);\n    }\n    return data;\n}\n/**\n * Read data for the given record variable\n * @param buffer - Buffer for the file data\n * @param variable - Variable metadata\n * @param recordDimension - Record dimension metadata\n * @return - Data of the element\n */\nexport function record(buffer, variable, recordDimension) {\n    // variable type\n    const type = str2num(variable.type);\n    const width = variable.size ? variable.size / num2bytes(type) : 1;\n    // size of the data\n    // TODO streaming data\n    const size = recordDimension.length;\n    // iterates over the data\n    const data = new Array(size);\n    const step = recordDimension.recordStep;\n    if (step) {\n        for (let i = 0; i < size; i++) {\n            const currentOffset = buffer.offset;\n            data[i] = readType(buffer, type, width);\n            buffer.seek(currentOffset + step);\n        }\n    }\n    else {\n        throw new Error('recordDimension.recordStep is undefined');\n    }\n    return data;\n}\n//# sourceMappingURL=data.js.map","import { NetCDFReader } from 'netcdfjs';\nimport { advionGCMS } from \"./advionGCMS.js\";\nimport { agilentGCMS } from \"./agilentGCMS.js\";\nimport { agilentHPLC } from \"./agilentHPLC.js\";\nimport { aiaTemplate } from \"./aiaTemplate.js\";\nimport { brukerGCMS } from \"./brukerGCMS.js\";\nimport { finniganGCMS } from \"./finniganGCMS.js\";\nimport { shimadzuGCMS } from \"./shimadzuGCMS.js\";\n/**\n * Reads a NetCDF file and returns a formatted JSON with the data from it.\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @returns JSON with the time, TIC and mass spectra values\n */\nexport function netcdfGcms(data) {\n    const reader = new NetCDFReader(data);\n    const globalAttributes = reader.globalAttributes;\n    const instrumentMfr = reader.dataVariableExists('instrument_mfr') &&\n        reader.getDataVariableAsString('instrument_mfr');\n    const datasetOrigin = reader.attributeExists('dataset_origin');\n    const massValues = reader.dataVariableExists('mass_values');\n    const detectorName = reader.getAttribute('detector_name');\n    const aiaTemplateRevision = reader.attributeExists('aia_template_revision');\n    const sourceFileFormat = reader.getAttribute('source_file_format');\n    let result;\n    if (massValues && datasetOrigin) {\n        result = agilentGCMS(reader);\n    }\n    else if (massValues && instrumentMfr && instrumentMfr.match(/finnigan/i)) {\n        result = finniganGCMS(reader);\n    }\n    else if (massValues && instrumentMfr && instrumentMfr.match(/bruker/i)) {\n        result = brukerGCMS(reader);\n    }\n    else if (massValues &&\n        sourceFileFormat &&\n        String(sourceFileFormat).match(/shimadzu/i)) {\n        result = shimadzuGCMS(reader);\n    }\n    else if (massValues &&\n        sourceFileFormat &&\n        String(sourceFileFormat).match(/advion/i)) {\n        result = advionGCMS(reader);\n    }\n    else if (detectorName && String(detectorName).match(/(?:dad|tic)/i)) {\n        result = agilentHPLC(reader);\n    }\n    else if (aiaTemplateRevision) {\n        result = aiaTemplate(reader);\n    }\n    else {\n        throw new TypeError('Unknown file format');\n    }\n    return {\n        ...result,\n        meta: addMeta(globalAttributes),\n        variables: addVariables(reader),\n    };\n}\n/**\n * Reads a NetCDF file with Agilent GCMS format and returns a formatted JSON with the data from it.\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @returns JSON with the time, TIC and mass spectra values\n */\nexport function fromAgilentGCMS(data) {\n    return agilentGCMS(new NetCDFReader(data));\n}\n/**\n * Reads a NetCDF file with Agilent HPLC format and returns a formatted JSON with the data from it.\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @returns JSON with the time, TIC and mass spectra values\n */\nexport function fromAgilentHPLC(data) {\n    return agilentHPLC(new NetCDFReader(data));\n}\n/**\n * Reads a NetCDF file with Finnigan format and returns a formatted JSON with the data from it.\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @returns JSON with the time, TIC and mass spectra values\n */\nexport function fromFinniganGCMS(data) {\n    return finniganGCMS(new NetCDFReader(data));\n}\n/**\n * Reads a NetCDF file with AIA template format and returns a formatted JSON with the data from it.\n * @param data - ArrayBuffer or any Typed Array (including Node.js' Buffer from v4) with the data\n * @returns JSON with the time, TIC and mass spectra values\n */\nexport function fromAiaTemplate(data) {\n    return aiaTemplate(new NetCDFReader(data));\n}\nfunction addMeta(globalAttributes) {\n    const meta = {};\n    for (const item of globalAttributes) {\n        meta[item.name] = item.value;\n    }\n    return meta;\n}\nfunction addVariables(reader) {\n    return reader.variables.map((variable) => ({\n        ...variable,\n        value: reader.getDataVariable(variable),\n    }));\n}\n//# sourceMappingURL=index.js.map","/* reader.toString() provides the following information\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1+C2\n      ms_template_revision           = 1.0.1\n      netcdf_revision                = 2.3.2\n      languages                      = English\n      administrative_comments        = 1% CH2Cl2\n      dataset_origin                 = Santa Clara, CA\n      netcdf_file_date_time_stamp    = 20161012052159+0200\n      experiment_title               = P071 Essence super BP\n      experiment_date_time_stamp     = 20070923040800+0200\n      operator_name                  = SC\n      external_file_ref_0            = FIRE_RTL.M\n      experiment_type                = Centroided Mass Spectrum\n      number_of_times_processed      = 1\n      number_of_times_calibrated     = 0\n      sample_state                   = Other State\n      test_separation_type           = No Chromatography\n      test_ms_inlet                  = Capillary Direct\n      test_ionization_mode           = Electron Impact\n      test_ionization_polarity       = Positive Polarity\n      test_detector_type             = Electron Multiplier\n      test_resolution_type           = Constant Resolution\n      test_scan_function             = Mass Scan\n      test_scan_direction            = Up\n      test_scan_law                  = Linear\n      raw_data_mass_format           = Float\n      raw_data_time_format           = Short\n      raw_data_intensity_format      = Float\n\n    VARIABLES:\n      error_log                      = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 64)\n      a_d_sampling_rate              = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      a_d_coaddition_factor          = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6402)\n      scan_acquisition_time          = [5.25,5.84,6.428999999999999,7.019,7.609,8.199,8.7 (length: 6401)\n      scan_duration                  = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      inter_scan_time                = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      resolution                     = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      actual_scan_number             = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 (length: 6401)\n      total_intensity                = [3134,3157,3085,3134,3093,3113,3061,3057,3030,3166 (length: 6401)\n      mass_range_min                 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 6401)\n      mass_range_max                 = [206.89999389648438,206.89999389648438,207,207.100 (length: 6401)\n      time_range_min                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      time_range_max                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 6401)\n      scan_index                     = [0,11,22,33,44,55,66,76,88,99,111,122,134,145,156, (length: 6401)\n      point_count                    = [11,11,11,11,11,11,10,12,11,12,11,12,11,11,11,11,1 (length: 6401)\n      flag_count                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 6401)\n      mass_values                    = [16,17,18.100000381469727,28,32,35,36,38,40,44.099 (length: 157201)\n      time_values                    = [9.969209968386869e+36,9.969209968386869e+36,9.969 (length: 157201)\n      intensity_values               = [37,293,1243,737,420,45,196,72,22,35,34,28,299,123 (length: 157201)\n      instrument_name                = [\"G\",\"a\",\"s\",\" \",\"C\",\"h\",\"r\",\"o\",\"m\",\"a\",\"t\",\"o\",\" (length: 32)\n      instrument_id                  = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_mfr                 = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_model               = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_serial_no           = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_sw_version          = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_fw_version          = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_os_version          = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_app_version         = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_comments            = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n*/\n/**\n * Parses an Agilent GC/MS NetCDF file and returns times with TIC and mass spectra.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function agilentGCMS(reader) {\n    const time = reader.getDataVariable('scan_acquisition_time');\n    const tic = reader.getDataVariable('total_intensity');\n    const pointCount = reader.getDataVariable('point_count');\n    const massValues = reader.getDataVariable('mass_values');\n    const intensityValues = reader.getDataVariable('intensity_values');\n    const ms = [];\n    let index = 0;\n    for (const count of pointCount) {\n        ms.push([\n            massValues.slice(index, index + count),\n            intensityValues.slice(index, index + count),\n        ]);\n        index += count;\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n            {\n                name: 'ms',\n                dimension: 2,\n                data: ms,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=agilentGCMS.js.map","/* reader.toString() provides the following information\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1+C2\n      ms_template_revision           = 1.0.1\n      administrative_comments        =\n      dataset_owner                  =\n      experiment_title               =\n      experiment_date_time_stamp     = 20150902041002+0100\n      netcdf_file_date_time_stamp    = 20151026063419+0000\n      experiment_type                = Centroided Mass Spectrum\n      netcdf_revision                = 2.3.2\n      operator_name                  = DSQ\n      source_file_reference          = G:\\FCO\\FCO_CIO\\K2\\MP2013\\T1 IL database 2013\\9. IL Data Entry\\12_HU_HIFS\\IL database\\RAW data\\Lukoil-Disel-150901.RAW\n      source_file_date_time_stamp    = 20150902041002+0100\n      source_file_format             = Finnigan\n      languages                      = English\n      external_file_ref_0            =\n      instrument_number              = 1\n      sample_prep_comments           =\n      sample_comments                = Lukoil Disel 0,5 % CS2 1 % inkt\n      test_separation_type           =\n      test_ms_inlet                  =\n      test_ionization_mode           =\n      test_ionization_polarity       = Positive Polarity\n      test_detector_type             = Conversion Dynode Electron Multiplier\n      test_scan_function             = Mass Scan\n      test_scan_direction            =\n      test_scan_law                  = Linear\n      number_of_scans                = 11832\n      raw_data_mass_format           = Double\n      raw_data_intensity_format      = Long\n      actual_run_time                = 3519.6410000000005\n      actual_delay_time              = 82.328\n      global_mass_min                = 0\n      global_mass_max                = 450\n      calibrated_mass_min            = 0\n      calibrated_mass_max            = 0\n      mass_axis_label                = M/Z\n      intensity_axis_label           = Abundance\n\n    VARIABLES:\n      error_log                      = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 64)\n      instrument_name                = [\"L\",\"C\",\"Q\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 32)\n      instrument_id                  = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 32)\n      instrument_mfr                 = [\"F\",\"i\",\"n\",\"n\",\"i\",\"g\",\"a\",\"n\",\"-\",\"M\",\"A\",\"T\",\" (length: 32)\n      instrument_model               = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 32)\n      instrument_sw_version          = [\"3\",\".\",\"1\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 32)\n      instrument_os_version          = [\"W\",\"i\",\"n\",\"d\",\"o\",\"w\",\"s\",\" \",\"V\",\"i\",\"s\",\"t\",\" (length: 32)\n      scan_index                     = [0,34,74,113,145,177,211,239,267,299,341,374,400,4 (length: 11832)\n      point_count                    = [34,40,39,32,32,34,28,28,32,42,33,26,29,34,31,28,2 (length: 11832)\n      flag_count                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 11832)\n      a_d_sampling_rate              = [1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 (length: 11832)\n      scan_acquisition_time          = [82.328,82.625,82.76599999999999,83.063,83.188,83. (length: 11832)\n      scan_duration                  = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 11832)\n      mass_range_min                 = [35,16,35,16,35,16,35,16,35,16,35,16,35,16,35,16,3 (length: 11832)\n      mass_range_max                 = [450,150,450,150,450,150,450,150,450,150,450,150,4 (length: 11832)\n      scan_type                      = [65537,65537,65537,65537,65537,65537,65537,65537,6 (length: 11832)\n      resolution                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 11832)\n      total_intensity                = [375220,1054339,228245,576718,58280,288629,29815,1 (length: 11832)\n      mass_values                    = [36.3023681640625,36.98402404785156,38.08326721191 (length: 1366002)\n      intensity_values               = [335,287,331,266,2423,448,9009,833,261,661,4003,21 (length: 1366002)\n\n*/\n/**\n * Parses a Finnigan GC/MS NetCDF file and returns times with TIC and mass spectra.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function finniganGCMS(reader) {\n    const time = reader.getDataVariable('scan_acquisition_time');\n    const tic = reader.getDataVariable('total_intensity');\n    const scanIndex = reader.getDataVariable('scan_index');\n    const massValues = reader.getDataVariable('mass_values');\n    const intensityValues = reader.getDataVariable('intensity_values');\n    scanIndex.push(massValues.length);\n    const ms = [];\n    let index = 0;\n    for (const end of scanIndex.slice(1)) {\n        const start = index;\n        index = end;\n        ms.push([massValues.slice(start, end), intensityValues.slice(start, end)]);\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n            {\n                name: 'ms',\n                dimension: 2,\n                data: ms,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=finniganGCMS.js.map","/* reader.toString() provides the following information\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1+C2\n      ms_template_revision           = 1.0.1\n      netcdf_revision                = 2.3.2\n      languages                      = English\n      netcdf_file_date_time_stamp    = 20170428032023+0000\n      experiment_title               = MS51762A16\n    11829FC03_3__60_40\n      experiment_date_time_stamp     = 20160930202145-0001\n      operator_name                  = Begemann/Eikenberg/Roettger\n      pre_experiment_program_name    = otofControl 3.4.16.0\n      post_experiment_program_name   = Bruker Compass DataAnalysis 4.2\n      source_file_reference          = X:\\2016\\MS5\\1700\\MS51762A16.d\n      source_file_format             = Bruker Daltonics Data File\n      experiment_type                = Centroided Mass Spectrum\n      sample_state                   = Other State\n      test_separation_type           = No Chromatography\n      test_ms_inlet                  = Direct Inlet Probe\n      test_ionization_mode           = Electrospray Ionization\n      test_ionization_polarity       = Positive Polarity\n      test_detector_type             = Electron Multiplier\n      test_resolution_type           = Proportional Resolution\n      test_scan_function             = Mass Scan\n      test_scan_direction            = Up\n      test_scan_law                  = Linear\n      raw_data_mass_format           = Double\n      raw_data_time_format           = Float\n      raw_data_intensity_format      = Float\n      units                          = Seconds\n      scale_factor                   = 1\n\n    VARIABLES:\n      error_log                      = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 64)\n      a_d_sampling_rate              = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4513)\n      a_d_coaddition_factor          = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4514)\n      scan_acquisition_time          = [0.329,0.73,1.132,1.534,1.936,2.337,2.739,3.14,3.5 (length: 4513)\n      scan_duration                  = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4513)\n      inter_scan_time                = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4513)\n      resolution                     = [106.6623112889557,110.7855343519544,104.407495112 (length: 4513)\n      actual_scan_number             = [0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34, (length: 4513)\n      total_intensity                = [5297.4945068359375,6172.123912811279,5934.7557412 (length: 4513)\n      mass_range_min                 = [49.99999997418507,49.99999997418507,49.9999999741 (length: 4513)\n      mass_range_max                 = [1599.9999564432276,1599.9999564432276,1599.999956 (length: 4513)\n      time_range_min                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4513)\n      time_range_max                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 4513)\n      scan_index                     = [0,60,128,195,265,324,399,472,542,596,671,738,803, (length: 4513)\n      point_count                    = [60,68,67,70,59,75,73,70,54,75,67,65,64,73,56,69,6 (length: 4513)\n      flag_count                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 4513)\n      mass_values                    = [51.53516375878996,95.32974890044508,106.334477231 (length: 1176507)\n      intensity_values               = [76.99999237060547,80,90,78.99799346923828,80.9352 (length: 1176507)\n      instrument_name                = [\"m\",\"i\",\"c\",\"r\",\"O\",\"T\",\"O\",\"F\",\"\",\" \",\" \",\" \",\"  (length: 32)\n      instrument_id                  = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_mfr                 = [\"B\",\"r\",\"u\",\"k\",\"e\",\"r\",\" \",\"D\",\"a\",\"l\",\"t\",\"o\",\" (length: 32)\n      instrument_model               = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_serial_no           = [\"2\",\"1\",\"3\",\"7\",\"5\",\"0\",\".\",\"1\",\"0\",\"3\",\"5\",\"9\",\" (length: 32)\n      instrument_sw_version          = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_fw_version          = [\"\",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\"  (length: 32)\n      instrument_os_version          = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_app_version         = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_comments            = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n*/\n/**\n * Parses a Bruker GC/MS NetCDF file and returns times with TIC and mass spectra.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function brukerGCMS(reader) {\n    const time = reader.getDataVariable('scan_acquisition_time');\n    const tic = reader.getDataVariable('total_intensity');\n    const scanIndex = reader.getDataVariable('scan_index');\n    const massValues = reader.getDataVariable('mass_values');\n    const intensityValues = reader.getDataVariable('intensity_values');\n    scanIndex.push(massValues.length);\n    const ms = [];\n    let index = 0;\n    for (const end of scanIndex.slice(1)) {\n        const start = index;\n        index = end;\n        ms.push([massValues.slice(start, end), intensityValues.slice(start, end)]);\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n            {\n                name: 'ms',\n                dimension: 2,\n                data: ms,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=brukerGCMS.js.map","/* reader.toString() provides the following information\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1+C2\n      ms_template_revision           = 1.0.1\n      netcdf_revision                = 2.3.2\n      languages                      = English\n      administrative_comments        =\n      netcdf_file_date_time_stamp    = 20180913165502+0000\n      experiment_title               =\n      experiment_date_time_stamp     = 20180910165319+0000\n      operator_name                  = Admin\n      source_file_reference          = D:\\GCMSsolution\\Data\\Chromatograms\\Cato\\bormann_CB000_Test2.qgd\n      source_file_format             = Shimadzu GCMSsolution\n      source_file_date_time_stamp    = 20180910165319+0000\n      experiment_type                = Centroided Mass Spectrum\n      sample_internal_id             =\n      sample_comments                =\n      sample_state                   = Other State\n      test_separation_type           = Gas-Solid Chromatography\n      test_ms_inlet                  = Other Probe\n      test_ionization_mode           = Electron Impact\n      test_ionization_polarity       = Positive Polarity\n      test_electron_energy           = 70\n      test_detector_type             = Electron Multiplier\n      test_resolution_type           = Constant Resolution\n      test_scan_function             = Mass Scan\n      test_scan_direction            = Up\n      test_scan_law                  = Quadratic\n      test_scan_time                 = 0\n      raw_data_mass_format           = Double\n      raw_data_time_format           = Long\n      raw_data_intensity_format      = Long\n      units                          = Seconds\n      scale_factor                   = 1\n      long_name                      = Seconds\n      starting_scan_number           = 0\n      actual_run_time_length         = 1289\n      actual_delay_time              = 0\n      raw_data_uniform_sampling_flag = 1\n\n    VARIABLES:\n      error_log                      = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 64)\n      a_d_sampling_rate              = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      a_d_coaddition_factor          = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      scan_acquisition_time          = [144,144.3,144.6,144.9,145.2,145.5,145.8,146.1,146 (length: 3820)\n      scan_duration                  = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      inter_scan_time                = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      resolution                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      actual_scan_number             = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2 (length: 3820)\n      total_intensity                = [63566,61702,61873,59738,58321,59001,59364,59871,6 (length: 3820)\n      mass_range_min                 = [35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,3 (length: 3820)\n      mass_range_max                 = [500,500,500,500,500,500,500,500,500,500,500,500,5 (length: 3820)\n      time_range_min                 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      time_range_max                 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      scan_index                     = [0,466,932,1398,1863,2329,2795,3260,3726,4192,4658 (length: 3820)\n      point_count                    = [466,466,466,465,466,466,465,466,466,466,466,466,4 (length: 3820)\n      flag_count                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 3820)\n      mass_values                    = [35,36,37.1,38.1,39.1,40.15,41.1,42.1,43.15,44.1,4 (length: 1779397)\n      intensity_values               = [26,111,412,785,3098,485,5772,7391,11213,711,687,1 (length: 1779397)\n      instrument_name                = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_id                  = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n      instrument_mfr                 = [\"S\",\"h\",\"i\",\"m\",\"a\",\"d\",\"z\",\"u\",\" \",\"C\",\"o\",\"r\",\" (length: 32)\n      instrument_model               = [\"G\",\"C\",\"M\",\"S\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\", (length: 32)\n      instrument_serial_no           = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 32)\n      instrument_sw_version          = [\"4\",\".\",\"2\",\"0\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\", (length: 32)\n      instrument_fw_version          = [\"G\",\"C\",\"M\",\"S\",\"-\",\"Q\",\"P\",\"2\",\"0\",\"1\",\"0\",\"1\",\" (length: 32)\n      instrument_os_version          = [\"W\",\"i\",\"n\",\"d\",\"o\",\"w\",\"s\",\"\",\"\",\"\",\"\",\"\",\"\",\"\", (length: 32)\n      instrument_app_version         = [\"G\",\"C\",\"M\",\"S\",\"s\",\"o\",\"l\",\"u\",\"t\",\"i\",\"o\",\"n\",\" (length: 32)\n      instrument_comments            = [\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" (length: 32)\n*/\n/**\n * Parses a Shimadzu GC/MS NetCDF file and returns times with TIC and mass spectra.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function shimadzuGCMS(reader) {\n    const time = reader.getDataVariable('scan_acquisition_time');\n    const tic = reader.getDataVariable('total_intensity');\n    const scanIndex = reader.getDataVariable('scan_index');\n    const massValues = reader.getDataVariable('mass_values');\n    const intensityValues = reader.getDataVariable('intensity_values');\n    scanIndex.push(massValues.length);\n    const ms = [];\n    let index = 0;\n    for (const end of scanIndex.slice(1)) {\n        const start = index;\n        index = end;\n        ms.push([massValues.slice(start, end), intensityValues.slice(start, end)]);\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n            {\n                name: 'ms',\n                dimension: 2,\n                data: ms,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=shimadzuGCMS.js.map","/* reader.toString() provides the following information\n    DIMENSIONS\n      point_number                   = size: 0\n      scan_number                    = size: 60\n      error_number                   = size: 1\n      _64_byte_string                = size: 64\n\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1\n      ms_template_revision           = 1.0.1\n      netcdf_revision                = 4.2\n      languages                      = English\n      administrative_comments        =\n      netcdf_file_date_time_stamp    = 202003031432433600000\n      experiment_date_time_stamp     = 202003031432433600000\n      source_file_reference          = JC-012_cleavage test_Scan1_is1.datx 2020.03.03 14:32:43\n      source_file_format             = Advion ExpressIon Compact Mass Spectrometer Data System\n      source_file_date_time_stamp    = 202003031432433600000\n      experiment_title               =\n      experiment_type                = Continuum Mass Spectrum\n      test_ionization_mode           = Electrospray Ionization\n      test_ionization_polarity       = Positive Polarity\n      sample_state                   = Other State\n      test_separation_type           = No Chromatography\n      test_ms_inlet                  = Direct Inlet Probe\n      test_detector_type             = Electron Multiplier\n      test_resolution_type           = Constant Resolution\n      test_scan_function             = Mass Scan\n      test_scan_direction            = Up\n      test_scan_law                  = Linear\n      raw_data_mass_format           = Float\n      raw_data_time_format           = Double\n      raw_data_intensity_format      = Float\n      units                          = Seconds\n      global_mass_min                = 9.949999809265137\n      global_mass_max                = 1199.75\n      actual_run_time_length         = 133.46099853515625\n      starting_scan_number           = 1\n      actual_delay_time              = 0\n      raw_data_uniform_sampling_flag = 0\n\n    VARIABLES:\n      error_log                      = [\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\" (length: 64)\n      scan_index                     = [0,3096,6282,9865,13409,16765,20281,23603,27099,30 (length: 60)\n      point_count                    = [3096,3186,3583,3544,3356,3516,3322,3496,3351,3031 (length: 60)\n      flag_count                     = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 (length: 60)\n      actual_scan_number             = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 (length: 60)\n      a_d_coaddition_factor          = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      a_d_sampling_rate              = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      inter_scan_time                = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      mass_range_min                 = [9.949999809265137,9.949999809265137,9.94999980926 (length: 60)\n      mass_range_max                 = [164.6999969482422,169.1999969482422,189.050003051 (length: 60)\n      scan_acquisition_time          = [0.08100000023841858,2.3420000076293945,4.60300016 (length: 60)\n      scan_duration                  = [2.261000007390976,2.261000156402588,2.25999975204 (length: 60)\n      resolution                     = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      time_range_min                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      time_range_max                 = [-9999,-9999,-9999,-9999,-9999,-9999,-9999,-9999,- (length: 60)\n      total_intensity                = [4498210816,4468554240,5001547264,5405233152,50000 (length: 60)\n      mass_values                    = [9.949999809265137,83.5,83.55000305175781,83.59999 (length: 199393)\n      intensity_values               = [0,818716,462148,0,735558,952901,0,165241,421829,0 (length: 199393)\n*/\n/**\n * Parses an Advion GC/MS NetCDF file and returns times with TIC and mass spectra.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function advionGCMS(reader) {\n    const time = reader.getDataVariable('scan_acquisition_time');\n    const tic = reader.getDataVariable('total_intensity');\n    const scanIndex = reader.getDataVariable('scan_index');\n    const massValues = reader.getDataVariable('mass_values');\n    const intensityValues = reader.getDataVariable('intensity_values');\n    scanIndex.push(massValues.length);\n    const ms = [];\n    let index = 0;\n    for (const end of scanIndex.slice(1)) {\n        const start = index;\n        index = end;\n        ms.push([massValues.slice(start, end), intensityValues.slice(start, end)]);\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n            {\n                name: 'ms',\n                dimension: 2,\n                data: ms,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=advionGCMS.js.map","/* reader.toString() provides the following information\n    GLOBAL ATTRIBUTES\n      dataset_completeness           = C1+C2\n      aia_template_revision          = 1.0\n      netcdf_revision                = 2.3\n      languages                      = English only\n      injection_date_time_stamp      = 20181030174305+0000\n      HP_injection_time              = 30-Oct-18, 17:43:05\n      experiment_title               = SequenceLine: 1  Inj: 1\n      operator_name                  = SYSTEM\n      separation_experiment_type     = liquid chromatography\n      source_file_reference          = C:\\CHEM32\\1\\DATA\\MINGMING\\MW-1-MEO-I IC-90 2018-10-30 17-42-13\\MW-2-6-6 IC 90.D\n      sample_name                    = MW-2-6-6 IC 90\n      sample_id                      =\n      detector_unit                  = mAU\n      detection_method_name          = POS 3 IC 90-10 31 MIN.M\n      detector_name                  = DAD1 A, Sig=254,4 Ref=360,100\n      retention_unit                 = seconds\n\n   VARIABLES:\n      detector_maximum_value         = [130.9263458251953] (length: 1)\n      detector_minimum_value         = [-0.1758841574192047] (length: 1)\n      actual_run_time_length         = [1860] (length: 1)\n      actual_delay_time              = [0.012000000104308128] (length: 1)\n      actual_sampling_interval       = [0.4000000059604645] (length: 1)\n      ordinate_values                = [-0.07588416337966919,-0.07525086402893066,-0.0740 (length: 4651)\n      peak_retention_time            = [196.0651397705078,332.5663757324219,527.549865722 (length: 8)\n      peak_start_time                = [186.81199645996094,239.21200561523438,502.4119873 (length: 8)\n      peak_end_time                  = [220.81201171875,471.5176696777344,572.47869873046 (length: 8)\n      peak_width                     = [4.974428176879883,62.90694808959961,11.9328641891 (length: 8)\n      peak_area                      = [556.7650146484375,419.825439453125,66.56610107421 (length: 8)\n      peak_area_percent              = [7.0321502685546875,5.302552223205566,0.8407546877 (length: 8)\n      peak_height                    = [100.07515716552734,5.1860527992248535,4.827196121 (length: 8)\n      peak_height_percent            = [29.76352310180664,1.5423927307128906,1.4356645345 (length: 8)\n      peak_asymmetry                 = [1.4555920362472534,0.8351489901542664,1.707817316 (length: 8)\n      baseline_start_time            = [186.81199645996094,239.21200561523438,502.4119873 (length: 8)\n      baseline_start_value           = [1.9561424255371094,0.9857341647148132,1.127734780 (length: 8)\n      baseline_stop_time             = [220.81201171875,471.5176696777344,572.47869873046 (length: 8)\n      baseline_stop_value            = [1.1907591819763184,1.10896897315979,1.18347382545 (length: 8)\n      peak_start_detection_code      = [\"B\",\"\",\"B\",\"\",\"B\",\"\",\"B\",\"\",\"V\",\"\",\"B\",\"\",\"B\",\"\", (length: 16)\n      peak_stop_detection_code       = [\"B\",\"\",\"B\",\"\",\"B\",\"\",\"V\",\"\",\"B\",\"\",\"B\",\"\",\"B\",\"\", (length: 16)\n      migration_time                 = [196.0651397705078,332.5663757324219,527.549865722 (length: 8)\n      peak_area_square_root          = [23.595869064331055,20.489643096923828,8.158804893 (length: 8)\n      manually_reintegrated_peaks    = [0,0,0,0,0,0,0,0] (length: 8)\n*/\n/**\n * Parses an Agilent HPLC NetCDF file and returns times with detector data.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function agilentHPLC(reader) {\n    const intensities = reader.getDataVariable('ordinate_values');\n    const numberPoints = intensities.length;\n    const detector = reader.getAttribute('detector_name');\n    let channel;\n    if (detector.match(/dad/i)) {\n        channel = `uv${Number(detector.replace(/.*Sig=(?<wavelength>\\d+).*/, '$<wavelength>'))}`;\n    }\n    else if (detector.match(/tic/i)) {\n        channel = 'tic';\n    }\n    else {\n        channel = 'unknown';\n    }\n    const delayTime = reader.getDataVariable('actual_delay_time')[0];\n    const runtimeLength = reader.getDataVariable('actual_run_time_length')[0];\n    let samplingInterval;\n    if (reader.dataVariableExists('actual_sampling_interval')) {\n        samplingInterval = reader.getDataVariable('actual_sampling_interval')[0];\n        if (Math.abs(delayTime + samplingInterval * numberPoints - runtimeLength) > 3) {\n            throw new Error('The expected last time does not correspond to the runtimeLength');\n        }\n    }\n    else {\n        samplingInterval = (runtimeLength - delayTime) / numberPoints;\n    }\n    const times = [];\n    let time = delayTime;\n    for (let i = 0; i < numberPoints; i++) {\n        times.push(time);\n        time += samplingInterval;\n    }\n    return {\n        times,\n        series: [\n            {\n                name: channel,\n                dimension: 1,\n                data: intensities,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=agilentHPLC.js.map","/**\n * Parses a generic AIA template NetCDF file and returns times with TIC data.\n * @param reader - NetCDF reader instance\n * @returns Parsed times and series data\n */\nexport function aiaTemplate(reader) {\n    const tic = reader.getDataVariable('ordinate_values');\n    const delayTime = Number(reader.getDataVariable('actual_delay_time'));\n    const interval = Number(reader.getDataVariable('actual_sampling_interval'));\n    const time = new Array(tic.length);\n    for (let i = 0; i < tic.length; i++) {\n        time[i] = delayTime + i * interval;\n    }\n    return {\n        times: time,\n        series: [\n            {\n                name: 'tic',\n                dimension: 1,\n                data: tic,\n            },\n        ],\n    };\n}\n//# sourceMappingURL=aiaTemplate.js.map","import { parseString } from 'dynamic-typing';\nconst utf8Decoder = new TextDecoder();\nexport const decoder = {\n    decode: (array) => {\n        return utf8Decoder.decode(array);\n    },\n};\nexport const defaultOptions = {\n    trimValues: true,\n    attributesNodeName: '',\n    ignoreAttributes: false,\n    ignoreNameSpace: false,\n    allowBooleanAttributes: false,\n    parseAttributesString: true,\n    textNodeName: '#text',\n    arrayMode: false,\n    cdataTagName: false,\n    tagNameProcessor: (name) => name,\n    attributeNameProcessor: (name) => `$${name}`,\n    tagValueProcessor: (value) => {\n        const string = decoder.decode(value).replaceAll('\\r', '');\n        return parseString(string);\n    },\n    attributeValueProcessor: (value) => parseString(value),\n    stopNodes: [],\n};\nexport const defaultStreamOptions = {\n    ...defaultOptions,\n    maxEntrySize: 1e7,\n    maxBufferSize: 2e8,\n};\n//# sourceMappingURL=defaultOptions.js.map","export class XMLNode {\n    tagName;\n    parent;\n    children;\n    attributes;\n    bytes;\n    startIndex;\n    tagValueProcessor;\n    cachedValue;\n    constructor(tagName, parent, bytes, tagValueProcessor) {\n        this.tagName = tagName;\n        this.parent = parent;\n        this.children = Object.create(null); //child tags\n        this.attributes = Object.create(null); //attributes map\n        this.bytes = bytes; //text only\n        this.tagValueProcessor = tagValueProcessor;\n        this.startIndex = -1;\n    }\n    append(toAppend) {\n        if (this.bytes.length === 0) {\n            this.bytes = toAppend;\n            return;\n        }\n        const arrayConcat = new Uint8Array(this.bytes.length + toAppend.length);\n        arrayConcat.set(this.bytes);\n        arrayConcat.set(toAppend, this.bytes.length);\n        this.bytes = arrayConcat;\n    }\n    get value() {\n        if (this.cachedValue === undefined) {\n            const value = this.tagValueProcessor(this.bytes, this);\n            this.cachedValue = value;\n        }\n        return this.cachedValue;\n    }\n    addChild(child) {\n        const existing = this.children[child.tagName];\n        if (Array.isArray(existing)) {\n            existing.push(child);\n        }\n        else {\n            this.children[child.tagName] = [child];\n        }\n    }\n}\n//# sourceMappingURL=XMLNode.js.map","export function arrayIndexOf(array, referenceArray, index = 0) {\n    let found = 0;\n    let foundIndex = -1;\n    for (let i = index; i < array.length && found < referenceArray.length; i++) {\n        if (array[i] === referenceArray[found]) {\n            if (!found) {\n                foundIndex = i;\n            }\n            found++;\n        }\n        else if (found > 0) {\n            let j = 0;\n            for (; j <= found && array[foundIndex + j] === array[foundIndex + found]; j++)\n                ;\n            if (j < found + 1) {\n                foundIndex = -1;\n                found = 0;\n            }\n            else {\n                foundIndex++;\n            }\n        }\n        else {\n            found = 0;\n            foundIndex = -1;\n        }\n    }\n    if (found !== referenceArray.length) {\n        foundIndex = -1;\n    }\n    return foundIndex;\n}\n//# sourceMappingURL=arrayIndexOf.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nexport function arrayTrim(array, arg) {\n    let i = 0;\n    let j = array.length - 1;\n    for (; i < array.length && array[i] <= 0x20; i++)\n        ;\n    for (; j >= i && array[j] <= 0x20; j--)\n        ;\n    if (i === 0 && j === array.length - 1)\n        return array;\n    return array.subarray(i, j + 1);\n}\n//# sourceMappingURL=arrayTrim.js.map","const utf8Decoder = new TextDecoder();\nexport const decoder = {\n    decode: (array) => {\n        return utf8Decoder.decode(array);\n    },\n};\n//# sourceMappingURL=utf8Decoder.js.map","import { decoder } from \"./utils/utf8Decoder.js\";\n/**\n * Search for the corresponding closing tag '>'\n * @param data\n * @param i\n * @returns\n */\nexport function closingIndexForOpeningTag(data, i) {\n    let attrBoundary;\n    let endIndex = 0;\n    for (let index = i; index < data.length; index++) {\n        let byte = data[index];\n        if (attrBoundary) {\n            if (byte === attrBoundary)\n                attrBoundary = 0; //reset\n        }\n        else if (byte === 0x22 || byte === 0x27) {\n            attrBoundary = byte;\n        }\n        else if (byte === 0x3e) {\n            return {\n                data: decoder.decode(data.subarray(i, i + endIndex)),\n                index,\n            };\n        }\n        else if (byte === 0x09) {\n            byte = 0x20;\n        }\n        endIndex++;\n    }\n    throw new Error('Could not find closing tag');\n}\n//# sourceMappingURL=closingIndexForOpeningTag.js.map","import { arrayIndexOf } from \"../bufferUtils/arrayIndexOf.js\";\nexport function findClosingIndex(xmlData, str, i, errMsg) {\n    const closingIndex = arrayIndexOf(xmlData, str, i);\n    if (closingIndex === -1) {\n        throw new Error(errMsg);\n    }\n    else {\n        return closingIndex + str.length - 1;\n    }\n}\n//# sourceMappingURL=findClosingIndex.js.map","const nameStartChar = String.raw `:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD`;\nconst nameChar = String.raw `${nameStartChar}\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040`;\nconst nameRegexp = `[${nameStartChar}][${nameChar}]*`;\n// eslint-disable-next-line no-misleading-character-class\nconst regexName = new RegExp(`^${nameRegexp}$`);\nexport function getAllMatches(string, regex) {\n    return Array.from(string.matchAll(regex));\n}\nexport function isName(string) {\n    return regexName.exec(string) !== null;\n}\nexport function isEmptySimpleObject(object) {\n    // fastest implementation: https://jsbench.me/qfkqv692c8/1\n    // eslint-disable-next-line no-unreachable-loop\n    for (const key in object) {\n        return false;\n    }\n    return true;\n}\nexport function isEmptyObject(object) {\n    // fastest implementation: https://jsbench.me/qfkqv692c8/1\n    // eslint-disable-next-line no-unreachable-loop\n    for (const key in object) {\n        return false;\n    }\n    return true;\n}\n/**\n * Copy all the properties of a into b.\n * @param target\n * @param source\n * @param arrayMode\n */\nexport function merge(target, source, arrayMode) {\n    if (!source)\n        return;\n    for (const key in source) {\n        const value = source[key];\n        if (value === undefined)\n            continue;\n        if (arrayMode === 'strict') {\n            target[key] = [value];\n        }\n        else {\n            target[key] = value;\n        }\n    }\n}\n/**\n * Check if a tag name should be treated as array\n * @param tagName - the node tagName\n * @param arrayMode - the array mode option\n * @param parentTagName - the parent tag name\n * @returns true if node should be parsed as array\n */\nexport function isTagNameInArrayMode(tagName, arrayMode, parentTagName) {\n    if (arrayMode === false) {\n        return false;\n    }\n    else if (arrayMode instanceof RegExp) {\n        return arrayMode.test(tagName);\n    }\n    else if (typeof arrayMode === 'function') {\n        return arrayMode(tagName, parentTagName);\n    }\n    return arrayMode === 'strict';\n}\n//# sourceMappingURL=util.js.map","import { getAllMatches, isEmptySimpleObject } from \"../util.js\";\nconst newLocal = String.raw `([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?`;\nconst attrsRegx = new RegExp(newLocal, 'g');\n//Attributes are strings so no point in using arrayBuffers here\nexport function parseAttributesString(string, options) {\n    const { ignoreAttributes } = options;\n    if (ignoreAttributes) {\n        return;\n    }\n    string = string.replaceAll(/\\r?\\n/g, ' ');\n    const matches = getAllMatches(string, attrsRegx);\n    // argument 1 is the key, argument 4 is the value\n    const attributes = {};\n    for (const match of matches) {\n        const attributeName = resolveNameSpace(match[1], options);\n        if (attributeName.length > 0) {\n            if (match[4] !== undefined) {\n                if (options.trimValues) {\n                    match[4] = match[4].trim();\n                }\n                if (options.attributeValueProcessor) {\n                    attributes[attributeName] = options.attributeValueProcessor(match[4], attributeName);\n                }\n            }\n            else if (options.allowBooleanAttributes) {\n                attributes[attributeName] = true;\n            }\n        }\n    }\n    if (isEmptySimpleObject(attributes))\n        return;\n    return attributes;\n}\nfunction resolveNameSpace(tagName, options) {\n    if (options.ignoreNameSpace) {\n        const tags = tagName.split(':');\n        const prefix = tagName.startsWith('/') ? '/' : '';\n        if (tags[0] === 'xmlns') {\n            return '';\n        }\n        if (tags.length === 2 && tags[1] !== undefined) {\n            tagName = prefix + tags[1];\n        }\n    }\n    return tagName;\n}\n//# sourceMappingURL=parseAttributesString.js.map","export function removeNameSpaceIfNeeded(tagName, options) {\n    if (!options.ignoreNameSpace) {\n        return tagName;\n    }\n    const colonIndex = tagName.indexOf(':');\n    if (colonIndex !== -1) {\n        tagName = tagName.slice(colonIndex + 1);\n    }\n    return tagName;\n}\n//# sourceMappingURL=removeNameSpaceIfNeeded.js.map","import { isEmptyObject, isEmptySimpleObject, isTagNameInArrayMode, merge, } from \"./util.js\";\n/**\n *\n * @param node\n * @param options\n * @param parentTagName\n * @returns\n */\nexport function traversableToJSON(node, options, parentTagName) {\n    const { arrayMode, tagNameProcessor, attributeNameProcessor, textNodeName } = options;\n    const result = {};\n    // when no child node or attr is present\n    if ((!node.children || isEmptyObject(node.children)) &&\n        (!node.attributes || isEmptySimpleObject(node.attributes))) {\n        return node.value;\n    }\n    // otherwise create a textnode if node has some text\n    if (node.bytes.length > 0) {\n        const asArray = isTagNameInArrayMode(node.tagName, arrayMode, parentTagName);\n        result[textNodeName] = asArray ? [node.value] : node.value;\n    }\n    if (node.attributes && !isEmptySimpleObject(node.attributes)) {\n        let attributes = options.parseAttributesString ? {} : node.attributes;\n        if (attributeNameProcessor) {\n            // need to rename the attributes\n            const renamedAttributes = {};\n            for (const attributeName in node.attributes) {\n                const newAttributeName = attributeNameProcessor(attributeName);\n                const value = node.attributes[attributeName];\n                if (value !== undefined) {\n                    renamedAttributes[newAttributeName] = value;\n                }\n            }\n            attributes = renamedAttributes;\n        }\n        if (options.attributesNodeName) {\n            const encapsulatedAttributes = {\n                [options.attributesNodeName]: attributes,\n            };\n            attributes = encapsulatedAttributes;\n        }\n        merge(result, attributes, arrayMode);\n    }\n    for (const tagName in node.children) {\n        const nodes = node.children[tagName];\n        if (!nodes)\n            continue;\n        const newTagName = tagNameProcessor\n            ? tagNameProcessor(tagName, nodes)\n            : tagName;\n        if (nodes.length > 1) {\n            result[tagName] = [];\n            for (const child of nodes) {\n                result[newTagName].push(traversableToJSON(child, options, tagName));\n            }\n        }\n        else {\n            const firstNode = nodes[0];\n            if (!firstNode)\n                continue;\n            const subResult = traversableToJSON(firstNode, options, tagName);\n            const asArray = (arrayMode === true && typeof subResult === 'object') ||\n                isTagNameInArrayMode(tagName, arrayMode, parentTagName);\n            result[newTagName] = asArray ? [subResult] : subResult;\n        }\n    }\n    return result;\n}\n//# sourceMappingURL=traversableToJSON.js.map","import { defaultOptions } from \"./traversable/defaultOptions.js\";\nimport { getTraversable } from \"./traversable/getTraversable.js\";\nimport { traversableToJSON } from \"./traversableToJSON.js\";\n/**\n * Parse an ArrayBuffer or Uint8Array representing an XML and return an object\n * @param xmlData\n * @param options\n */\nexport function parse(xmlData, options = {}) {\n    if (typeof xmlData === 'string') {\n        const encoder = new TextEncoder();\n        xmlData = encoder.encode(xmlData);\n    }\n    if (!ArrayBuffer.isView(xmlData)) {\n        xmlData = new Uint8Array(xmlData);\n    }\n    const realOptions = { ...defaultOptions, ...options };\n    const traversable = getTraversable(xmlData, realOptions);\n    return traversableToJSON(traversable, realOptions);\n}\n//# sourceMappingURL=parse.js.map","import { XMLNode } from \"../XMLNode.js\";\nimport { arrayIndexOf } from \"../bufferUtils/arrayIndexOf.js\";\nimport { arrayTrim } from \"../bufferUtils/arrayTrim.js\";\nimport { closingIndexForOpeningTag } from \"./closingIndexForOpeningTag.js\";\nimport { findClosingIndex } from \"./findClosingIndex.js\";\nimport { parseAttributesString } from \"./parseAttributesString.js\";\nimport { removeNameSpaceIfNeeded } from \"./utils/removeNameSpaceIfNeeded.js\";\nimport { decoder } from \"./utils/utf8Decoder.js\";\nexport function getTraversable(xmlData, options) {\n    const { tagValueProcessor } = options;\n    const traversable = new XMLNode('!xml', undefined, new Uint8Array(0), tagValueProcessor);\n    let currentNode = traversable;\n    let dataSize = 0;\n    let dataIndex = 0;\n    for (let i = 0; i < xmlData.length; i++) {\n        if (xmlData[i] === 0x3c) {\n            // <\n            const xmlData1 = xmlData[i + 1];\n            const xmlData2 = xmlData[i + 2];\n            if (xmlData1 === 0x2f) {\n                // </ Closing Tag\n                const closeIndex = findClosingIndex(xmlData, [0x3e], //>\n                i, 'Closing Tag is not closed.');\n                let tagName = decoder.decode(arrayTrim(xmlData.subarray(i + 2, closeIndex), {}));\n                tagName = removeNameSpaceIfNeeded(tagName, options);\n                if (currentNode) {\n                    currentNode.append(options.trimValues\n                        ? arrayTrim(xmlData.subarray(dataIndex, dataIndex + dataSize))\n                        : xmlData.subarray(dataIndex, dataIndex + dataSize));\n                }\n                if (options.stopNodes?.length &&\n                    options.stopNodes.includes(currentNode.tagName)) {\n                    currentNode.children = {};\n                    if (currentNode.attributes === undefined) {\n                        currentNode.attributes = {};\n                    }\n                    currentNode.bytes = xmlData.subarray(currentNode.startIndex + 1, i);\n                }\n                currentNode = currentNode.parent;\n                i = closeIndex;\n                dataSize = 0;\n                dataIndex = i + 1;\n            }\n            else if (xmlData1 === 0x3f) {\n                // <? PI, processing instruction\n                i = findClosingIndex(xmlData, [0x3f, 0x3e], i, 'Pi Tag is not closed.');\n            }\n            else if (\n            //!-- comment\n            xmlData1 === 0x21 &&\n                xmlData2 === 0x2d &&\n                xmlData[i + 3] === 0x2d) {\n                i = findClosingIndex(xmlData, [0x2d, 0x2d, 0x3e], //-->\n                i, 'Comment is not closed.');\n                if (currentNode && dataSize !== 0 && currentNode.tagName !== '!xml') {\n                    currentNode.append(options.trimValues\n                        ? arrayTrim(xmlData.subarray(dataIndex, dataSize + dataIndex))\n                        : xmlData.subarray(dataIndex, dataSize + dataIndex));\n                }\n                dataSize = 0;\n                dataIndex = i + 1;\n                //!D\n            }\n            else if (xmlData1 === 0x21 && xmlData2 === 0x44) {\n                // <!D\n                const closeIndex = findClosingIndex(xmlData, [0x3e], //>\n                i, 'DOCTYPE is not closed.');\n                const tagExp = xmlData.subarray(i, closeIndex);\n                if (arrayIndexOf(tagExp, [0x5b]) >= 0) {\n                    i = arrayIndexOf(xmlData, [0x5d, 0x3e], i) + 1;\n                }\n                else {\n                    i = closeIndex;\n                } //![\n            }\n            else if (xmlData1 === 0x21 && xmlData2 === 0x5b) {\n                // <![CDATA[some stuff]]>\n                const closeIndex = findClosingIndex(xmlData, [0x5d, 0x5d, 0x3e], //]]>\n                i, 'CDATA is not closed.') - 2;\n                const tagExp = xmlData.subarray(i + 9, closeIndex);\n                //considerations\n                //1. CDATA will always have parent node\n                //2. A tag with CDATA is not a leaf node so it's value would be string type.\n                if (dataSize !== 0) {\n                    const value = options.trimValues\n                        ? arrayTrim(xmlData.subarray(dataIndex, dataIndex + dataSize))\n                        : xmlData.subarray(dataIndex, dataIndex + dataSize);\n                    currentNode.append(value);\n                }\n                if (options.cdataTagName) {\n                    //add cdata node\n                    const childNode = new XMLNode(options.cdataTagName, currentNode, tagExp, tagValueProcessor);\n                    currentNode.addChild(childNode);\n                    //add rest value to parent node\n                    if (tagExp) {\n                        childNode.bytes = tagExp;\n                    }\n                }\n                else {\n                    currentNode.append(tagExp);\n                }\n                i = closeIndex + 2;\n                dataSize = 0;\n                dataIndex = i + 1;\n            }\n            else {\n                //Opening a normal tag\n                const parsedOpeningTag = closingIndexForOpeningTag(xmlData, i + 1);\n                const tagData = parsedOpeningTag.data.replaceAll(/\\r?\\n|\\t/g, ' ');\n                const closeIndex = parsedOpeningTag.index;\n                const separatorIndex = tagData.indexOf(' ');\n                let shouldBuildAttributesMap = true;\n                let tagName = separatorIndex !== -1\n                    ? tagData.slice(0, Math.max(0, separatorIndex)).replace(/\\s+$/, '')\n                    : tagData;\n                let tagAttributes = separatorIndex !== -1 ? tagData.slice(separatorIndex + 1) : '';\n                if (options.ignoreNameSpace) {\n                    const colonIndex = tagName.indexOf(':');\n                    if (colonIndex !== -1) {\n                        tagName = tagName.slice(colonIndex + 1);\n                        shouldBuildAttributesMap =\n                            tagName !== parsedOpeningTag.data.slice(colonIndex + 1);\n                    }\n                }\n                //save text to parent node\n                if (currentNode && dataSize !== 0 && currentNode.tagName !== '!xml') {\n                    currentNode.append(options.trimValues\n                        ? arrayTrim(xmlData.subarray(dataIndex, dataIndex + dataSize))\n                        : xmlData.subarray(dataIndex, dataIndex + dataSize));\n                }\n                if (tagData.length > 0 && tagData.endsWith('/')) {\n                    //selfClosing tag\n                    if (tagAttributes) {\n                        // <abc def=\"123\"/>\n                        tagAttributes = tagAttributes.slice(0, Math.max(0, tagAttributes.length - 1));\n                    }\n                    else {\n                        // <abc/>\n                        tagName = tagName.slice(0, Math.max(0, tagName.length - 1));\n                    }\n                    const childNode = new XMLNode(tagName, currentNode, new Uint8Array(0), tagValueProcessor);\n                    if (tagAttributes) {\n                        childNode.attributes = parseAttributesString(tagAttributes, options);\n                    }\n                    currentNode.addChild(childNode);\n                }\n                else {\n                    //opening tag\n                    const childNode = new XMLNode(tagName, currentNode, new Uint8Array(0), tagValueProcessor);\n                    if (options.stopNodes?.length &&\n                        options.stopNodes.includes(childNode.tagName)) {\n                        childNode.startIndex = closeIndex;\n                    }\n                    if (tagAttributes && shouldBuildAttributesMap) {\n                        childNode.attributes = parseAttributesString(tagAttributes, options);\n                    }\n                    currentNode.addChild(childNode);\n                    currentNode = childNode;\n                }\n                i = closeIndex;\n                dataSize = 0;\n                dataIndex = i + 1;\n            }\n        }\n        else {\n            dataSize++;\n        }\n    }\n    return traversable;\n}\n//# sourceMappingURL=getTraversable.js.map","const base64codes = Uint8Array.from([\n    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255,\n    255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255,\n    255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n    21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32,\n    33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n]);\n/**\n * Convert a Uint8Array containing a base64 encoded bytes to a Uint8Array containing decoded values\n * @param input\n * @returns a Uint8Array containing the decoded bytes\n */\nexport function decode(input) {\n    if (!ArrayBuffer.isView(input)) {\n        input = new Uint8Array(input);\n    }\n    if (input.length % 4 !== 0) {\n        throw new Error('Unable to parse base64 string.');\n    }\n    const output = new Uint8Array(3 * (input.length / 4));\n    if (input.length === 0)\n        return output;\n    const missingOctets = input.at(-2) === 61 ? 2 : input.at(-1) === 61 ? 1 : 0;\n    for (let i = 0, j = 0; i < input.length; i += 4, j += 3) {\n        const buffer = (base64codes[input[i]] << 18) |\n            (base64codes[input[i + 1]] << 12) |\n            (base64codes[input[i + 2]] << 6) |\n            base64codes[input[i + 3]];\n        output[j] = buffer >> 16;\n        output[j + 1] = (buffer >> 8) & 0xff;\n        output[j + 2] = buffer & 0xff;\n    }\n    return output.subarray(0, output.length - missingOctets);\n}\n//# sourceMappingURL=decode.js.map","export const base64codes = Uint8Array.from([\n    65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,\n    84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,\n    107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,\n    122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47,\n]);\n//# sourceMappingURL=base64codes.js.map","import { base64codes } from './base64codes';\n/*\n3 bytes are encoded in 4 bytes of base64\n11111122 22223333 33444444\nWe want to be the fastest possible, so we will use a lookup table to convert 12 bits to 2 bytes of base64\nBut in order still to avoid one operation we will create 2 of those lookup tables.\n- One for 2222 11111122\n- One for 3333 33444444\n*/\n// 2222 11111122\nconst base64codes1 = new Uint32Array(64 * 64);\nfor (let i = 0; i < 64; i++) {\n    for (let j = 0; j < 64; j++) {\n        const index = (i << 2) | ((j & 0x30) >> 4) | ((j & 0x0f) << 8);\n        base64codes1[index] = base64codes[i] | (base64codes[j] << 8);\n    }\n}\n// 3333 33444444 that we store on the bits 16->31 just to allow to make directly the OR with the previous value\nconst base64codes2 = new Uint32Array(64 * 64);\nfor (let i = 0; i < 64; i++) {\n    for (let j = 0; j < 64; j++) {\n        const index = (i << 6) | j;\n        base64codes2[index] = (base64codes[i] << 16) | (base64codes[j] << 24);\n    }\n}\n/**\n * Convert a Uint8Array containing bytes to a Uint8Array containing the base64 encoded values\n * @param input\n * @returns a Uint8Array containing the encoded bytes\n */\nexport function encodeFast(input) {\n    const output32 = new Uint32Array(Math.ceil(input.length / 3));\n    let i, j;\n    for (i = 2, j = 0; i < input.length; i += 3, j++) {\n        output32[j] =\n            base64codes1[input[i - 2] | ((input[i - 1] & 0xf0) << 4)] |\n                base64codes2[input[i] | ((input[i - 1] & 0x0f) << 8)];\n    }\n    if (i === input.length + 1) {\n        // 1 octet yet to write\n        output32[j] =\n            base64codes[input[i - 2] >> 2] |\n                (base64codes[(input[i - 2] & 0x03) << 4] << 8) |\n                (15677 << 16);\n    }\n    if (i === input.length) {\n        // 2 octets yet to write\n        output32[j] =\n            base64codes[input[i - 2] >> 2] |\n                (base64codes[((input[i - 2] & 0x03) << 4) | (input[i - 1] >> 4)] << 8) |\n                (base64codes[(input[i - 1] & 0x0f) << 2] << 16) |\n                (61 << 24);\n    }\n    const output8 = new Uint8Array(output32.buffer);\n    return output8;\n}\n//# sourceMappingURL=encodeFast.js.map","import { decode } from 'uint8-base64';\n\nimport { inflate } from './inflate.js';\n\nexport async function decodeData(data, options = {}) {\n  if (!(data instanceof Uint8Array)) {\n    throw new TypeError('data should be an Uint8Array');\n  }\n  let {\n    endian = 'little',\n    precision,\n    float = true,\n    compression = '',\n    base64 = true,\n    ontologies = {},\n  } = options;\n\n  if ('MS:1000519' in ontologies) {\n    precision = 32;\n    float = false;\n  }\n  if ('MS:1000520' in ontologies) precision = 16;\n  if ('MS:1000521' in ontologies) precision = 32;\n  if ('MS:1000522' in ontologies) {\n    float = false;\n    precision = 64;\n  }\n  if ('MS:1000523' in ontologies) precision = 64;\n  if ('MS:1000574' in ontologies) compression = 'zlib';\n\n  if (base64) {\n    data = decode(data);\n  }\n\n  switch (compression.toLowerCase()) {\n    case 'zlib':\n      data = await inflate(data);\n      break;\n    case '':\n    case 'none':\n      break;\n    default:\n      throw new Error(`Unknown compression algorithm: ${compression}`);\n  }\n\n  switch (endian.toLowerCase()) {\n    case 'little':\n      break;\n    case 'network':\n    case 'big':\n      {\n        // we will invert in place the data\n        let step;\n        switch (precision) {\n          case 32:\n            step = 4;\n            break;\n          case 64:\n            step = 8;\n            break;\n          default:\n            throw new Error('Can not process bigendian file');\n        }\n        for (let i = 0; i < data.length - (data.length % step); i += step) {\n          for (let j = 0; j < step / 2; j++) {\n            const temp = data[i + j];\n            data[i + j] = data[i + step - 1 - j];\n            data[i + step - 1 - j] = temp;\n          }\n        }\n      }\n      break;\n    default:\n      throw new TypeError(`Attributes endian not correct: ${endian}`);\n  }\n\n  /*\n       We should take care that the length of the Uint8Array is correct but the buffer\n       may be a little bit bigger because when decoding base 64 it may end with = or ==\n       and we plan the size in the buffer.\n      */\n\n  if (float) {\n    switch (precision) {\n      case 32:\n        return new Float32Array(\n          data.buffer,\n          data.byteOffset,\n          data.byteLength / Float32Array.BYTES_PER_ELEMENT,\n        );\n      case 64:\n        return new Float64Array(\n          data.buffer,\n          data.byteOffset,\n          data.byteLength / Float64Array.BYTES_PER_ELEMENT,\n        );\n\n      default:\n        throw new TypeError(`Incorrect precision: ${precision}`);\n    }\n  } else {\n    switch (precision) {\n      case 32:\n        return new Int32Array(\n          data.buffer,\n          data.byteOffset,\n          data.byteLength / Int32Array.BYTES_PER_ELEMENT,\n        );\n      case 64:\n        return new BigInt64Array(\n          data.buffer,\n          data.byteOffset,\n          data.byteLength / BigInt64Array.BYTES_PER_ELEMENT,\n        );\n      default:\n        throw new TypeError(`Incorrect precision: ${precision}`);\n    }\n  }\n}\n","export async function inflate(zlibCompressedData) {\n  const inputStream = new ReadableStream({\n    start(controller) {\n      controller.enqueue(zlibCompressedData);\n      controller.close();\n    },\n  });\n\n  const decompressedStream = inputStream.pipeThrough(\n    new DecompressionStream('deflate'),\n  );\n\n  const reader = decompressedStream.getReader();\n  const chunks = [];\n  let totalLength = 0;\n\n  while (true) {\n    // eslint-disable-next-line no-await-in-loop\n    const { value, done } = await reader.read();\n    if (done) break;\n    chunks.push(value);\n    totalLength += value.length;\n  }\n\n  // Combine chunks into a single Uint8Array\n  const decompressedData = new Uint8Array(totalLength);\n  let offset = 0;\n  for (const chunk of chunks) {\n    decompressedData.set(chunk, offset);\n    offset += chunk.length;\n  }\n\n  return decompressedData;\n}\n","export function parseCvParam(cvParam) {\n  let result = {};\n  if (!cvParam) return result;\n  let cvParams;\n  if (Array.isArray(cvParam)) {\n    cvParams = cvParam;\n  } else {\n    cvParams = [cvParam];\n  }\n  for (let param of cvParams) {\n    let attributes = param.attributes;\n    if (attributes.name) {\n      result[attributes.name.toLowerCase()] = {\n        accession: attributes.accession,\n        cvLabel: attributes.cvLabel,\n        value: attributes.value,\n        name: attributes.name,\n      };\n    }\n  }\n  return result;\n}\n","import { parse } from 'arraybuffer-xml-parser';\nimport { recursiveResolve } from 'ml-spectra-processing';\n\nimport { decodeData } from '../util/decodeData.js';\n\nimport { processMetadata } from './processMetaData.js';\nimport { processSpectrumList } from './processSpectrumList.js';\n\nconst decoder = new TextDecoder();\n\n/**\n *\n * @param {*} arrayBuffer\n * @param {import('../Options.js').Options} [options={}]\n * @returns\n */\nexport async function parseMzData(arrayBuffer, options = {}) {\n  const { logger = console } = options;\n  const result = {\n    metadata: {},\n    times: [],\n    series: {\n      ms: {\n        data: [],\n      },\n    },\n  };\n\n  let parsed = parse(arrayBuffer, {\n    attributesNodeName: 'attributes',\n    attributeNameProcessor: (attributeName) => attributeName,\n    tagValueProcessor: (value, node) => {\n      if (node.tagName !== 'data') return decoder.decode(value);\n      const promise = decodeData(node.bytes, node.attributes);\n      // avoid unhandled promise rejection and swallow the error\n      promise.catch((error) => {\n        logger.error('error decoding base64', error);\n        return [];\n      });\n      return promise;\n    },\n  });\n  await recursiveResolve(parsed);\n  processMetadata(parsed.mzData, result.metadata);\n  processSpectrumList(parsed.mzData, result.times, result.series.ms.data);\n\n  return result;\n}\n","import { parseCvParam } from './parseCvParam.js';\n\nexport function processMetadata(parsed, metadata) {\n  if (!parsed || !parsed.description) return;\n  let description = parsed.description;\n  if (description.dataProcessing) {\n    let dataProcessing = description.dataProcessing;\n    if (dataProcessing.software && dataProcessing.software.name) {\n      metadata.software = dataProcessing.software.name;\n    }\n  }\n  if (description.instrument) {\n    let instrument = description.instrument;\n    if (instrument.analyzerList && instrument.analyzerList.analyzer) {\n      let analyzer = instrument.analyzerList.analyzer;\n      let cvParam = parseCvParam(analyzer.cvParam);\n      if (cvParam.analyzertype) {\n        metadata.analyzer = cvParam.analyzertype.value;\n      }\n    }\n    if (instrument.detector) {\n      let detector = instrument.detector;\n      let cvParam = parseCvParam(detector.cvParam);\n      if (cvParam.detectortype) {\n        metadata.detector = cvParam.detectortype.value;\n      }\n    }\n  }\n}\n","import { parseCvParam } from './parseCvParam.js';\n\nexport function processSpectrumList(parsed, times, msData) {\n  if (!parsed || !parsed.spectrumList || !parsed.spectrumList.spectrum) return;\n  let spectrumList = parsed.spectrumList.spectrum;\n  for (let spectrum of spectrumList) {\n    let info = parseCvParam(\n      spectrum.spectrumDesc.spectrumSettings.spectrumInstrument.cvParam,\n    );\n\n    times.push(info.timeinminutes.value);\n\n    let mzArray = spectrum.mzArrayBinary.data['#text'] || [];\n    let intensity = spectrum.intenArrayBinary.data['#text'] || [];\n    msData.push([mzArray, intensity]);\n  }\n}\n","export function parseCvParam(cvParam) {\n  let result = {};\n  if (!cvParam) return result;\n  let cvParams;\n  if (Array.isArray(cvParam)) {\n    cvParams = cvParam;\n  } else {\n    cvParams = [cvParam];\n  }\n  for (let parameter of cvParams) {\n    let attributes = parameter.attributes;\n    if (attributes.name) {\n      result[attributes.accession] = attributes;\n    }\n  }\n  return result;\n}\n","import { parse } from 'arraybuffer-xml-parser';\nimport { recursiveResolve } from 'ml-spectra-processing';\n\nimport { decodeData } from '../util/decodeData.js';\n\nimport { processSpectrumList } from './processSpectrumList.js';\n\nconst decoder = new TextDecoder();\n\n// https://www.psidev.info/mzml\n// CV = Controlled vocabulary\nexport async function parseMzML(mzmlBuffer, options = {}) {\n  const { logger = console, rawData } = options;\n\n  if (!(mzmlBuffer instanceof ArrayBuffer)) {\n    throw new TypeError('mzmlBuffer should be an ArrayBuffer');\n  }\n\n  if (rawData && !(rawData instanceof ArrayBuffer)) {\n    throw new TypeError('rawData should be an ArrayBuffer');\n  }\n\n  const rawDataUint8Array = rawData && new Uint8Array(rawData);\n\n  const result = {\n    metadata: {},\n    times: [],\n    series: {\n      ms: {\n        data: [],\n      },\n    },\n  };\n\n  const referenceableParamGroups = {};\n\n  let parsed = parse(mzmlBuffer, {\n    attributesNodeName: 'attributes',\n    attributeNameProcessor: (attributeName) => attributeName,\n    tagNameProcessor: (name, nodes) => {\n      switch (name) {\n        case 'referenceableParamGroupList':\n          {\n            const children = nodes[0]?.children?.referenceableParamGroup;\n            for (const group of children) {\n              const id = group.attributes?.id;\n              referenceableParamGroups[id] = group.children;\n            }\n          }\n          break;\n        case 'referenceableParamGroupRef':\n          for (const node of nodes) {\n            // need to append the references children to the parent\n            const ref = node.attributes.ref;\n            if (referenceableParamGroups[ref]) {\n              const parent = node.parent;\n              parent.children = parent.children || {};\n              for (const key in referenceableParamGroups[ref]) {\n                parent.children[key] = parent.children[key] || [];\n                parent.children[key].push(\n                  ...referenceableParamGroups[ref][key],\n                );\n              }\n            }\n          }\n          break;\n        case 'cvParam':\n          break;\n        default:\n      }\n      return name;\n    },\n    tagValueProcessor: (value, node) => {\n      if (node.tagName !== 'binary') return decoder.decode(value);\n      const referenceableParamGroupRefs =\n        node.parent?.children?.referenceableParamGroupRef?.map(\n          (ref) => ref.attributes.ref,\n        ) || [];\n      const ontologies = {};\n      referenceableParamGroupRefs.forEach((ref) => {\n        if (referenceableParamGroups[ref]) {\n          Object.assign(ontologies, referenceableParamGroups[ref]);\n        }\n      });\n      node.parent.children.cvParam.forEach((cv) => {\n        ontologies[cv.attributes.accession] = cv.attributes.value;\n      });\n\n      let promise;\n      if ('IMS:1000102' in ontologies) {\n        // external data offset\n        const offset = parseInt(ontologies['IMS:1000102'], 10);\n        const encodedLength = parseInt(ontologies['IMS:1000104'], 10);\n\n        promise = decodeData(\n          rawDataUint8Array.subarray(offset, offset + encodedLength),\n          {\n            ontologies,\n            base64: false,\n          },\n        );\n      } else {\n        promise = decodeData(node.bytes, { ontologies, base64: true });\n      }\n\n      // avoid unhandled promise rejection and swallow the error\n      promise.catch((error) => {\n        logger.error('error decoding base64', error);\n        return [];\n      });\n      return promise;\n    },\n  });\n  // parsed file still contains promises\n  await recursiveResolve(parsed);\n\n  const mzML = parsed.mzML || parsed.indexedmzML.mzML;\n\n  processSpectrumList(mzML, result.times, result.series.ms.data);\n\n  return result;\n}\n","import { parseCvParam } from './parseCvParam.js';\n\nexport function processSpectrumList(parsed, times, msData) {\n  if (\n    !parsed ||\n    !parsed.run ||\n    !parsed.run.spectrumList ||\n    !parsed.run.spectrumList.spectrum\n  ) {\n    return;\n  }\n  let spectrumList = parsed.run.spectrumList.spectrum;\n\n  for (let spectrum of spectrumList) {\n    if (!spectrum.binaryDataArrayList) continue;\n    let scanList = spectrum.scanList;\n    if (Array.isArray(scanList)) throw new Error('Unsupported scanList');\n\n    let scan = scanList.scan;\n\n    if (typeof scan !== 'object') continue;\n    if (Array.isArray(scan)) {\n      throw new Error('processSpectrumList: scan may not be an array');\n    }\n    const cvParam = parseCvParam(scan.cvParam);\n    times.push(cvParam['MS:1000016'].value);\n\n    const dataArrayList = spectrum.binaryDataArrayList.binaryDataArray;\n    if (dataArrayList.length !== 2) {\n      throw new Error('Can not decodeData because length !== 2');\n    }\n\n    const first = dataArrayList[0];\n    const firstCVParams = parseCvParam(first.cvParam);\n    const second = dataArrayList[1];\n    const secondCVParams = parseCvParam(second.cvParam);\n\n    // MS:1000514 - m/z array\n    // MS:1000515 - intensity array\n    if (firstCVParams['MS:1000514'] && secondCVParams['MS:1000515']) {\n      msData.push([first.binary, second.binary]);\n    }\n    if (firstCVParams['MS:1000515'] && secondCVParams['MS:1000514']) {\n      msData.push([second.binary, first.binary]);\n    }\n  }\n}\n","import { parse } from 'arraybuffer-xml-parser';\nimport { recursiveResolve } from 'ml-spectra-processing';\n\nimport { decodeData } from '../util/decodeData.js';\n\nimport { processSpectrumList } from './processSpectrumList.js';\n\nconst decoder = new TextDecoder();\n\n/**\n *\n * @param {*} arrayBuffer\n * @param {import('../Options.js').Options} [options]\n * @returns\n */\nexport async function parseMzXML(arrayBuffer, options = {}) {\n  const { logger = console } = options;\n  const result = {\n    metadata: {},\n    times: [],\n    series: {\n      ms: {\n        data: [],\n      },\n    },\n  };\n  let parsed = parse(arrayBuffer, {\n    attributesNodeName: 'attributes',\n    attributeNameProcessor: (attributeName) => attributeName,\n    tagValueProcessor: (value, node) => {\n      if (node.tagName !== 'peaks') return decoder.decode(value);\n\n      const promise = decodeData(node.bytes, {\n        precision: node.attributes.precision,\n        endian: node.attributes.byteOrder,\n        compression: node.attributes.compressionType,\n      });\n      // avoid unhandled promise rejection and swallow the error\n      promise.catch((error) => {\n        logger.error('error decoding base64', error);\n        return [];\n      });\n      return promise;\n    },\n  });\n  await recursiveResolve(parsed);\n\n  processSpectrumList(parsed.mzXML, result.times, result.series.ms);\n\n  return result;\n}\n","export function processSpectrumList(parsed, times, msData) {\n  if (!parsed.msRun.scan) return;\n  let scanList = parsed.msRun.scan;\n  if (Array.isArray(scanList) === false) scanList = [scanList];\n  if (scanList[0].attributes) msData.info = [];\n  for (let scan of scanList) {\n    if (typeof scan !== 'object') continue;\n    if (Array.isArray(scan)) {\n      throw new Error('processSpectrumList: scan may not be an array');\n    }\n    const dataArray = scan.peaks['#text'];\n    let length = dataArray.length / 2;\n    let first = new Float64Array(length);\n    let second = new Float64Array(length);\n    for (let i = 0; i < length; i++) {\n      first[i] = dataArray[i * 2];\n      second[i] = dataArray[i * 2 + 1];\n    }\n    msData.data.push([first, second]);\n    msData.info.push(scan.attributes);\n    times.push(\n      parseFloat(\n        scan.attributes.retentionTime.replace(/(?:P*)(?:T*)(?:S*)/gi, ''),\n      ),\n    );\n  }\n}\n","import { parseMzData } from './mzdata/parseMzData.js';\nimport { parseMzML } from './mzml/parseMzML.js';\nimport { parseMzXML } from './mzxml/parseMzXML.js';\n\nconst decoder = new TextDecoder();\n\n/**\n * Reads a mzData v1.05 file\n * @param {ArrayBuffer|string} xml - ArrayBuffer or String or any Typed Array (including Node.js' Buffer from v4) with the data\n * @param {import('./Options.js').Options} [options={}]\n * @return Promise<{{times: Array<number>, series: { ms: { data:Array<Array<number>>}}}}>\n */\nexport async function parseMZ(xml, options = {}) {\n  if (typeof xml === 'string') {\n    const encoder = new TextEncoder();\n    xml = encoder.encode(xml);\n  }\n\n  if (!ArrayBuffer.isView(xml)) {\n    xml = new Uint8Array(xml);\n  }\n\n  const header = xml.subarray\n    ? decoder.decode(xml.subarray(0, 200))\n    : xml.substring(0, 200);\n\n  if (header.includes('mzData')) {\n    return parseMzData(xml, options);\n  } else if (header.includes('mzML')) {\n    return parseMzML(xml, options);\n  } else if (header.includes('mzXML')) {\n    return parseMzXML(xml, options);\n  } else {\n    throw new Error(`MZ parser: unknown format`);\n  }\n}\n","import { kovats } from '../kovats';\n\nexport function appendKovats(peaks) {\n  const result = [];\n  for (let peak of peaks) {\n    result.push({ ...peak, kovats: kovats(peak.ms) });\n  }\n  return result;\n}\n","import { convert as converter } from 'jcampconverter';\n\nimport { fromJSON } from '../Chromatogram';\n\nexport function fromJcamp(jcamp) {\n  const data = converter(jcamp, { chromatogram: true }).flatten[0].chromatogram;\n  return fromJSON(data);\n}\n","import { netcdfGcms } from 'netcdf-gcms';\n\nimport { fromJSON } from '../Chromatogram';\n\nexport function fromNetCDF(netcdf) {\n  return fromJSON(netcdfGcms(netcdf));\n}\n","import { parseXY } from 'xy-parser';\n\nimport { Chromatogram } from '../Chromatogram';\n\nexport function fromText(text, options = {}) {\n  const data = parseXY(text, options);\n\n  const time = data.x;\n  let series = {\n    intensity: data.y,\n  };\n\n  return new Chromatogram(time, series);\n}\n","import { parseMZ } from 'mzdata';\n\nimport { fromJSON } from '../Chromatogram';\n\nexport async function fromXML(xml) {\n  return fromJSON(await parseMZ(xml));\n}\n","import { PolynomialRegression } from 'ml-regression-polynomial';\n\nexport function scaleAlignment(reference, sample, options = {}) {\n  const { computeQuality = false, polynomialDegree = 3 } = options;\n  let referenceTime = reference.map((val) => val.retentionTime);\n  let sampleTime = sample.map((val) => val.retentionTime);\n\n  const regression = new PolynomialRegression(\n    sampleTime,\n    referenceTime,\n    polynomialDegree,\n  );\n\n  let error = new Array(sample.length);\n  for (let i = 0; i < sample.length; i++) {\n    error[i] =\n      reference[i].retentionTime - regression.predict(sample[i].retentionTime);\n  }\n\n  let ans = {\n    scaleRegression: regression,\n  };\n\n  if (computeQuality) {\n    let score = regression.score(sampleTime, referenceTime);\n    ans.r2 = score.r2;\n    ans.error = error;\n  }\n  return ans;\n}\n"],"names":["toString","Object","prototype","isAnyArray","value","tag","call","endsWith","includes","reimAbsolute","data","options","length","re","output","Float64Array","im","i","Math","hypot","getOutputArray","undefined","TypeError","xAbsolute","array","tmpArray","slice","xMedian","input","exact","middleIndex","calcMiddle","median","quickSelect","low","high","middle","currentLow","currentHigh","swap","j","temp","floor","xCheck","minLength","Error","xFindClosestIndex","target","sorted","abs","index","diff","Number","POSITIVE_INFINITY","currentDiff","xGetFromToIndex","x","fromIndex","toIndex","from","to","xAbsoluteSum","sum","xAdd","array1","array2","isConstant","constant","array3","xMultiply","xDotProduct","A","B","g","result","xCrossCorrelation","tau","lag","n","q","k","w","l","xBinning","binSize","numberOfPoints","keepFirstAndLast","RangeError","isInteger","innerLength","innerBins","start","end","binByNumberOfPoints","effectiveBinSize","innerBinCount","ceil","min","outputLength","xBoxPlot","sort","at","EPSILON","shortTestNumber","String","q1","q3","max","posQ1","posQ3","medianPos","q1MinProportion","q3MinProportion","medianMinProportion","xBoxPlotWithOutliers","boxPlot","lowerWhisker","upperWhisker","minWhisker","maxWhisker","iqr","outliers","push","xCheckLengths","xCorrelation","sumA","sumA2","sumB","sumB2","sumAB","a","b","sqrt","EVD","matrix","Matrix","MatrixTransposeView","NIPALS","SVD","solve","absDiff","xCumulative","newArray","xMean","sumValue","xVariance","values","unbiased","mean","sqrError","xStandardDeviation","xEnsureFloat64","xGetTargetIndex","targetIndex","FFT","size","this","_csize","table","Array","angle","PI","cos","sin","power","t","_width","_bitrev","shift","revShift","_out","_data","_inv","fft","fromComplexArray","complex","storage","res","createComplexArray","toComplexArray","completeSpectrum","spectrum","half","transform","out","_transform4","realTransform","_realTransform4","inverseTransform","outOff","step","len","bitrev","off","_singleTransform2","_singleTransform4","inv","quarterLen","limit","C","D","Ar","Ai","Br","Bi","Cr","Ci","Dr","Di","MAr","MAi","tableBr","tableBi","MBr","MBi","tableCr","tableCi","MCr","MCi","tableDr","tableDi","MDr","MDi","T0r","T0i","T1r","T1i","T2r","T2i","T3r","T3i","FAr","FAi","FCr","FCi","FBr","FBi","FDr","FDi","evenR","evenI","oddR","oddI","leftR","leftI","rightR","rightI","step2","step3","_singleRealTransform2","_singleRealTransform4","halfLen","hquarterLen","SFAr","SFAi","SFBr","SFBi","SA","SB","createNumberArray","ArrayConstructor","fill","createDoubleArray","createFromToArray","includeFrom","includeTo","distribution","div","delta","base","firstExponent","log","FLOAT_MUL","multiplyUint32","m","nlo","XSadd","random","state","constructor","seed","Date","now","Uint32Array","init","getFloat","bind","getUint32","nextState","periodCertification","createRandomArray","standardDeviation","range","generator","returnArray","gaussianGenerator","GaussianGenerator","generateGaussian","spare","hasSpare","val","u","v","s","isPowerOfTwo","nextPowerOfTwo","async","recursiveResolve","object","promises","appendPromises","Promise","all","key","then","modifier","ArrayBuffer","isView","xSubtract","calculateAdaptiveWeights","yData","baseline","weights","controlPoints","factorStd","learningRate","absResiduals","mad","threshold","rawWeights","exp","oneMinusLearningRate","weight","cleanCyclicObject","removeProperty","visitedObjects","WeakMap","recursiveClean","parent","parentKey","isObject","has","set","Reflect","ownKeys","isEmpty","deleteProperty","isArray","arrayElement","removeEmptyArrayAndObject","splice","test","repr","arg","isUndefined","isNull","isString","keys","hilbertTransformWithFFT","hilbertSignal","resampling","oldLength","ratio","currentIndex","xMaxValue","maxValue","xMinValue","minValue","xHistogram","histogram","centerX","nbSlots","logBaseX","logBaseY","absolute","logOfBase","log10","slotSize","y","element","xIsEquallySpaced","tolerance","maxDx","minDx","MAX_SAFE_INTEGER","absoluteDifference","xIsMonotonic","shiftSubTree","depth","level","slot","currentLevel","levelSlotShift","levelShift","levelSlotSize","slotIndex","getDepth","log2","xMedianAbsoluteDeviation","averageDeviations","xMinMaxValues","P1","Q1","P2","Q2","P3","Q3","P4","Q4","P5","Q5","polyval","c","p","coef","calc","P","Q","Y","erfcinv","r","sign","isNaN","NaN","NEGATIVE_INFINITY","simpleNormInvNumber","magnitudeMode","SQRT2","simpleNormInv","xNoiseSanPlot","mask","cutOff","refine","scaleFactor","fixOffset","filter","_e","reverse","prepareData","medianIndex","firstNegativeValueIndex","findIndex","e","lastPositiveValueIndex","signPositive","signNegative","cutOffDist","considerList","indexMax","round","minKi","whereToCutStat","top","elementsOfCutOff","averageValue","kiSqrt","determineCutOff","initialNoiseLevelPositive","skyPoint","initialNoiseLevelNegative","noiseLevelPositive","noiseLevelNegative","cloneSignPositive","cloneSignNegative","cutOffSignalsIndexPlus","cutOffSignalsIndexNeg","cutOffSignals","correctionFactor","effectiveCutOffDist","refinedCorrectionFactor","positive","negative","snr","sanplot","generateSanPlot","fromTo","scale","xNoiseStandardDeviation","sd","xSum","xNormed","algorithm","absoluteSumValue","absoluteSum","currentMaxValue","factor","sumFactor","xPadding","fromEnd","toEnd","xRolling","fct","window","padding","padded","subarray","xRollingAverage","xRotate","xSequentialFillFromStep","parameters","xSortDescending","matrixCreateEmpty","nbRows","nbColumns","newMatrix","row","matrixCheck","firstLength","matrixCholeskySolver","nonZerosArray","dimension","permutationEncoded","pinv","Int32Array","mt","ar","ac","nnz","ap","ai","ax","lnz","idx","colOffset","col","adr","d","lp","lnzArray","flag","pattern","bp1","apLoc","aiLoc","parentLoc","lnzLoc","flagLoc","kk","p2","ldlSymbolic","nz","lx","li","axLoc","lpLoc","liLoc","lxLoc","dLoc","yLoc","patternLoc","yi","lKi","p2col","ldlNumeric","perm","xLoc","bLoc","ldlPerm","ldlLsolve","ldlDsolve","ldlLTsolve","ldlPermt","matrixClone","map","matrixCuthillMckee","list","adj","visited","toVisit","eol","ptr","nbhd","matrixCheckRanges","boundaries","startRow","endRow","startColumn","endColumn","matrixMinMaxAbsoluteZ","column","matrixMinMaxZ","matrixMaxAbsoluteZ","matrixToArray","flatten","currentRow","addWeights","leftHandSide","rightHandSide","nbPoints","newLeftHandSide","newRightHandSide","diag","next","xWhittakerSmoother","restOptions","lambda","maxIterations","getWeightsAndControlPoints","prevBaseline","baseDiag","lower","upper","main","rhs","solution","workC","workD","iteration","Infinity","solveTridiagonalFloat64","calculateDelta","whittakerByThomas","upperTriangularNonZeros","permutationEncodedArray","last","createSystemMatrix","cho","newBaseline","whittakerByCholesky","xWhitakerSmoother","cp","dp","cprime","dprime","denom","reimPhaseCorrection","phi0","phi1","inPlace","isFinite","outRe","outIm","firstAngle","alpha","beta","cosTheta","sinTheta","ii","newSinTheta","determiningGlobalValues","ph0Values","ph0","ph1","sxtw","swx","sw","sxtwy","swy","detMx","inMx","weightedLinearRegression","maxDiff","MIN_SAFE_INTEGER","predictedPh0","autoPhaseRegion","x0","stop","maxSteps","bestAng","minArea","dAng","negArea","getNegArea","toRadians","phased","area","sumX","robustBaseLineRegionsDetection","maxDistanceToJoin","factorNoise","Uint8Array","change","count","prev","degree","zeroShift","inverse","reimZeroFilling","totalLength","newRE","newIM","xyCheck","xyMaxYPoint","current","STEPS","zonesNormalize","zones","exclusions","zone","currentZone","beforeExclusionsZones","normalizedExclusions","currentExclusionIndex","results","zoneIndex","zonesWithPoints","normalizedZones","zonesWithNumberOfPoints","unitsPerPoint","reduce","previous","currentTotal","tempZone","tempZoneNumberOfPoints","integral","x1","slope","intercept","getSlope","y0","y1","processZone","variant","xLength","halfStep","lastStep","previousX","MAX_VALUE","previousY","nextX","nextY","frontOutsideSpectra","backOutsideSpectra","currentValue","currentPoints","equallySpacedSlot","initialOriginalStep","lastOriginalStep","sumAtMin","sumAtMax","add","equallySpacedSmooth","xyIntegration","currentxyIntegration","xyInterpolateLinear","xTarget","sparseIndex","targetX","leftIdx","rightIdx","xyJoinX","deltaIsFunction","position","notEnoughPoints","internalZones","totalPoints","newX","newY","getInternalZones","xySortX","floatX","floatY","xyObject","response","xyUniqueX","isSorted","cumulativeY","divider","average","getSlots","possibleXs","flatMap","currentSlot","number","slots","currentDelta","xyArrayWeightedMerge","deltaNumber","positions","point","nextValue","maxX","sumY","sumXY","minIndex","minX","currentX","xyObjectCheck","points","xyObjectMaxXPoint","xyObjectMinXPoint","xyObjectSlotX","slotWidth","halfSlot","backtrack","pop","targetMin","targetMax","clamp","algorithmOptions","originalMin","originalMax","convert","kind","getDataConverter","originalRange","targetRange","checkRange","matrixInitial","dictionary","arrayOfValues","targetArray","sourceArray","info","columnArray","q1max","q3min","middleOver","transpose","rows","correlation","getRow","duplicate","subMatrix","fftResult","minMax","xHistogramOptions","finalHistogram","invertedDictionary","ret","nRows","nColumns","dictCategoricalToNumerical","matrixB","normalizationFactor","getRowVector","norm","setRow","referenceSpectrum","columns","currentVariable","getColumn","medianOfQuotients","quotients","getColumnVector","mulRow","to2DArray","currentMax","currentMin","propertiesToRemove","otherOptions","applyZeroShift","csize","complexArray","source","minRegSize","finalPeaks","magnitudeData","peaksDs","dk","holoborodko","peaksSp","sp","detectBaselineRegions","indexMask","counter","reTmp","imTmp","newRe","newIm","numRows","resultRe","resultIm","reRow","imRow","numColumns","colRe","colIm","direction","replacer","space","JSON","stringify","internalReplacer","variableLabel","fctString","Function","replaceAll","toReturn","rowsArray","columnsArray","nb","forceFFT","inClockwise","aSum","cSum","hilbertTransform","recenter","similarityFct","depth1","depth2","similarity","maxSimilarity","value1","value2","maxIndex","sumWeights","minDelta","maxDelta","maxCount","counts","sqrtSD","higherWhisker","filteredArray","downSampling","unique","Set","toReversed","deltaX","xy2","xyValue","data1","data2","common","y2","length1","length2","difference","weightedX","requiredY","ys","newYs","every","filterRequiredY","firstXs","otherXs","currentPosition","getSlotsToFirst","meanX","meanY","error","cumulativeSum","maxY","x25","x50","x75","x100","xMode","currentStep","breakPoint","prevX","zonesWithPointsRes","xResult","yResult","zoneResult","concat","loop","minRelativeYValue","nbPeaks","descending","nbThreshold","currentZoneIndex","numberMaxPoints","currentxyIntegral","sumYs","sumProducts","weightedIntegral","firstIntegration","totalIntegration","totalWeightedIntegral","currentIntegration","lastIntegration","getWeightedIntegral","endIndexes","beginIndexes","currentBeginIndex","currentEndIndex","nextIndex","previousIndex","xyMaxY","groupWidth","merged","maxAbscissa","currentxyMaxY","maxima","startEqualIndex","cumSumY","windowSize","halfWindow","xValues","centerIndex","centroids","mergedPoints","originalIndex","mergedIndex","minY","numberCloseSlots","numberSlots","closeSlot","selected","peakLoop","item","close","existing","newPeak","xError","normalizedYs","structuredClone","entry","multiplier","newDiff","after","before","inflectionBefore","inflectionAfter","extrema","inflectionMiddle","width","gamma","optimize","appendFromTo","zoneNbPoints","first","maxApproximateNbPoints","internalZone","maxNbPoints","currentY","lastX","radius","shifted","yCenters","fromX","toX","yShift","currentMinYShift","objectArray","weightedAbscissa","zoneXValues","Series","meta","name","getData","is1D","is2D","toJSON","keep","newData","Series1D","super","Series2D","seriesFromArray","applyFilter","series","filtered","meanIntensity","percentage","basePeak","arrayMax","defineProperty","elementsAndIsotopes","nominal","mass","abundance","symbol","monoisotopicMass","elements","elementsAndIsotopes_js_1","require$$0","exports","elementsAndIsotopesObject","elementsAndStableIsotopes","elementsAndStableIsotopesObject","elementsObject","isotopesObject","elementsAndIsotopesObject_js_1","entries","isotope","isotopes","stableIsotopesObject","mostAbundant","unsaturationsObject","O","N","H","Na","K","Li","Ca","F","Si","Cl","I","groupsObject","groups_1","groups","forEach","mf","split","part","parts","match","groupsObject_js_1","oneLetter","usefulParts","Kind","BEGIN","ATOM","MULTIPLIER_RANGE","ISOTOPE","ISOTOPE_RATIO","CHARGE","SALT","OPENING_PARENTHESIS","CLOSING_PARENTHESIS","PRE_MULTIPLIER","MULTIPLIER","TEXT","parseCharge_1","parseCharge","charge","chargeNumber","charAt","Kind_1","require$$3","require$$4","parse","expandGroups","simplify","lastKind","char","ascii","charCodeAt","nextAscii","getNumber","MFError","ANCHOR","getAtom","getParenthesisCharge","getIsotope","isotopeRatio","getCurlyBracketIsotopeRatio","lastResult","atom","getNonParenthesisCharge","COMMENT","checkParenthesis","parsed","multipliers","newParsed","realMultiplier","currentMultiplier","distinctParsedObject","atomA","atomB","line","fromCharCode","indexOfDash","indexOf","parseNumberWithDivision","chemical_elements_1","expandedGroups","chemical_groups_1","substring","begin","SyntaxError","message","repeat","string","subSuperscript","superscript","Format","SUBSCRIPT","SUPERSCRIPT","improveLinesForDisplay","lines","Kind_js_1","beginCounter","endCounter","minCounter","nbParenthesisToSuppress","toSuppress","specialCases","Format_1","nbElectrons","improveLinesForDisplay_js_1","special","SUPERIMPOSE","over","formatCharge_js_1","formatCharge","under","join","require$$1","require$$2","isMF_1","isMF","Style","toHtml_1","toHtml","html","Style_1","SUPERIMPOSE_SUP_SUB","ensureCase_1","ensureCase","toUpperCase","newPart","two","one","getMF","currents","comment","groupIdentical","currentPart","parenthesisLevel","comments","optimizeRanges","newParts","mfsObject","hasRange","createMFs","mfs","getIsotopeRatioInfo_1","getIsotopeRatioInfo","isotopesArray","ratios","normalize","getEA_1","getEA","addMass","isotopeRatioInfo","eas","getElements_1","getElements","addElement","find","newElement","getNumberOfIsotopologues","atoms","nbIsotopes","getNbCombinationsPerAtom","nbAtoms","partToAtoms_1","partToMF_1","partToMF","neutral","getInfoInternal_1","getInfoInternal","customUnsaturations","emFieldName","msemFieldName","oneResult","getProcessedPart","nbIsotopologues","getNumberOfIsotopologues_1","unsaturation","require$$5","require$$6","partToAtoms","validUnsaturation","currentElement","getIsotopesInfo","isotopeKey","naturalDeltaNeutrons","deltaNeutrons","getDistribution","mostAbundantKey","partsToDisplay","partLine","toDisplay_js_1","partsToMF_1","partsToMF","expand","shouldExpandGroupsObject","createNewPart","previousKind","openingParenthesis","closingParenthesis","preMultiplier","postMultiplier","globalPartMultiplier","expandGroupsObject","group","expanded","Boolean","combineAtomsIsotopesCharges","calculateAndSortKeys","currentKey","atom_sorter_1","getKey","stringComparator","prop","toSorted","toText_1","toText","text","subSuperscript_1","subscript","MFInternal_1","MFInternal","parse_1","flatten_1","getInfo_1","getIsotopesInfo_1","require$$7","partsToDisplay_1","require$$8","require$$9","toDisplay_1","require$$10","require$$11","toParts_1","require$$12","require$$13","flattenLimit","some","flattened","cache","displayed","toDisplay","toParts","getInfo","ea","isotopesInfo","toMF","MF_1","MF","internal","toCanonicText","parse_js_1","toHtml_js_1","ensureUppercaseSequence_1","ensureUppercaseSequence","sequence","currentSymbol","startsWith","getEutrophicationPotential_1","getEutrophicationPotential","mfString","mf_parser_1","nC","nO","nN","nP","thOD","nH","ep","mw","getMsem_1","getMsem","em","ELECTRON_MASS","allowNeutralMolecules","ionization","forceIonization","targetMass","realIonization","ms","ppm","getRangesForFragment_1","getRangesForFragment","ranges","newRanges","currentMF","possibilities","MFRange_1","MFRange","getRange","currentRange","isInRange","rangeIndex","rangeElement","targetElement","mfDiff_1","mfDiff","mfString1","mfString2","mf1","mf2","preprocessIonizations_1","preprocessIonizations","ionizationsString","ionizations","preprocessRanges_1","preprocessRanges","possibility","originalMinCount","originalMaxCount","currentMinCount","currentMaxCount","currentCount","currentMonoisotopicMass","currentCharge","currentUnsaturation","initialOrder","minInnerMass","maxInnerMass","minInnerCharge","maxInnerCharge","minCharge","maxCharge","minMass","maxMass","innerCharge","isGroup","innerPossibility","GAUSSIAN_EXP_FACTOR","LN2","ROOT_PI_OVER_LN2","ROOT_THREE","ROOT_2LN2","ROOT_2LN2_MINUS_ONE","Gaussian","fwhm","gaussianWidthToFWHM","fwhmToWidth","gaussianFwhmToWidth","widthToFWHM","gaussianFct","getArea","height","calculateGaussianHeight","getGaussianArea","getFactor","getGaussianFactor","shape","pow","center","getGaussianData","calculateHeight","getParameters","ln1MinusXSqrd","lnEtcBy2Plus2","firstSqrt","erfinv","Lorentzian","lorentzianFwhmToWidth","lorentzianWidthToFWHM","lorentzianFct","getLorentzianArea","getLorentzianFactor","getLorentzianData","calculateLorentzianHeight","halfResidual","quantileFunction","tan","LorentzianDispersive","lorentzianDispersiveFct","_height","getLorentzianDispersiveData","PseudoVoigt","mu","pseudoVoigtFwhmToWidth","pseudoVoigtWidthToFWHM","pseudoVoigtFct","getPseudoVoigtArea","getPseudoVoigtFactor","calculatePseudoVoigtHeight","getPseudoVoigtData","GeneralizedLorentzian","generalizedLorentzianFwhmToWidth","generalizedLorentzianWidthToFWHM","generalizedLorentzianFct","getGeneralizedLorentzianArea","getGeneralizedLorentzianFactor","getGeneralizedLorentzianData","calculateGeneralizedLorentzianHeight","Gaussian2D","ensureFWHM2D","fwhmX","fwhmY","gaussian2DFct","getGaussian2DData","volume","getVolume","calculateGaussian2DHeight","getGaussian2DVolume","ensureXYNumber","xFWHM","yFWHM","axis","xCenter","yCenter","sdObject","getShape1D","getShape2D","BaseSpectrumGenerator","interval","peakWidthFct","assertNumber","assertInteger","resolvePeak","peak","intensity","peakFWHM","peakWidth","peakShapeOptions","shapeOptions","cloneShape","widthLeft","widthRight","shapeLeft","shapeRight","assign","create","getPrototypeOf","SpectrumGenerator","maxPeakHeight","reset","generateSpectrum","peaks","noise","peakOptions","addPeaks","addBaseline","addNoise","getSpectrum","addPeak","firstValue","lastValue","firstPoint","lastPoint","middlePoint","baselineFct","xs","percent","copy","minPeakHeight","axis2D","peakCoordinates","convertWidthToFWHM","widthData","Spectrum2DGenerator","calculeIntervals","shapeGenerator","z","xPosition","yPosition","xIndex","yIndex","minMaxZ","minZ","maxZ","SparseSpectrumGenerator","generateSparseSpectrum","resolvedPeaks","xFrom","computeHalfWidth","xTo","mergedIntervals","lastWrittenIndex","firstIndex","lastIndex","guardBefore","guardAfter","unshift","mid","rest","generatorOptions","addPeaksOptions","joinX_1","joinX","self","sortX","entryA","entryB","composition","multiply","maxLines","sortY","calculateComposition","topY","move","power_1","square","Distribution_1","Distribution","closestPointX_js_1","joinX_js_1","multiply_js_1","power_js_1","getEmptyCache","emptyCache","multiplyY","setArray","other","ySorted","xSorted","relativeValue","distCopy","maxToOne","append","closestPointX","getDerivedCompositionInfo","shortComposition","label","shortLabel","isotopeLabel","IsotopicDistribution_1","IsotopicDistribution","mf_utilities_1","ml_spectra_processing_1","spectrum_generator_1","getDerivedCompositionInfo_1","MINIMAL_FWHM","confidence","partOriginal","msInfo","getMsInfo","cachedDistribution","allowNeutral","partNaturalDeltaNeutrons","newDistribution","totalDistribution","absoluteCharge","isotopicDistribution","finalDistribution","sumBefore","getCSV","getText","delimiter","xLabel","yLabel","numberXDecimals","numberYDecimals","csv","toFixed","getMaxY","getPeaks","getSumY","getXY","unsaturationMatcher_1","unsaturationMatcher","onlyInteger","onlyNonInteger","minMW","maxMW","minEM","maxEM","unsaturationMatcher_js_1","precision","targetMasses","targetIntensities","minMSEM","maxMSEM","allowNegativeAtoms","callback","ionizationAtoms","atomKeys","lib","arguments","toSum","uniqueMFs","estimate","onStep","filterFctVariables","variables","filterFct","canonizeMF","sizes","evolution","appendResult","uniqueMFsObject","ems","getMonoisotopicMass","getEMFromParts","sum_object_keys_1","default","links","sharps","anchors","apply","zeroInsteadOfNegative","X","get","checkMatrixS","originalMatrix","S","indices","residual","zeros","res2","sqrtMaxValue","mmul","subtracting","sub","fastExtractNMF","clone","subM","normBy","by","norms","mul","from1DArray","updateMatrixA","Ainit","proximal","maxFBIteration","toleranceFB","normConstrained","St","YSt","evd","assumeSymmetric","L","realEigenvalues","prevA","gradient","normLimits","normProj","subS","tNext","divS","updateMatrixS","Sinit","At","AtY","getMax","prevS","R","normOnA","onS","onA","DS","DA","sColumns","aRows","valueForS","valueForA","f","h","_ref","module","getMedians","medians","updateLambda","sigmaResidue","refinementBeginning","tauMAD","lambdaInf","addStd","alY","to1DArray","subColumnVector","dimMADstd","nGMCA","rank","maximumIteration","maxInitFBIteration","toleranceFBInit","phaseRatio","randGenerator","useTranspose","checkMatrix","rand","iter","sumC","sumR","positiveSumRowIndexS","positiveSumRowS","candidateA","colCandidate","initialize","PCA","dataset","model","U","means","stdevs","excludedFeatures","datasetMatrix","isCovarianceMatrix","method","nCompNIPALS","ignoreZeroVariance","_computeFromCovarianceMatrix","_adjust","covarianceMatrix","_computeWithNIPALS","svd","computeLeftSingularVectors","computeRightSingularVectors","autoTranspose","rightSingularVectors","singularValues","diagonal","eigenvalues","singularValue","load","predict","nComponents","datasetmatrix","subRowVector","removeColumn","divRowVector","predictions","invert","mulRowVector","addRowVector","getExplainedVariance","getCumulativeVariance","explained","getEigenvectors","getEigenvalues","getStandardDeviations","getLoadings","eigenvectorMatrix","flipRows","dc","xResidual","deconvolution","chromatogram","nmfOptions","mzAxis","times","getMzVsTimesMatrix","cumulative","estimateNbPureComponents","maxByRow","maxRow","profile","component","merge","mergeThreshold","seriesName","time","getTimes","requiresSeries","datum","updateSystem","newVector","airPLS","xWork","yWork","optionsWork","shouldDownsample","autoDownsample","maxResolution","originalLength","targetResolution","downsampledControlPoints","Int8Array","getDownSampleData","indexFrom","indexTo","getControlPoints","sumNegDifferences","corrected","stopCriterion","getStopCriterion","lowerTriangularNonZeros","getDeltaMatrix","prevNegSum","applyCorrection","absChange","finalBaseline","finalCorrected","sgg","derivative","polynomial","console","warn","np","ans","fullWeights","hs","constantH","wg1","wg2","d1","d2","getHs","wg","gramPoly","Grampoly","genFact","gf","getMinMaxIntervalsDy","dY","dX","lastMax","lastMin","intervalL","intervalR","tryMatchOneIntervalWithMinData","lastK","minData","yThreshold","intervalWidth","intervalCenter","minDistance","possible","newLastIndex","currentDistance","getPeakFromIntervals","ddY","id","crypto","randomUUID","inflectionPoints","isLessAndGreaterThanZero","back","firstDerivative","crossDy","xGetCrossZeroPoints","gsd","noiseLevel","sgOptions","smoothY","maxCriteria","minMaxRatio","realTopDetection","peakDetectionAlgorithm","isEquallySpaced","noiseInfo","xValue","peakData","minddY","secondDerivative","lastJ","autoAlgorithm","xCurrent","xPrevious","optimizeTop","heightFilter","broadenPeaksOptions","overlap","getSeries","dataXY","peakList","noiseHeight","airpls","broadenPeaksList","mapPeaks","nextPeak","shapeFct","broadenPeaks","retentionTime","integrateRange","integration","correction","deltaTime","fromHeight","toHeight","baselineCorrection","Chromatogram","addSeries","getSeries1D","getSeries2D","getSeriesNames","hasMass","hasSeries","deleteSeries","force","firstTime","lastTime","setTimes","rescaleTime","conversionFunction","newTimes","indexToKeep","calculateTic","tic","massSpectra","massSpectrum","calculateLength","calculateBpc","bpc","calculateEic","halfWidth","calculateForMF","targetMF","generateMFs","masses","getParts","integrate","getClosestTime","getClosestData","closest","rt","fromJSON","meanFilter","newSeriesName","newSeries","percentageFilter","applyLockMass","oddReference","maxShift","referenceMass","observedMonoisotopicMass","referenceIndexShift","msIndexShift","newSize","referencesCount","previousValidDifference","usingPreviousValidDifference","massIndex","referenceIndex","closestIndex","referenceUsed","total","totalFound","json","appendMass","massFilter","massXYObject","thresholdFactor","maxNumberPeaks","massList","filteredList","outRange","moreDistinct","vectorify","massPower","intPower","vector","filterOptions","cosineSimilarity","ms1x","ms1y","ms2x","ms2y","index1","index2","product","norm1","norm2","w1","w2","norm1Norm2","preprocessing","integratedMs","defaultOptions","similarityThreshold","checkArrayLength","BaseRegression","_predict","xVal","train","toLaTeX","score","ySum","chi2","rmsd","xSquared","ySquared","xY","r2","maybeToPrecision","figures","toPrecision","PolynomialRegression","powers","coefficients","interceptAtZero","nCoefficients","FT","regress","_toFormula","isLaTeX","sup","closeSup","fn","str","coefficient","kovats","intensities","nbAlcaneMasses","fragmentMasses","biggestMass","numberFragments","percentFragments","haystack","needle","comparator","cmp","ascValue","ascTime","ensureString","blob","encoding","TextDecoder","decode","uint8","buffer","byteOffset","byteLength","fatal","decodeText","parseString","lowercase","toLowerCase","getGyromagneticRatio","nucleus","realNucleus","gyromagneticRatio","nucleusNumber","filteredNuclei","getGyromagneticNucleus","fromEntries","quickSelectMedian","$","E","exec","o","replace","trim","te","ne","spectra","pageValue","V","logger","xFactor","yFactor","isXYdata","firstX","firstY","codePointAt","trace","M","oe","isPeaktable","ue","ce","isXYAdata","parseFloat","se","Z","lastY","ntuples","units","ie","pe","ae","G","noContour","contourLines","nbContourLevels","fe","noiseMultiplier","zValue","_","ee","T","segments","J","observeFrequency","shiftOffsetVal","xUnits","tmp","$NUC2","$NUC1","yType","xType","W","pageSymbol","dynamicTyping","le","de","twoD","wantXY","profiling","keepSpectra","vardim","varname","yUnits","he","removeComments","keepRecordsRegExp","canonicDataLabels","canonicMetadataLabels","withoutXY","noTrimRegExp","parseXY","rescale","uniqueX","bestGuess","keepInfo","xColumn","yColumn","numberColumns","maxNumberColumns","minNumberColumns","fields","skipFirstColumn","currentFirst","nextFirst","yValues","bytes","encoder","TextEncoder","hostBigEndian","typedArrays","int8","globalThis","int16","Int16Array","uint16","Uint16Array","int32","uint32","uint64","BigUint64Array","int64","BigInt64Array","float32","Float32Array","float64","IOBuffer","offset","lastWrittenByte","littleEndian","_mark","_marks","dataIsGiven","dvOffset","DataView","available","isLittleEndian","setLittleEndian","isBigEndian","setBigEndian","skip","seek","mark","pushMark","popMark","rewind","ensureAvailable","newLength","readBoolean","readUint8","readInt8","getInt8","getUint8","readByte","readBytes","readArray","type","BYTES_PER_ELEMENT","readInt16","getInt16","readUint16","getUint16","readInt32","getInt32","readUint32","readFloat32","getFloat32","readFloat64","getFloat64","readBigInt64","getBigInt64","readBigUint64","getBigUint64","readChar","readChars","readUtf8","writeBoolean","writeUint8","writeInt8","setInt8","_updateLastWrittenByte","setUint8","writeByte","writeBytes","writeInt16","setInt16","writeUint16","setUint16","writeInt32","setInt32","writeUint32","setUint32","writeFloat32","setFloat32","writeFloat64","setFloat64","writeBigInt64","setBigInt64","writeBigUint64","setBigUint64","writeChar","writeChars","writeUtf8","encode","toArray","getWrittenByteLength","types","num2str","num2bytes","str2num","readNumber","bufferReader","numbers","readType","trimNull","notNetcdf","statement","reason","readName","nameLength","header","version","recordDimension","dimList","recordId","recordName","dimensions","dimensionSize","dim","dimensionsList","globalAttributes","attributesList","varList","recordStep","variableSize","dimensionality","dimensionsIds","attributes","varSize","record","variablesList","gAttList","attributeSize","gAtt","padEnd","attribute","variable","getDataVariable","NetCDFReader","getAttribute","attributeName","getDataVariableAsString","variableName","currentOffset","nonRecord","dataVariableExists","attributeExists","netcdfGcms","reader","instrumentMfr","datasetOrigin","massValues","detectorName","aiaTemplateRevision","sourceFileFormat","pointCount","intensityValues","agilentGCMS","scanIndex","finniganGCMS","brukerGCMS","shimadzuGCMS","advionGCMS","numberPoints","detector","channel","delayTime","runtimeLength","samplingInterval","agilentHPLC","aiaTemplate","addMeta","addVariables","utf8Decoder","decoder","trimValues","attributesNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseAttributesString","textNodeName","arrayMode","cdataTagName","tagNameProcessor","attributeNameProcessor","tagValueProcessor","attributeValueProcessor","stopNodes","XMLNode","tagName","children","startIndex","cachedValue","toAppend","arrayConcat","addChild","child","arrayIndexOf","referenceArray","found","foundIndex","arrayTrim","closingIndexForOpeningTag","attrBoundary","endIndex","byte","findClosingIndex","xmlData","errMsg","closingIndex","isEmptySimpleObject","isTagNameInArrayMode","parentTagName","RegExp","newLocal","raw","attrsRegx","matches","regex","matchAll","getAllMatches","resolveNameSpace","tags","prefix","removeNameSpaceIfNeeded","colonIndex","traversableToJSON","node","isEmptyObject","asArray","renamedAttributes","newAttributeName","nodes","newTagName","firstNode","subResult","realOptions","traversable","currentNode","dataSize","dataIndex","xmlData1","xmlData2","closeIndex","tagExp","childNode","parsedOpeningTag","tagData","separatorIndex","shouldBuildAttributesMap","tagAttributes","getTraversable","base64codes","base64codes1","base64codes2","decodeData","endian","float","compression","base64","ontologies","missingOctets","zlibCompressedData","ReadableStream","controller","enqueue","pipeThrough","DecompressionStream","getReader","chunks","done","read","decompressedData","chunk","inflate","parseCvParam","cvParam","cvParams","param","accession","cvLabel","parseMzData","arrayBuffer","metadata","promise","catch","description","dataProcessing","software","instrument","analyzerList","analyzer","analyzertype","detectortype","processMetadata","mzData","msData","spectrumList","spectrumDesc","spectrumSettings","spectrumInstrument","timeinminutes","mzArray","mzArrayBinary","intenArrayBinary","processSpectrumList","parameter","parseMzML","mzmlBuffer","rawData","rawDataUint8Array","referenceableParamGroups","referenceableParamGroup","ref","referenceableParamGroupRefs","referenceableParamGroupRef","cv","parseInt","encodedLength","run","binaryDataArrayList","scanList","scan","dataArrayList","binaryDataArray","firstCVParams","second","secondCVParams","binary","mzML","indexedmzML","parseMzXML","byteOrder","compressionType","msRun","dataArray","mzXML","jcamp","ge","debug","datatable","title","dataType","dataClass","jcampDX","jcampCS","shiftOffsetNum","vartype","varform","page","sampleDescription","be","converter","netcdf","xml","parseMZ","revert","kovatsConversionTable","indexes","binarySearch","smallerAlcane","largerAlcane","reference","sample","computeQuality","polynomialDegree","referenceTime","sampleTime","regression","scaleRegression","chrom1","chrom2","similarityPeaks","similarLen","biggerCounter","sim","duplicates","peaksChrom1","peaksChrom2","peaksSimilarity","peaksFirst","peaksSecond"],"mappings":";qPACA,MAAMA,EAAWC,OAAOC,UAAUF,SAmB5B,SAAUG,EAAWC,GACzB,MAAMC,EAAML,EAASM,KAAKF,GAC1B,OAAOC,EAAIE,SAAS,YAAcF,EAAIG,SAAS,MACjD,CCZM,SAAUC,EACdC,EACAC,EAAoC,IAEpC,MAAMC,EAASF,EAAKG,GAAGD,QACjBE,OAAEA,EAAS,IAAIC,aAAaH,IAAYD,EACxCE,EAAKH,EAAKG,GACVG,EAAKN,EAAKM,GAChB,IAAK,IAAIC,EAAI,EAAGA,EAAIL,EAAQK,IAC1BH,EAAO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,EAAc,GACdC,EAAc,GACdC,EAAkB,GACtB,IAAK,IAAIttE,KAAOmtE,EACiB,IAA3BA,EAAWntE,GAAKhS,SAClBo/E,EAAYt4E,KAAKi4E,EAAgBF,OAAOM,EAAWntE,GAAK,KACxDqtE,EAAYv4E,KAAKi4E,EAAgBD,OAAOK,EAAWntE,GAAK,KACxDstE,EAAgBx4E,KAAKi4E,EAAgBhoD,WAAWooD,EAAWntE,GAAK,MAIpE,MAAO,CACLutE,WAAYH,EACZI,YAAaH,EACbC,kBAEJ","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,212,213,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,312,313,314,315,316,317,318,319,320,321,322,323,325,343,344,345,346,348,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403]}