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AAE,WAAW,EAAI,MAC1B,OAAO,EAED,KAAN,GACA,UAAU,EAAE,qCAAsC,EAAK,EAAI,EAAI,EACvE,CACA,UAAU,EAAE,mBAAoB,EAAK,EACzC","file":"/npm/smol-toml@1.9.0/dist/struct.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/smol-toml@1.9.0/dist/struct.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n *    list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n *    this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n *    may be used to endorse or promote products derived from this software without\n *    specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nimport { parseString } from './primitive.js';\nimport { extractValue } from './extract.js';\nimport { skipVoid } from './util.js';\nimport { TomlError } from './error.js';\n/** @internal */\nexport function parseKey(ctx, end = 0x3d /* = */) {\n    // States:\n    // 0: before first char\n    // 1: parsing bare key\n    // 2: after key component\n    let startPtr;\n    let state = 0;\n    let parsed = [];\n    let sliceStart;\n    let c = ctx.s.charCodeAt(startPtr = ctx.p);\n    do {\n        // End of key\n        if (c === end) {\n            if (!state)\n                TomlError.x('unexpected end of key', ctx);\n            if (state === 1)\n                parsed.push(ctx.s.slice(sliceStart, ctx.p));\n            return ctx.p++, parsed;\n        }\n        // Dotted key separator\n        else if (c === 0x2e /* . */) {\n            if (!state)\n                TomlError.x('illegal empty bare key', ctx);\n            if (state === 1)\n                parsed.push(ctx.s.slice(sliceStart, ctx.p));\n            state = 0;\n        }\n        // Quoted key\n        else if (!state && (c === 0x22 /* \" */ || c === 0x27 /* ' */)) {\n            if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2))\n                TomlError.x('illegal quoted key: multiline strings are not allowed', ctx);\n            parsed.push(parseString(ctx));\n            state = 2;\n            ctx.p--;\n        }\n        // Whitespace; no-op in state 0 and 2, end of bare key in state 1\n        else if (c === 0x20 || c === 0x9 /* \\t */) {\n            if (state === 1) {\n                parsed.push(ctx.s.slice(sliceStart, ctx.p));\n                state = 2;\n            }\n        }\n        // If state is post-key, no character is allowed; otherwise ensure it's a bare-key component\n        else if (state === 2 || (c < 0x30 && c !== 0x2d /* - */) || (c > 0x39 && c < 0x41) || (c > 0x5a && c < 0x61 && c !== 0x5f /* _ */) || c > 0x7a) {\n            TomlError.x('illegal character in key', ctx);\n        }\n        // Illegal character\n        else if (!state) {\n            state = 1;\n            sliceStart = ctx.p;\n        }\n    } while (c = ctx.s.charCodeAt(++ctx.p));\n    TomlError.x('incomplete key-value: cannot find end of key', ctx, startPtr);\n}\n/** @internal */\nexport function parseInlineTable(ctx) {\n    let startPtr = ctx.p++;\n    let res = Object.create(null);\n    let seen = new Set();\n    let c;\n    while (ctx.p < ctx.s.length) {\n        skipVoid(ctx);\n        if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {\n            ctx.p++;\n            return res;\n        }\n        let k;\n        let t = res;\n        let hasOwn = false;\n        let errPtr = ctx.p;\n        let key = parseKey(ctx);\n        for (let i = 0; i < key.length; i++) {\n            if (i)\n                t = hasOwn ? t[k] : (t[k] = Object.create(null));\n            k = key[i];\n            if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {\n                TomlError.x('trying to redefine an already defined value', ctx, errPtr);\n            }\n            let unsafe = k === '__proto__';\n            if (ctx.uk && (unsafe || k === 'constructor')) {\n                t = ctx.uk !== 1 && TomlError.x('document contains an unsafe property', ctx, errPtr);\n                break;\n            }\n            if (!hasOwn && unsafe) {\n                Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n            }\n        }\n        if (hasOwn) {\n            TomlError.x('trying to redefine an already defined value', ctx, errPtr);\n        }\n        skipVoid(ctx, true, true);\n        let value = extractValue(ctx, 0x7d /* } */);\n        if (t && typeof (t[k] = value) === 'object')\n            seen.add(value);\n        skipVoid(ctx);\n        if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {\n            return res;\n        }\n        if (c !== 0x2c /* , */)\n            TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);\n    }\n    TomlError.x('unfinished table', ctx, startPtr);\n}\n/** @internal */\nexport function parseArray(ctx) {\n    let startPtr = ctx.p++;\n    let res = [];\n    let c;\n    while (ctx.p < ctx.s.length) {\n        skipVoid(ctx);\n        if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {\n            ctx.p++;\n            return res;\n        }\n        res.push(extractValue(ctx, 0x5d /* ] */));\n        skipVoid(ctx);\n        if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {\n            return res;\n        }\n        if (c !== 0x2c /* , */)\n            TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);\n    }\n    TomlError.x('unfinished array', ctx, startPtr);\n}\n"]}