{"version":3,"file":"mzdata.esm.min.js","sources":["../node_modules/dynamic-typing/lib/parseString.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/ml-spectra-processing/lib/utils/recursiveResolve.js","../node_modules/uint8-base64/lib/decode.js","../node_modules/uint8-base64/lib/base64codes.js","../node_modules/uint8-base64/lib/encodeFast.js","../src/util/decodeData.js","../src/util/inflate.js","../src/mzdata/parseCvParam.js","../src/mzdata/parseMzData.js","../src/mzdata/processMetaData.js","../src/mzdata/processSpectrumList.js","../src/mzml/parseCvParam.js","../src/mzml/parseMzML.js","../src/mzml/processSpectrumList.js","../src/mzxml/parseMzXML.js","../src/mzxml/processSpectrumList.js","../src/index.js"],"sourcesContent":["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 { 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","/**\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 - object to resolve.\n * @returns the resolved object.\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","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 * Decode a base64-encoded byte sequence into the original bytes.\n * @param input - Uint8Array holding the base64 representation (one byte per\n *   ASCII character, length must be a multiple of 4, `=` padding allowed).\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.js\";\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 * Encode bytes to base64 using two precomputed 12-bit lookup tables to emit\n * 4 output bytes (one 32-bit word) per 3 input bytes. This is the default\n * `encode` exported from the package.\n * @param input - Uint8Array of raw bytes to encode.\n * @returns a Uint8Array containing the base64 representation (one byte per\n *   ASCII character, padded with `=` to a length that is a multiple of 4).\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)] <<\n                    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/utils';\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/utils';\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 } = options;\n  let { rawData } = options;\n\n  // need to allow Buffer, ArrayBuffer or TypedArray and convert to Uint8Array\n  mzmlBuffer = new Uint8Array(mzmlBuffer);\n  if (rawData) {\n    rawData = new Uint8Array(rawData);\n  }\n\n  const rawDataUint8Array = rawData && new Uint8Array(rawData);\n\n  const result = {\n    metadata: {},\n    times: [],\n    xPositions: [],\n    yPositions: [],\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);\n\n  return result;\n}\n","import { parseCvParam } from './parseCvParam.js';\n\nexport function processSpectrumList(parsed, result) {\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  const msData = result.series.ms.data;\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    result.times.push(cvParam['MS:1000016']?.value);\n    result.xPositions.push(cvParam['IMS:1000050']?.value);\n    result.yPositions.push(cvParam['IMS:1000051']?.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/utils';\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"],"names":["parseString","value","length","lowercase","toLowerCase","number","Number","includes","isNaN","utf8Decoder","TextDecoder","decoder","array","decode","defaultOptions","trimValues","attributesNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseAttributesString","textNodeName","arrayMode","cdataTagName","tagNameProcessor","name","attributeNameProcessor","tagValueProcessor","replaceAll","attributeValueProcessor","stopNodes","XMLNode","tagName","parent","children","attributes","bytes","startIndex","cachedValue","constructor","this","Object","create","append","toAppend","arrayConcat","Uint8Array","set","undefined","addChild","child","existing","Array","isArray","push","arrayIndexOf","referenceArray","index","found","foundIndex","i","j","arrayTrim","arg","subarray","closingIndexForOpeningTag","data","attrBoundary","endIndex","byte","Error","findClosingIndex","xmlData","str","errMsg","closingIndex","isEmptySimpleObject","object","key","isTagNameInArrayMode","parentTagName","RegExp","test","newLocal","String","raw","attrsRegx","string","options","matches","regex","from","matchAll","getAllMatches","match","attributeName","resolveNameSpace","trim","tags","split","prefix","startsWith","removeNameSpaceIfNeeded","colonIndex","indexOf","slice","traversableToJSON","node","result","isEmptyObject","asArray","renamedAttributes","newAttributeName","target","source","merge","nodes","newTagName","firstNode","subResult","parse","TextEncoder","encode","ArrayBuffer","isView","realOptions","traversable","currentNode","dataSize","dataIndex","xmlData1","xmlData2","closeIndex","tagExp","childNode","parsedOpeningTag","tagData","separatorIndex","shouldBuildAttributesMap","Math","max","replace","tagAttributes","endsWith","getTraversable","async","recursiveResolve","promises","appendPromises","Promise","all","then","base64codes","base64codes1","Uint32Array","base64codes2","decodeData","TypeError","endian","precision","float","compression","base64","ontologies","input","output","missingOctets","at","buffer","zlibCompressedData","reader","ReadableStream","start","controller","enqueue","close","pipeThrough","DecompressionStream","getReader","chunks","totalLength","done","read","decompressedData","offset","chunk","inflate","step","temp","Float32Array","byteOffset","byteLength","BYTES_PER_ELEMENT","Float64Array","Int32Array","BigInt64Array","parseCvParam","cvParam","cvParams","param","accession","cvLabel","parseMzData","arrayBuffer","logger","console","metadata","times","series","ms","parsed","promise","catch","error","description","dataProcessing","software","instrument","analyzerList","analyzer","analyzertype","detector","detectortype","processMetadata","mzData","msData","spectrumList","spectrum","info","spectrumDesc","spectrumSettings","spectrumInstrument","timeinminutes","mzArray","mzArrayBinary","intensity","intenArrayBinary","processSpectrumList","parameter","parseMzML","mzmlBuffer","rawData","rawDataUint8Array","xPositions","yPositions","referenceableParamGroups","referenceableParamGroup","group","id","ref","referenceableParamGroupRefs","referenceableParamGroupRef","map","forEach","assign","cv","parseInt","encodedLength","run","binaryDataArrayList","scanList","scan","dataArrayList","binaryDataArray","first","firstCVParams","second","secondCVParams","binary","mzML","indexedmzML","parseMzXML","byteOrder","compressionType","msRun","dataArray","peaks","parseFloat","retentionTime","mzXML","parseMZ","xml","header","substring"],"mappings":";AAAM,SAAUA,EAAYC,GAC1B,GAAqB,IAAjBA,EAAMC,QAAiC,IAAjBD,EAAMC,OAAc,CAC5C,MAAMC,EAAYF,EAAMG,cAExB,GAAkB,SAAdD,EAAsB,OAAO,EACjC,GAAkB,UAAdA,EAAuB,OAAO,CACpC,CACA,MAAME,EAASC,OAAOL,GACtB,OAAe,IAAXI,GAAiBJ,EAAMM,SAAS,KAG/BD,OAAOE,MAAMH,GACXJ,EAD2BI,EAFzBJ,CAIX,CCTA,MAAMQ,EAAc,IAAIC,YAEXC,EACFC,GACAH,EAAYI,OAAOD,GA+FjBE,EAAmC,CAC9CC,YAAY,EACZC,mBAAoB,GACpBC,kBAAkB,EAClBC,iBAAiB,EACjBC,wBAAwB,EACxBC,uBAAuB,EAEvBC,aAAc,QAEdC,WAAW,EACXC,cAAc,EACdC,iBAAmBC,GAAiBA,EACpCC,uBAAyBD,GAAiB,IAAIA,IAC9CE,kBAAoB1B,GAEXD,EADQW,EAAeV,GAAO2B,WAAW,KAAM,KAGxDC,wBAA0B5B,GAAkBD,EAAYC,GACxD6B,UAAW,ICrHP,MAAOC,EACJC,QACAC,OACAC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