{"version":3,"file":"rollup.browser.js","sources":["../node_modules/sourcemap-codec/dist/sourcemap-codec.es.js","../node_modules/magic-string/dist/magic-string.es.mjs","../browser/path.ts","../src/utils/getOrCreate.ts","../src/ast/utils/PathTracker.ts","../src/ast/nodes/shared/Expression.ts","../src/ast/NodeInteractions.ts","../src/ast/variables/Variable.ts","../src/ast/variables/ExternalVariable.ts","../src/utils/blank.ts","../node_modules/locate-character/dist/locate-character.es.js","../src/utils/getCodeFrame.ts","../src/utils/printStringList.ts","../src/utils/relativeId.ts","../src/utils/error.ts","../src/utils/RESERVED_NAMES.ts","../src/utils/identifierHelpers.ts","../src/ExternalModule.ts","../node_modules/@rollup/pluginutils/dist/es/index.js","../src/ast/ExecutionContext.ts","../src/ast/values.ts","../node_modules/acorn-walk/dist/walk.mjs","../src/ast/nodes/NodeType.ts","../src/utils/sourceMappingURL.ts","../src/utils/pureComments.ts","../src/ast/keys.ts","../src/ast/nodes/shared/Node.ts","../src/ast/nodes/SpreadElement.ts","../src/ast/nodes/shared/MethodTypes.ts","../src/ast/nodes/shared/ObjectEntity.ts","../src/ast/nodes/shared/ObjectPrototype.ts","../src/ast/nodes/shared/ArrayPrototype.ts","../src/ast/variables/LocalVariable.ts","../src/utils/base64.ts","../src/utils/safeName.ts","../src/ast/scopes/Scope.ts","../src/ast/scopes/ChildScope.ts","../src/ast/scopes/ParameterScope.ts","../src/ast/scopes/ReturnValueScope.ts","../node_modules/is-reference/src/index.js","../src/ast/nodes/shared/knownGlobals.ts","../src/ast/variables/GlobalVariable.ts","../src/ast/nodes/Identifier.ts","../src/utils/treeshakeNode.ts","../src/utils/renderHelpers.ts","../src/ast/scopes/BlockScope.ts","../src/ast/nodes/ExpressionStatement.ts","../src/ast/nodes/BlockStatement.ts","../src/ast/nodes/RestElement.ts","../src/ast/nodes/shared/FunctionBase.ts","../src/ast/nodes/ArrowFunctionExpression.ts","../src/utils/systemJsRendering.ts","../src/ast/nodes/ObjectPattern.ts","../src/ast/variables/ArgumentsVariable.ts","../src/ast/variables/ThisVariable.ts","../src/ast/scopes/FunctionScope.ts","../src/ast/nodes/shared/FunctionNode.ts","../src/ast/nodes/BinaryExpression.ts","../src/utils/renderCallArguments.ts","../src/ast/nodes/Literal.ts","../src/ast/nodes/MemberExpression.ts","../src/ast/nodes/shared/CallExpressionBase.ts","../src/ast/scopes/CatchScope.ts","../src/ast/scopes/ClassBodyScope.ts","../src/ast/nodes/shared/MethodBase.ts","../src/ast/nodes/MethodDefinition.ts","../src/ast/nodes/shared/ObjectMember.ts","../src/ast/nodes/shared/ClassNode.ts","../src/ast/nodes/ClassDeclaration.ts","../src/ast/nodes/shared/MultiExpression.ts","../src/ast/nodes/ExportAllDeclaration.ts","../src/ast/nodes/FunctionDeclaration.ts","../src/ast/nodes/ExportDefaultDeclaration.ts","../src/ast/nodes/ExportNamedDeclaration.ts","../src/ast/scopes/TrackingScope.ts","../src/ast/nodes/IfStatement.ts","../src/ast/nodes/ImportDeclaration.ts","../src/utils/interopHelpers.ts","../src/ast/nodes/ImportExpression.ts","../src/ast/nodes/MetaProperty.ts","../src/ast/nodes/Program.ts","../src/ast/nodes/SwitchCase.ts","../src/ast/nodes/TemplateLiteral.ts","../src/ast/variables/UndefinedVariable.ts","../src/ast/variables/ExportDefaultVariable.ts","../src/ast/scopes/ModuleScope.ts","../src/ast/nodes/UnaryExpression.ts","../src/utils/reassignedExportsMember.ts","../src/ast/nodes/VariableDeclaration.ts","../src/ast/nodes/index.ts","../src/ast/nodes/ArrayExpression.ts","../src/ast/nodes/ArrayPattern.ts","../src/ast/nodes/AssignmentExpression.ts","../src/ast/nodes/AssignmentPattern.ts","../src/ast/nodes/AwaitExpression.ts","../src/ast/nodes/BreakStatement.ts","../src/ast/nodes/CallExpression.ts","../src/ast/nodes/CatchClause.ts","../src/ast/nodes/ChainExpression.ts","../src/ast/nodes/ClassBody.ts","../src/ast/nodes/ClassExpression.ts","../src/ast/nodes/ConditionalExpression.ts","../src/ast/nodes/ContinueStatement.ts","../src/ast/nodes/DoWhileStatement.ts","../src/ast/nodes/EmptyStatement.ts","../src/ast/nodes/ExportSpecifier.ts","../src/ast/nodes/ForInStatement.ts","../src/ast/nodes/ForOfStatement.ts","../src/ast/nodes/ForStatement.ts","../src/ast/nodes/FunctionExpression.ts","../src/ast/nodes/ImportDefaultSpecifier.ts","../src/ast/nodes/ImportNamespaceSpecifier.ts","../src/ast/nodes/ImportSpecifier.ts","../src/ast/nodes/LabeledStatement.ts","../src/ast/nodes/LogicalExpression.ts","../src/ast/nodes/NewExpression.ts","../src/ast/nodes/ObjectExpression.ts","../src/ast/nodes/PrivateIdentifier.ts","../src/ast/nodes/Property.ts","../src/ast/nodes/PropertyDefinition.ts","../src/ast/nodes/ReturnStatement.ts","../src/ast/nodes/SequenceExpression.ts","../src/ast/nodes/StaticBlock.ts","../src/ast/nodes/Super.ts","../src/ast/nodes/SwitchStatement.ts","../src/ast/nodes/TaggedTemplateExpression.ts","../src/ast/nodes/TemplateElement.ts","../src/ast/nodes/ThisExpression.ts","../src/ast/nodes/ThrowStatement.ts","../src/ast/nodes/TryStatement.ts","../src/ast/nodes/UnknownNode.ts","../src/ast/nodes/UpdateExpression.ts","../src/ast/nodes/VariableDeclarator.ts","../src/ast/nodes/WhileStatement.ts","../src/ast/nodes/YieldExpression.ts","../src/utils/variableNames.ts","../src/ast/variables/ExportShimVariable.ts","../src/ast/variables/NamespaceVariable.ts","../src/ast/variables/SyntheticNamedExportVariable.ts","../src/utils/buildPhase.ts","../src/utils/getId.ts","../browser/performance.ts","../browser/process.ts","../src/utils/timers.ts","../src/utils/traverseStaticDependencies.ts","../src/Module.ts","../src/utils/getOriginalLocation.ts","../src/finalisers/shared/removeJsExtension.ts","../src/finalisers/shared/getCompleteAmdId.ts","../src/finalisers/shared/getExportBlock.ts","../src/finalisers/shared/getInteropBlock.ts","../src/finalisers/shared/updateExtensionForRelativeAmdId.ts","../src/finalisers/shared/addJsExtension.ts","../src/finalisers/shared/warnOnBuiltins.ts","../src/finalisers/shared/sanitize.ts","../src/finalisers/shared/setupNamespace.ts","../src/finalisers/shared/trimEmptyImports.ts","../src/finalisers/system.ts","../src/finalisers/umd.ts","../src/finalisers/index.ts","../src/finalisers/amd.ts","../src/finalisers/cjs.ts","../src/finalisers/es.ts","../src/finalisers/iife.ts","../src/utils/collapseSourcemaps.ts","../node_modules/minimalistic-assert/index.js","../node_modules/inherits/inherits_browser.js","../node_modules/hash.js/lib/hash/utils.js","../node_modules/hash.js/lib/hash/common.js","../node_modules/hash.js/lib/hash/sha/common.js","../node_modules/hash.js/lib/hash/sha/256.js","../browser/crypto.ts","../src/utils/deconflictChunk.ts","../src/utils/escapeId.ts","../src/utils/getExportMode.ts","../src/utils/getIndentString.ts","../src/utils/getStaticDependencies.ts","../src/utils/decodedSourcemap.ts","../src/utils/outputBundle.ts","../src/utils/renderNamePattern.ts","../src/Chunk.ts","../src/utils/exportNames.ts","../src/utils/renderChunk.ts","../src/utils/addons.ts","../src/utils/chunkAssignment.ts","../src/utils/executionOrder.ts","../src/utils/generateCodeSnippets.ts","../src/Bundle.ts","../src/utils/commondir.ts","../node_modules/acorn/dist/acorn.mjs","../browser/error.ts","../browser/fs.ts","../browser/resolveId.ts","../src/utils/resolveIdViaPlugins.ts","../src/utils/pluginUtils.ts","../src/utils/PluginCache.ts","../src/utils/transform.ts","../src/ModuleLoader.ts","../src/ast/scopes/GlobalScope.ts","../src/utils/FileEmitter.ts","../src/utils/PluginContext.ts","../src/utils/PluginDriver.ts","../src/utils/Queue.ts","../src/Graph.ts","../src/utils/ensureArray.ts","../browser/hookActions.ts","../src/utils/options/options.ts","../src/utils/options/normalizeInputOptions.ts","../src/utils/sanitizeFileName.ts","../src/utils/options/normalizeOutputOptions.ts","../src/utils/url.ts","../src/rollup/rollup.ts"],"sourcesContent":["var charToInteger = {};\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nfor (var i = 0; i < chars.length; i++) {\n charToInteger[chars.charCodeAt(i)] = i;\n}\nfunction decode(mappings) {\n var decoded = [];\n var line = [];\n var segment = [\n 0,\n 0,\n 0,\n 0,\n 0,\n ];\n var j = 0;\n for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {\n var c = mappings.charCodeAt(i);\n if (c === 44) { // \",\"\n segmentify(line, segment, j);\n j = 0;\n }\n else if (c === 59) { // \";\"\n segmentify(line, segment, j);\n j = 0;\n decoded.push(line);\n line = [];\n segment[0] = 0;\n }\n else {\n var integer = charToInteger[c];\n if (integer === undefined) {\n throw new Error('Invalid character (' + String.fromCharCode(c) + ')');\n }\n var hasContinuationBit = integer & 32;\n integer &= 31;\n value += integer << shift;\n if (hasContinuationBit) {\n shift += 5;\n }\n else {\n var shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = value === 0 ? -0x80000000 : -value;\n }\n segment[j] += value;\n j++;\n value = shift = 0; // reset\n }\n }\n }\n segmentify(line, segment, j);\n decoded.push(line);\n return decoded;\n}\nfunction segmentify(line, segment, j) {\n // This looks ugly, but we're creating specialized arrays with a specific\n // length. This is much faster than creating a new array (which v8 expands to\n // a capacity of 17 after pushing the first item), or slicing out a subarray\n // (which is slow). Length 4 is assumed to be the most frequent, followed by\n // length 5 (since not everything will have an associated name), followed by\n // length 1 (it's probably rare for a source substring to not have an\n // associated segment data).\n if (j === 4)\n line.push([segment[0], segment[1], segment[2], segment[3]]);\n else if (j === 5)\n line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);\n else if (j === 1)\n line.push([segment[0]]);\n}\nfunction encode(decoded) {\n var sourceFileIndex = 0; // second field\n var sourceCodeLine = 0; // third field\n var sourceCodeColumn = 0; // fourth field\n var nameIndex = 0; // fifth field\n var mappings = '';\n for (var i = 0; i < decoded.length; i++) {\n var line = decoded[i];\n if (i > 0)\n mappings += ';';\n if (line.length === 0)\n continue;\n var generatedCodeColumn = 0; // first field\n var lineMappings = [];\n for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {\n var segment = line_1[_i];\n var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);\n generatedCodeColumn = segment[0];\n if (segment.length > 1) {\n segmentMappings +=\n encodeInteger(segment[1] - sourceFileIndex) +\n encodeInteger(segment[2] - sourceCodeLine) +\n encodeInteger(segment[3] - sourceCodeColumn);\n sourceFileIndex = segment[1];\n sourceCodeLine = segment[2];\n sourceCodeColumn = segment[3];\n }\n if (segment.length === 5) {\n segmentMappings += encodeInteger(segment[4] - nameIndex);\n nameIndex = segment[4];\n }\n lineMappings.push(segmentMappings);\n }\n mappings += lineMappings.join(',');\n }\n return mappings;\n}\nfunction encodeInteger(num) {\n var result = '';\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n var clamped = num & 31;\n num >>>= 5;\n if (num > 0) {\n clamped |= 32;\n }\n result += chars[clamped];\n } while (num > 0);\n return result;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.es.js.map\n","import { encode } from 'sourcemap-codec';\n\nclass BitSet {\n\tconstructor(arg) {\n\t\tthis.bits = arg instanceof BitSet ? arg.bits.slice() : [];\n\t}\n\n\tadd(n) {\n\t\tthis.bits[n >> 5] |= 1 << (n & 31);\n\t}\n\n\thas(n) {\n\t\treturn !!(this.bits[n >> 5] & (1 << (n & 31)));\n\t}\n}\n\nclass Chunk {\n\tconstructor(start, end, content) {\n\t\tthis.start = start;\n\t\tthis.end = end;\n\t\tthis.original = content;\n\n\t\tthis.intro = '';\n\t\tthis.outro = '';\n\n\t\tthis.content = content;\n\t\tthis.storeName = false;\n\t\tthis.edited = false;\n\n\t\t// we make these non-enumerable, for sanity while debugging\n\t\tObject.defineProperties(this, {\n\t\t\tprevious: { writable: true, value: null },\n\t\t\tnext: { writable: true, value: null },\n\t\t});\n\t}\n\n\tappendLeft(content) {\n\t\tthis.outro += content;\n\t}\n\n\tappendRight(content) {\n\t\tthis.intro = this.intro + content;\n\t}\n\n\tclone() {\n\t\tconst chunk = new Chunk(this.start, this.end, this.original);\n\n\t\tchunk.intro = this.intro;\n\t\tchunk.outro = this.outro;\n\t\tchunk.content = this.content;\n\t\tchunk.storeName = this.storeName;\n\t\tchunk.edited = this.edited;\n\n\t\treturn chunk;\n\t}\n\n\tcontains(index) {\n\t\treturn this.start < index && index < this.end;\n\t}\n\n\teachNext(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.next;\n\t\t}\n\t}\n\n\teachPrevious(fn) {\n\t\tlet chunk = this;\n\t\twhile (chunk) {\n\t\t\tfn(chunk);\n\t\t\tchunk = chunk.previous;\n\t\t}\n\t}\n\n\tedit(content, storeName, contentOnly) {\n\t\tthis.content = content;\n\t\tif (!contentOnly) {\n\t\t\tthis.intro = '';\n\t\t\tthis.outro = '';\n\t\t}\n\t\tthis.storeName = storeName;\n\n\t\tthis.edited = true;\n\n\t\treturn this;\n\t}\n\n\tprependLeft(content) {\n\t\tthis.outro = content + this.outro;\n\t}\n\n\tprependRight(content) {\n\t\tthis.intro = content + this.intro;\n\t}\n\n\tsplit(index) {\n\t\tconst sliceIndex = index - this.start;\n\n\t\tconst originalBefore = this.original.slice(0, sliceIndex);\n\t\tconst originalAfter = this.original.slice(sliceIndex);\n\n\t\tthis.original = originalBefore;\n\n\t\tconst newChunk = new Chunk(index, this.end, originalAfter);\n\t\tnewChunk.outro = this.outro;\n\t\tthis.outro = '';\n\n\t\tthis.end = index;\n\n\t\tif (this.edited) {\n\t\t\t// TODO is this block necessary?...\n\t\t\tnewChunk.edit('', false);\n\t\t\tthis.content = '';\n\t\t} else {\n\t\t\tthis.content = originalBefore;\n\t\t}\n\n\t\tnewChunk.next = this.next;\n\t\tif (newChunk.next) newChunk.next.previous = newChunk;\n\t\tnewChunk.previous = this;\n\t\tthis.next = newChunk;\n\n\t\treturn newChunk;\n\t}\n\n\ttoString() {\n\t\treturn this.intro + this.content + this.outro;\n\t}\n\n\ttrimEnd(rx) {\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.start + trimmed.length).edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\tif (this.intro.length) return true;\n\t\t}\n\t}\n\n\ttrimStart(rx) {\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tconst trimmed = this.content.replace(rx, '');\n\n\t\tif (trimmed.length) {\n\t\t\tif (trimmed !== this.content) {\n\t\t\t\tthis.split(this.end - trimmed.length);\n\t\t\t\tthis.edit('', undefined, true);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthis.edit('', undefined, true);\n\n\t\t\tthis.outro = this.outro.replace(rx, '');\n\t\t\tif (this.outro.length) return true;\n\t\t}\n\t}\n}\n\nlet btoa = () => {\n\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n};\nif (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n\tbtoa = (str) => window.btoa(unescape(encodeURIComponent(str)));\n} else if (typeof Buffer === 'function') {\n\tbtoa = (str) => Buffer.from(str, 'utf-8').toString('base64');\n}\n\nclass SourceMap {\n\tconstructor(properties) {\n\t\tthis.version = 3;\n\t\tthis.file = properties.file;\n\t\tthis.sources = properties.sources;\n\t\tthis.sourcesContent = properties.sourcesContent;\n\t\tthis.names = properties.names;\n\t\tthis.mappings = encode(properties.mappings);\n\t}\n\n\ttoString() {\n\t\treturn JSON.stringify(this);\n\t}\n\n\ttoUrl() {\n\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t}\n}\n\nfunction guessIndent(code) {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter((line) => /^\\t+/.test(line));\n\tconst spaced = lines.filter((line) => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)[0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n\nfunction getRelativePath(from, to) {\n\tconst fromParts = from.split(/[/\\\\]/);\n\tconst toParts = to.split(/[/\\\\]/);\n\n\tfromParts.pop(); // get dirname\n\n\twhile (fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\tif (fromParts.length) {\n\t\tlet i = fromParts.length;\n\t\twhile (i--) fromParts[i] = '..';\n\t}\n\n\treturn fromParts.concat(toParts).join('/');\n}\n\nconst toString = Object.prototype.toString;\n\nfunction isObject(thing) {\n\treturn toString.call(thing) === '[object Object]';\n}\n\nfunction getLocator(source) {\n\tconst originalLines = source.split('\\n');\n\tconst lineOffsets = [];\n\n\tfor (let i = 0, pos = 0; i < originalLines.length; i++) {\n\t\tlineOffsets.push(pos);\n\t\tpos += originalLines[i].length + 1;\n\t}\n\n\treturn function locate(index) {\n\t\tlet i = 0;\n\t\tlet j = lineOffsets.length;\n\t\twhile (i < j) {\n\t\t\tconst m = (i + j) >> 1;\n\t\t\tif (index < lineOffsets[m]) {\n\t\t\t\tj = m;\n\t\t\t} else {\n\t\t\t\ti = m + 1;\n\t\t\t}\n\t\t}\n\t\tconst line = i - 1;\n\t\tconst column = index - lineOffsets[line];\n\t\treturn { line, column };\n\t};\n}\n\nclass Mappings {\n\tconstructor(hires) {\n\t\tthis.hires = hires;\n\t\tthis.generatedCodeLine = 0;\n\t\tthis.generatedCodeColumn = 0;\n\t\tthis.raw = [];\n\t\tthis.rawSegments = this.raw[this.generatedCodeLine] = [];\n\t\tthis.pending = null;\n\t}\n\n\taddEdit(sourceIndex, content, loc, nameIndex) {\n\t\tif (content.length) {\n\t\t\tconst segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];\n\t\t\tif (nameIndex >= 0) {\n\t\t\t\tsegment.push(nameIndex);\n\t\t\t}\n\t\t\tthis.rawSegments.push(segment);\n\t\t} else if (this.pending) {\n\t\t\tthis.rawSegments.push(this.pending);\n\t\t}\n\n\t\tthis.advance(content);\n\t\tthis.pending = null;\n\t}\n\n\taddUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {\n\t\tlet originalCharIndex = chunk.start;\n\t\tlet first = true;\n\n\t\twhile (originalCharIndex < chunk.end) {\n\t\t\tif (this.hires || first || sourcemapLocations.has(originalCharIndex)) {\n\t\t\t\tthis.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);\n\t\t\t}\n\n\t\t\tif (original[originalCharIndex] === '\\n') {\n\t\t\t\tloc.line += 1;\n\t\t\t\tloc.column = 0;\n\t\t\t\tthis.generatedCodeLine += 1;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t\tthis.generatedCodeColumn = 0;\n\t\t\t\tfirst = true;\n\t\t\t} else {\n\t\t\t\tloc.column += 1;\n\t\t\t\tthis.generatedCodeColumn += 1;\n\t\t\t\tfirst = false;\n\t\t\t}\n\n\t\t\toriginalCharIndex += 1;\n\t\t}\n\n\t\tthis.pending = null;\n\t}\n\n\tadvance(str) {\n\t\tif (!str) return;\n\n\t\tconst lines = str.split('\\n');\n\n\t\tif (lines.length > 1) {\n\t\t\tfor (let i = 0; i < lines.length - 1; i++) {\n\t\t\t\tthis.generatedCodeLine++;\n\t\t\t\tthis.raw[this.generatedCodeLine] = this.rawSegments = [];\n\t\t\t}\n\t\t\tthis.generatedCodeColumn = 0;\n\t\t}\n\n\t\tthis.generatedCodeColumn += lines[lines.length - 1].length;\n\t}\n}\n\nconst n = '\\n';\n\nconst warned = {\n\tinsertLeft: false,\n\tinsertRight: false,\n\tstoreName: false,\n};\n\nclass MagicString {\n\tconstructor(string, options = {}) {\n\t\tconst chunk = new Chunk(0, string.length, string);\n\n\t\tObject.defineProperties(this, {\n\t\t\toriginal: { writable: true, value: string },\n\t\t\toutro: { writable: true, value: '' },\n\t\t\tintro: { writable: true, value: '' },\n\t\t\tfirstChunk: { writable: true, value: chunk },\n\t\t\tlastChunk: { writable: true, value: chunk },\n\t\t\tlastSearchedChunk: { writable: true, value: chunk },\n\t\t\tbyStart: { writable: true, value: {} },\n\t\t\tbyEnd: { writable: true, value: {} },\n\t\t\tfilename: { writable: true, value: options.filename },\n\t\t\tindentExclusionRanges: { writable: true, value: options.indentExclusionRanges },\n\t\t\tsourcemapLocations: { writable: true, value: new BitSet() },\n\t\t\tstoredNames: { writable: true, value: {} },\n\t\t\tindentStr: { writable: true, value: guessIndent(string) },\n\t\t});\n\n\t\tthis.byStart[0] = chunk;\n\t\tthis.byEnd[string.length] = chunk;\n\t}\n\n\taddSourcemapLocation(char) {\n\t\tthis.sourcemapLocations.add(char);\n\t}\n\n\tappend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.outro += content;\n\t\treturn this;\n\t}\n\n\tappendLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendLeft(content);\n\t\t} else {\n\t\t\tthis.intro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tappendRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.appendRight(content);\n\t\t} else {\n\t\t\tthis.outro += content;\n\t\t}\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst cloned = new MagicString(this.original, { filename: this.filename });\n\n\t\tlet originalChunk = this.firstChunk;\n\t\tlet clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());\n\n\t\twhile (originalChunk) {\n\t\t\tcloned.byStart[clonedChunk.start] = clonedChunk;\n\t\t\tcloned.byEnd[clonedChunk.end] = clonedChunk;\n\n\t\t\tconst nextOriginalChunk = originalChunk.next;\n\t\t\tconst nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();\n\n\t\t\tif (nextClonedChunk) {\n\t\t\t\tclonedChunk.next = nextClonedChunk;\n\t\t\t\tnextClonedChunk.previous = clonedChunk;\n\n\t\t\t\tclonedChunk = nextClonedChunk;\n\t\t\t}\n\n\t\t\toriginalChunk = nextOriginalChunk;\n\t\t}\n\n\t\tcloned.lastChunk = clonedChunk;\n\n\t\tif (this.indentExclusionRanges) {\n\t\t\tcloned.indentExclusionRanges = this.indentExclusionRanges.slice();\n\t\t}\n\n\t\tcloned.sourcemapLocations = new BitSet(this.sourcemapLocations);\n\n\t\tcloned.intro = this.intro;\n\t\tcloned.outro = this.outro;\n\n\t\treturn cloned;\n\t}\n\n\tgenerateDecodedMap(options) {\n\t\toptions = options || {};\n\n\t\tconst sourceIndex = 0;\n\t\tconst names = Object.keys(this.storedNames);\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tconst locate = getLocator(this.original);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.firstChunk.eachNext((chunk) => {\n\t\t\tconst loc = locate(chunk.start);\n\n\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tmappings.addEdit(\n\t\t\t\t\tsourceIndex,\n\t\t\t\t\tchunk.content,\n\t\t\t\t\tloc,\n\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tmappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);\n\t\t\t}\n\n\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : null,\n\t\t\tsources: [options.source ? getRelativePath(options.file || '', options.source) : null],\n\t\t\tsourcesContent: options.includeContent ? [this.original] : [null],\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\treturn this.indentStr === null ? '\\t' : this.indentStr;\n\t}\n\n\tindent(indentStr, options) {\n\t\tconst pattern = /^[^\\r\\n]/gm;\n\n\t\tif (isObject(indentStr)) {\n\t\t\toptions = indentStr;\n\t\t\tindentStr = undefined;\n\t\t}\n\n\t\tindentStr = indentStr !== undefined ? indentStr : this.indentStr || '\\t';\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\toptions = options || {};\n\n\t\t// Process exclusion ranges\n\t\tconst isExcluded = {};\n\n\t\tif (options.exclude) {\n\t\t\tconst exclusions =\n\t\t\t\ttypeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;\n\t\t\texclusions.forEach((exclusion) => {\n\t\t\t\tfor (let i = exclusion[0]; i < exclusion[1]; i += 1) {\n\t\t\t\t\tisExcluded[i] = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tlet shouldIndentNextCharacter = options.indentStart !== false;\n\t\tconst replacer = (match) => {\n\t\t\tif (shouldIndentNextCharacter) return `${indentStr}${match}`;\n\t\t\tshouldIndentNextCharacter = true;\n\t\t\treturn match;\n\t\t};\n\n\t\tthis.intro = this.intro.replace(pattern, replacer);\n\n\t\tlet charIndex = 0;\n\t\tlet chunk = this.firstChunk;\n\n\t\twhile (chunk) {\n\t\t\tconst end = chunk.end;\n\n\t\t\tif (chunk.edited) {\n\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\tchunk.content = chunk.content.replace(pattern, replacer);\n\n\t\t\t\t\tif (chunk.content.length) {\n\t\t\t\t\t\tshouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\\n';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcharIndex = chunk.start;\n\n\t\t\t\twhile (charIndex < end) {\n\t\t\t\t\tif (!isExcluded[charIndex]) {\n\t\t\t\t\t\tconst char = this.original[charIndex];\n\n\t\t\t\t\t\tif (char === '\\n') {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = true;\n\t\t\t\t\t\t} else if (char !== '\\r' && shouldIndentNextCharacter) {\n\t\t\t\t\t\t\tshouldIndentNextCharacter = false;\n\n\t\t\t\t\t\t\tif (charIndex === chunk.start) {\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis._splitChunk(chunk, charIndex);\n\t\t\t\t\t\t\t\tchunk = chunk.next;\n\t\t\t\t\t\t\t\tchunk.prependRight(indentStr);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcharIndex += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcharIndex = chunk.end;\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tthis.outro = this.outro.replace(pattern, replacer);\n\n\t\treturn this;\n\t}\n\n\tinsert() {\n\t\tthrow new Error(\n\t\t\t'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)'\n\t\t);\n\t}\n\n\tinsertLeft(index, content) {\n\t\tif (!warned.insertLeft) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertLeft = true;\n\t\t}\n\n\t\treturn this.appendLeft(index, content);\n\t}\n\n\tinsertRight(index, content) {\n\t\tif (!warned.insertRight) {\n\t\t\tconsole.warn(\n\t\t\t\t'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'\n\t\t\t); // eslint-disable-line no-console\n\t\t\twarned.insertRight = true;\n\t\t}\n\n\t\treturn this.prependRight(index, content);\n\t}\n\n\tmove(start, end, index) {\n\t\tif (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\t\tthis._split(index);\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tconst oldLeft = first.previous;\n\t\tconst oldRight = last.next;\n\n\t\tconst newRight = this.byStart[index];\n\t\tif (!newRight && last === this.lastChunk) return this;\n\t\tconst newLeft = newRight ? newRight.previous : this.lastChunk;\n\n\t\tif (oldLeft) oldLeft.next = oldRight;\n\t\tif (oldRight) oldRight.previous = oldLeft;\n\n\t\tif (newLeft) newLeft.next = first;\n\t\tif (newRight) newRight.previous = last;\n\n\t\tif (!first.previous) this.firstChunk = last.next;\n\t\tif (!last.next) {\n\t\t\tthis.lastChunk = first.previous;\n\t\t\tthis.lastChunk.next = null;\n\t\t}\n\n\t\tfirst.previous = newLeft;\n\t\tlast.next = newRight || null;\n\n\t\tif (!newLeft) this.firstChunk = first;\n\t\tif (!newRight) this.lastChunk = last;\n\t\treturn this;\n\t}\n\n\toverwrite(start, end, content, options) {\n\t\tif (typeof content !== 'string') throw new TypeError('replacement content must be a string');\n\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tif (end > this.original.length) throw new Error('end is out of bounds');\n\t\tif (start === end)\n\t\t\tthrow new Error(\n\t\t\t\t'Cannot overwrite a zero-length range – use appendLeft or prependRight instead'\n\t\t\t);\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tif (options === true) {\n\t\t\tif (!warned.storeName) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'\n\t\t\t\t); // eslint-disable-line no-console\n\t\t\t\twarned.storeName = true;\n\t\t\t}\n\n\t\t\toptions = { storeName: true };\n\t\t}\n\t\tconst storeName = options !== undefined ? options.storeName : false;\n\t\tconst contentOnly = options !== undefined ? options.contentOnly : false;\n\n\t\tif (storeName) {\n\t\t\tconst original = this.original.slice(start, end);\n\t\t\tObject.defineProperty(this.storedNames, original, {\n\t\t\t\twritable: true,\n\t\t\t\tvalue: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tconst first = this.byStart[start];\n\t\tconst last = this.byEnd[end];\n\n\t\tif (first) {\n\t\t\tlet chunk = first;\n\t\t\twhile (chunk !== last) {\n\t\t\t\tif (chunk.next !== this.byStart[chunk.end]) {\n\t\t\t\t\tthrow new Error('Cannot overwrite across a split point');\n\t\t\t\t}\n\t\t\t\tchunk = chunk.next;\n\t\t\t\tchunk.edit('', false);\n\t\t\t}\n\n\t\t\tfirst.edit(content, storeName, contentOnly);\n\t\t} else {\n\t\t\t// must be inserting at the end\n\t\t\tconst newChunk = new Chunk(start, end, '').edit(content, storeName);\n\n\t\t\t// TODO last chunk in the array may not be the last chunk, if it's moved...\n\t\t\tlast.next = newChunk;\n\t\t\tnewChunk.previous = last;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprepend(content) {\n\t\tif (typeof content !== 'string') throw new TypeError('outro content must be a string');\n\n\t\tthis.intro = content + this.intro;\n\t\treturn this;\n\t}\n\n\tprependLeft(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byEnd[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependLeft(content);\n\t\t} else {\n\t\t\tthis.intro = content + this.intro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprependRight(index, content) {\n\t\tif (typeof content !== 'string') throw new TypeError('inserted content must be a string');\n\n\t\tthis._split(index);\n\n\t\tconst chunk = this.byStart[index];\n\n\t\tif (chunk) {\n\t\t\tchunk.prependRight(content);\n\t\t} else {\n\t\t\tthis.outro = content + this.outro;\n\t\t}\n\t\treturn this;\n\t}\n\n\tremove(start, end) {\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tif (start === end) return this;\n\n\t\tif (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');\n\t\tif (start > end) throw new Error('end must be greater than start');\n\n\t\tthis._split(start);\n\t\tthis._split(end);\n\n\t\tlet chunk = this.byStart[start];\n\n\t\twhile (chunk) {\n\t\t\tchunk.intro = '';\n\t\t\tchunk.outro = '';\n\t\t\tchunk.edit('');\n\n\t\t\tchunk = end > chunk.end ? this.byStart[chunk.end] : null;\n\t\t}\n\t\treturn this;\n\t}\n\n\tlastChar() {\n\t\tif (this.outro.length) return this.outro[this.outro.length - 1];\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];\n\t\t\tif (chunk.content.length) return chunk.content[chunk.content.length - 1];\n\t\t\tif (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];\n\t\t} while ((chunk = chunk.previous));\n\t\tif (this.intro.length) return this.intro[this.intro.length - 1];\n\t\treturn '';\n\t}\n\n\tlastLine() {\n\t\tlet lineIndex = this.outro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.outro.substr(lineIndex + 1);\n\t\tlet lineStr = this.outro;\n\t\tlet chunk = this.lastChunk;\n\t\tdo {\n\t\t\tif (chunk.outro.length > 0) {\n\t\t\t\tlineIndex = chunk.outro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.outro + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.content.length > 0) {\n\t\t\t\tlineIndex = chunk.content.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.content + lineStr;\n\t\t\t}\n\n\t\t\tif (chunk.intro.length > 0) {\n\t\t\t\tlineIndex = chunk.intro.lastIndexOf(n);\n\t\t\t\tif (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;\n\t\t\t\tlineStr = chunk.intro + lineStr;\n\t\t\t}\n\t\t} while ((chunk = chunk.previous));\n\t\tlineIndex = this.intro.lastIndexOf(n);\n\t\tif (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;\n\t\treturn this.intro + lineStr;\n\t}\n\n\tslice(start = 0, end = this.original.length) {\n\t\twhile (start < 0) start += this.original.length;\n\t\twhile (end < 0) end += this.original.length;\n\n\t\tlet result = '';\n\n\t\t// find start chunk\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk && (chunk.start > start || chunk.end <= start)) {\n\t\t\t// found end chunk before start\n\t\t\tif (chunk.start < end && chunk.end >= end) {\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\tif (chunk && chunk.edited && chunk.start !== start)\n\t\t\tthrow new Error(`Cannot use replaced character ${start} as slice start anchor.`);\n\n\t\tconst startChunk = chunk;\n\t\twhile (chunk) {\n\t\t\tif (chunk.intro && (startChunk !== chunk || chunk.start === start)) {\n\t\t\t\tresult += chunk.intro;\n\t\t\t}\n\n\t\t\tconst containsEnd = chunk.start < end && chunk.end >= end;\n\t\t\tif (containsEnd && chunk.edited && chunk.end !== end)\n\t\t\t\tthrow new Error(`Cannot use replaced character ${end} as slice end anchor.`);\n\n\t\t\tconst sliceStart = startChunk === chunk ? start - chunk.start : 0;\n\t\t\tconst sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;\n\n\t\t\tresult += chunk.content.slice(sliceStart, sliceEnd);\n\n\t\t\tif (chunk.outro && (!containsEnd || chunk.end === end)) {\n\t\t\t\tresult += chunk.outro;\n\t\t\t}\n\n\t\t\tif (containsEnd) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// TODO deprecate this? not really very useful\n\tsnip(start, end) {\n\t\tconst clone = this.clone();\n\t\tclone.remove(0, start);\n\t\tclone.remove(end, clone.original.length);\n\n\t\treturn clone;\n\t}\n\n\t_split(index) {\n\t\tif (this.byStart[index] || this.byEnd[index]) return;\n\n\t\tlet chunk = this.lastSearchedChunk;\n\t\tconst searchForward = index > chunk.end;\n\n\t\twhile (chunk) {\n\t\t\tif (chunk.contains(index)) return this._splitChunk(chunk, index);\n\n\t\t\tchunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];\n\t\t}\n\t}\n\n\t_splitChunk(chunk, index) {\n\t\tif (chunk.edited && chunk.content.length) {\n\t\t\t// zero-length edited chunks are a special case (overlapping replacements)\n\t\t\tconst loc = getLocator(this.original)(index);\n\t\t\tthrow new Error(\n\t\t\t\t`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – \"${chunk.original}\")`\n\t\t\t);\n\t\t}\n\n\t\tconst newChunk = chunk.split(index);\n\n\t\tthis.byEnd[index] = chunk;\n\t\tthis.byStart[index] = newChunk;\n\t\tthis.byEnd[newChunk.end] = newChunk;\n\n\t\tif (chunk === this.lastChunk) this.lastChunk = newChunk;\n\n\t\tthis.lastSearchedChunk = chunk;\n\t\treturn true;\n\t}\n\n\ttoString() {\n\t\tlet str = this.intro;\n\n\t\tlet chunk = this.firstChunk;\n\t\twhile (chunk) {\n\t\t\tstr += chunk.toString();\n\t\t\tchunk = chunk.next;\n\t\t}\n\n\t\treturn str + this.outro;\n\t}\n\n\tisEmpty() {\n\t\tlet chunk = this.firstChunk;\n\t\tdo {\n\t\t\tif (\n\t\t\t\t(chunk.intro.length && chunk.intro.trim()) ||\n\t\t\t\t(chunk.content.length && chunk.content.trim()) ||\n\t\t\t\t(chunk.outro.length && chunk.outro.trim())\n\t\t\t)\n\t\t\t\treturn false;\n\t\t} while ((chunk = chunk.next));\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\tlet chunk = this.firstChunk;\n\t\tlet length = 0;\n\t\tdo {\n\t\t\tlength += chunk.intro.length + chunk.content.length + chunk.outro.length;\n\t\t} while ((chunk = chunk.next));\n\t\treturn length;\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimEndAborted(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tthis.outro = this.outro.replace(rx, '');\n\t\tif (this.outro.length) return true;\n\n\t\tlet chunk = this.lastChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimEnd(rx);\n\n\t\t\t// if chunk was trimmed, we have a new lastChunk\n\t\t\tif (chunk.end !== end) {\n\t\t\t\tif (this.lastChunk === chunk) {\n\t\t\t\t\tthis.lastChunk = chunk.next;\n\t\t\t\t}\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.previous;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimEnd(charType) {\n\t\tthis.trimEndAborted(charType);\n\t\treturn this;\n\t}\n\ttrimStartAborted(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\n\t\tthis.intro = this.intro.replace(rx, '');\n\t\tif (this.intro.length) return true;\n\n\t\tlet chunk = this.firstChunk;\n\n\t\tdo {\n\t\t\tconst end = chunk.end;\n\t\t\tconst aborted = chunk.trimStart(rx);\n\n\t\t\tif (chunk.end !== end) {\n\t\t\t\t// special case...\n\t\t\t\tif (chunk === this.lastChunk) this.lastChunk = chunk.next;\n\n\t\t\t\tthis.byEnd[chunk.end] = chunk;\n\t\t\t\tthis.byStart[chunk.next.start] = chunk.next;\n\t\t\t\tthis.byEnd[chunk.next.end] = chunk.next;\n\t\t\t}\n\n\t\t\tif (aborted) return true;\n\t\t\tchunk = chunk.next;\n\t\t} while (chunk);\n\n\t\treturn false;\n\t}\n\n\ttrimStart(charType) {\n\t\tthis.trimStartAborted(charType);\n\t\treturn this;\n\t}\n\n\thasChanged() {\n\t\treturn this.original !== this.toString();\n\t}\n\n\treplace(searchValue, replacement) {\n\t\tfunction getReplacement(match, str) {\n\t\t\tif (typeof replacement === 'string') {\n\t\t\t\treturn replacement.replace(/\\$(\\$|&|\\d+)/g, (_, i) => {\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter\n\t\t\t\t\tif (i === '$') return '$';\n\t\t\t\t\tif (i === '&') return match[0];\n\t\t\t\t\tconst num = +i;\n\t\t\t\t\tif (num < match.length) return match[+i];\n\t\t\t\t\treturn `$${i}`;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\treturn replacement(...match, match.index, str, match.groups);\n\t\t\t}\n\t\t}\n\t\tfunction matchAll(re, str) {\n\t\t\tlet match;\n\t\t\tconst matches = [];\n\t\t\twhile ((match = re.exec(str))) {\n\t\t\t\tmatches.push(match);\n\t\t\t}\n\t\t\treturn matches;\n\t\t}\n\t\tif (typeof searchValue !== 'string' && searchValue.global) {\n\t\t\tconst matches = matchAll(searchValue, this.original);\n\t\t\tmatches.forEach((match) => {\n\t\t\t\tif (match.index != null)\n\t\t\t\t\tthis.overwrite(\n\t\t\t\t\t\tmatch.index,\n\t\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\t\tgetReplacement(match, this.original)\n\t\t\t\t\t);\n\t\t\t});\n\t\t} else {\n\t\t\tconst match = this.original.match(searchValue);\n\t\t\tif (match && match.index != null)\n\t\t\t\tthis.overwrite(\n\t\t\t\t\tmatch.index,\n\t\t\t\t\tmatch.index + match[0].length,\n\t\t\t\t\tgetReplacement(match, this.original)\n\t\t\t\t);\n\t\t}\n\t\treturn this;\n\t}\n}\n\nconst hasOwnProp = Object.prototype.hasOwnProperty;\n\nclass Bundle {\n\tconstructor(options = {}) {\n\t\tthis.intro = options.intro || '';\n\t\tthis.separator = options.separator !== undefined ? options.separator : '\\n';\n\t\tthis.sources = [];\n\t\tthis.uniqueSources = [];\n\t\tthis.uniqueSourceIndexByFilename = {};\n\t}\n\n\taddSource(source) {\n\t\tif (source instanceof MagicString) {\n\t\t\treturn this.addSource({\n\t\t\t\tcontent: source,\n\t\t\t\tfilename: source.filename,\n\t\t\t\tseparator: this.separator,\n\t\t\t});\n\t\t}\n\n\t\tif (!isObject(source) || !source.content) {\n\t\t\tthrow new Error(\n\t\t\t\t'bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`'\n\t\t\t);\n\t\t}\n\n\t\t['filename', 'indentExclusionRanges', 'separator'].forEach((option) => {\n\t\t\tif (!hasOwnProp.call(source, option)) source[option] = source.content[option];\n\t\t});\n\n\t\tif (source.separator === undefined) {\n\t\t\t// TODO there's a bunch of this sort of thing, needs cleaning up\n\t\t\tsource.separator = this.separator;\n\t\t}\n\n\t\tif (source.filename) {\n\t\t\tif (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {\n\t\t\t\tthis.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;\n\t\t\t\tthis.uniqueSources.push({ filename: source.filename, content: source.content.original });\n\t\t\t} else {\n\t\t\t\tconst uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];\n\t\t\t\tif (source.content.original !== uniqueSource.content) {\n\t\t\t\t\tthrow new Error(`Illegal source: same filename (${source.filename}), different contents`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.sources.push(source);\n\t\treturn this;\n\t}\n\n\tappend(str, options) {\n\t\tthis.addSource({\n\t\t\tcontent: new MagicString(str),\n\t\t\tseparator: (options && options.separator) || '',\n\t\t});\n\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\tconst bundle = new Bundle({\n\t\t\tintro: this.intro,\n\t\t\tseparator: this.separator,\n\t\t});\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tbundle.addSource({\n\t\t\t\tfilename: source.filename,\n\t\t\t\tcontent: source.content.clone(),\n\t\t\t\tseparator: source.separator,\n\t\t\t});\n\t\t});\n\n\t\treturn bundle;\n\t}\n\n\tgenerateDecodedMap(options = {}) {\n\t\tconst names = [];\n\t\tthis.sources.forEach((source) => {\n\t\t\tObject.keys(source.content.storedNames).forEach((name) => {\n\t\t\t\tif (!~names.indexOf(name)) names.push(name);\n\t\t\t});\n\t\t});\n\n\t\tconst mappings = new Mappings(options.hires);\n\n\t\tif (this.intro) {\n\t\t\tmappings.advance(this.intro);\n\t\t}\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tif (i > 0) {\n\t\t\t\tmappings.advance(this.separator);\n\t\t\t}\n\n\t\t\tconst sourceIndex = source.filename ? this.uniqueSourceIndexByFilename[source.filename] : -1;\n\t\t\tconst magicString = source.content;\n\t\t\tconst locate = getLocator(magicString.original);\n\n\t\t\tif (magicString.intro) {\n\t\t\t\tmappings.advance(magicString.intro);\n\t\t\t}\n\n\t\t\tmagicString.firstChunk.eachNext((chunk) => {\n\t\t\t\tconst loc = locate(chunk.start);\n\n\t\t\t\tif (chunk.intro.length) mappings.advance(chunk.intro);\n\n\t\t\t\tif (source.filename) {\n\t\t\t\t\tif (chunk.edited) {\n\t\t\t\t\t\tmappings.addEdit(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk.content,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tchunk.storeName ? names.indexOf(chunk.original) : -1\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmappings.addUneditedChunk(\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\tchunk,\n\t\t\t\t\t\t\tmagicString.original,\n\t\t\t\t\t\t\tloc,\n\t\t\t\t\t\t\tmagicString.sourcemapLocations\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmappings.advance(chunk.content);\n\t\t\t\t}\n\n\t\t\t\tif (chunk.outro.length) mappings.advance(chunk.outro);\n\t\t\t});\n\n\t\t\tif (magicString.outro) {\n\t\t\t\tmappings.advance(magicString.outro);\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tfile: options.file ? options.file.split(/[/\\\\]/).pop() : null,\n\t\t\tsources: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.file ? getRelativePath(options.file, source.filename) : source.filename;\n\t\t\t}),\n\t\t\tsourcesContent: this.uniqueSources.map((source) => {\n\t\t\t\treturn options.includeContent ? source.content : null;\n\t\t\t}),\n\t\t\tnames,\n\t\t\tmappings: mappings.raw,\n\t\t};\n\t}\n\n\tgenerateMap(options) {\n\t\treturn new SourceMap(this.generateDecodedMap(options));\n\t}\n\n\tgetIndentString() {\n\t\tconst indentStringCounts = {};\n\n\t\tthis.sources.forEach((source) => {\n\t\t\tconst indentStr = source.content.indentStr;\n\n\t\t\tif (indentStr === null) return;\n\n\t\t\tif (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;\n\t\t\tindentStringCounts[indentStr] += 1;\n\t\t});\n\n\t\treturn (\n\t\t\tObject.keys(indentStringCounts).sort((a, b) => {\n\t\t\t\treturn indentStringCounts[a] - indentStringCounts[b];\n\t\t\t})[0] || '\\t'\n\t\t);\n\t}\n\n\tindent(indentStr) {\n\t\tif (!arguments.length) {\n\t\t\tindentStr = this.getIndentString();\n\t\t}\n\n\t\tif (indentStr === '') return this; // noop\n\n\t\tlet trailingNewline = !this.intro || this.intro.slice(-1) === '\\n';\n\n\t\tthis.sources.forEach((source, i) => {\n\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\tconst indentStart = trailingNewline || (i > 0 && /\\r?\\n$/.test(separator));\n\n\t\t\tsource.content.indent(indentStr, {\n\t\t\t\texclude: source.indentExclusionRanges,\n\t\t\t\tindentStart, //: trailingNewline || /\\r?\\n$/.test( separator ) //true///\\r?\\n/.test( separator )\n\t\t\t});\n\n\t\t\ttrailingNewline = source.content.lastChar() === '\\n';\n\t\t});\n\n\t\tif (this.intro) {\n\t\t\tthis.intro =\n\t\t\t\tindentStr +\n\t\t\t\tthis.intro.replace(/^[^\\n]/gm, (match, index) => {\n\t\t\t\t\treturn index > 0 ? indentStr + match : match;\n\t\t\t\t});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tprepend(str) {\n\t\tthis.intro = str + this.intro;\n\t\treturn this;\n\t}\n\n\ttoString() {\n\t\tconst body = this.sources\n\t\t\t.map((source, i) => {\n\t\t\t\tconst separator = source.separator !== undefined ? source.separator : this.separator;\n\t\t\t\tconst str = (i > 0 ? separator : '') + source.content.toString();\n\n\t\t\t\treturn str;\n\t\t\t})\n\t\t\t.join('');\n\n\t\treturn this.intro + body;\n\t}\n\n\tisEmpty() {\n\t\tif (this.intro.length && this.intro.trim()) return false;\n\t\tif (this.sources.some((source) => !source.content.isEmpty())) return false;\n\t\treturn true;\n\t}\n\n\tlength() {\n\t\treturn this.sources.reduce(\n\t\t\t(length, source) => length + source.content.length(),\n\t\t\tthis.intro.length\n\t\t);\n\t}\n\n\ttrimLines() {\n\t\treturn this.trim('[\\\\r\\\\n]');\n\t}\n\n\ttrim(charType) {\n\t\treturn this.trimStart(charType).trimEnd(charType);\n\t}\n\n\ttrimStart(charType) {\n\t\tconst rx = new RegExp('^' + (charType || '\\\\s') + '+');\n\t\tthis.intro = this.intro.replace(rx, '');\n\n\t\tif (!this.intro) {\n\t\t\tlet source;\n\t\t\tlet i = 0;\n\n\t\t\tdo {\n\t\t\t\tsource = this.sources[i++];\n\t\t\t\tif (!source) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (!source.content.trimStartAborted(charType));\n\t\t}\n\n\t\treturn this;\n\t}\n\n\ttrimEnd(charType) {\n\t\tconst rx = new RegExp((charType || '\\\\s') + '+$');\n\n\t\tlet source;\n\t\tlet i = this.sources.length - 1;\n\n\t\tdo {\n\t\t\tsource = this.sources[i--];\n\t\t\tif (!source) {\n\t\t\t\tthis.intro = this.intro.replace(rx, '');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!source.content.trimEndAborted(charType));\n\n\t\treturn this;\n\t}\n}\n\nexport { Bundle, SourceMap, MagicString as default };\n//# sourceMappingURL=magic-string.es.mjs.map\n","const ABSOLUTE_PATH_REGEX = /^(?:\\/|(?:[A-Za-z]:)?[\\\\|/])/;\nconst RELATIVE_PATH_REGEX = /^\\.?\\.\\//;\nconst ALL_BACKSLASHES_REGEX = /\\\\/g;\nconst ANY_SLASH_REGEX = /[/\\\\]/;\nconst EXTNAME_REGEX = /\\.[^.]+$/;\n\nexport function isAbsolute(path: string): boolean {\n\treturn ABSOLUTE_PATH_REGEX.test(path);\n}\n\nexport function isRelative(path: string): boolean {\n\treturn RELATIVE_PATH_REGEX.test(path);\n}\n\nexport function normalize(path: string): string {\n\treturn path.replace(ALL_BACKSLASHES_REGEX, '/');\n}\n\nexport function basename(path: string): string {\n\treturn path.split(ANY_SLASH_REGEX).pop() || '';\n}\n\nexport function dirname(path: string): string {\n\tconst match = /[/\\\\][^/\\\\]*$/.exec(path);\n\tif (!match) return '.';\n\n\tconst dir = path.slice(0, -match[0].length);\n\n\t// If `dir` is the empty string, we're at root.\n\treturn dir ? dir : '/';\n}\n\nexport function extname(path: string): string {\n\tconst match = EXTNAME_REGEX.exec(basename(path)!);\n\treturn match ? match[0] : '';\n}\n\nexport function relative(from: string, to: string): string {\n\tconst fromParts = from.split(ANY_SLASH_REGEX).filter(Boolean);\n\tconst toParts = to.split(ANY_SLASH_REGEX).filter(Boolean);\n\n\tif (fromParts[0] === '.') fromParts.shift();\n\tif (toParts[0] === '.') toParts.shift();\n\n\twhile (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {\n\t\tfromParts.shift();\n\t\ttoParts.shift();\n\t}\n\n\twhile (toParts[0] === '..' && fromParts.length > 0) {\n\t\ttoParts.shift();\n\t\tfromParts.pop();\n\t}\n\n\twhile (fromParts.pop()) {\n\t\ttoParts.unshift('..');\n\t}\n\n\treturn toParts.join('/');\n}\n\nexport function resolve(...paths: string[]): string {\n\tconst firstPathSegment = paths.shift();\n\tif (!firstPathSegment) {\n\t\treturn '/';\n\t}\n\tlet resolvedParts = firstPathSegment.split(ANY_SLASH_REGEX);\n\n\tfor (const path of paths) {\n\t\tif (isAbsolute(path)) {\n\t\t\tresolvedParts = path.split(ANY_SLASH_REGEX);\n\t\t} else {\n\t\t\tconst parts = path.split(ANY_SLASH_REGEX);\n\n\t\t\twhile (parts[0] === '.' || parts[0] === '..') {\n\t\t\t\tconst part = parts.shift();\n\t\t\t\tif (part === '..') {\n\t\t\t\t\tresolvedParts.pop();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresolvedParts.push(...parts);\n\t\t}\n\t}\n\n\treturn resolvedParts.join('/');\n}\n","export function getOrCreate(map: Map, key: K, init: () => V): V {\n\tconst existing = map.get(key);\n\tif (existing) {\n\t\treturn existing;\n\t}\n\tconst value = init();\n\tmap.set(key, value);\n\treturn value;\n}\n","import { getOrCreate } from '../../utils/getOrCreate';\nimport type { Entity } from '../Entity';\n\nexport const UnknownKey = Symbol('Unknown Key');\nexport const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key');\nexport const UnknownInteger = Symbol('Unknown Integer');\nexport type ObjectPathKey =\n\t| string\n\t| typeof UnknownKey\n\t| typeof UnknownNonAccessorKey\n\t| typeof UnknownInteger;\n\nexport type ObjectPath = ObjectPathKey[];\nexport const EMPTY_PATH: ObjectPath = [];\nexport const UNKNOWN_PATH: ObjectPath = [UnknownKey];\n// For deoptimizations, this means we are modifying an unknown property but did\n// not lose track of the object or are creating a setter/getter;\n// For assignment effects it means we do not check for setter/getter effects\n// but only if something is mutated that is included, which is relevant for\n// Object.defineProperty\nexport const UNKNOWN_NON_ACCESSOR_PATH: ObjectPath = [UnknownNonAccessorKey];\nexport const UNKNOWN_INTEGER_PATH: ObjectPath = [UnknownInteger];\n\nconst EntitiesKey = Symbol('Entities');\ninterface EntityPaths {\n\t[pathSegment: string]: EntityPaths;\n\t[EntitiesKey]: Set;\n\t[UnknownInteger]?: EntityPaths;\n\t[UnknownKey]?: EntityPaths;\n\t[UnknownNonAccessorKey]?: EntityPaths;\n}\n\nexport class PathTracker {\n\tprivate entityPaths: EntityPaths = Object.create(null, {\n\t\t[EntitiesKey]: { value: new Set() }\n\t});\n\n\ttrackEntityAtPathAndGetIfTracked(path: ObjectPath, entity: Entity): boolean {\n\t\tconst trackedEntities = this.getEntities(path);\n\t\tif (trackedEntities.has(entity)) return true;\n\t\ttrackedEntities.add(entity);\n\t\treturn false;\n\t}\n\n\twithTrackedEntityAtPath(\n\t\tpath: ObjectPath,\n\t\tentity: Entity,\n\t\tonUntracked: () => T,\n\t\treturnIfTracked: T\n\t): T {\n\t\tconst trackedEntities = this.getEntities(path);\n\t\tif (trackedEntities.has(entity)) return returnIfTracked;\n\t\ttrackedEntities.add(entity);\n\t\tconst result = onUntracked();\n\t\ttrackedEntities.delete(entity);\n\t\treturn result;\n\t}\n\n\tprivate getEntities(path: ObjectPath): Set {\n\t\tlet currentPaths = this.entityPaths;\n\t\tfor (const pathSegment of path) {\n\t\t\tcurrentPaths = currentPaths[pathSegment] =\n\t\t\t\tcurrentPaths[pathSegment] ||\n\t\t\t\tObject.create(null, { [EntitiesKey]: { value: new Set() } });\n\t\t}\n\t\treturn currentPaths[EntitiesKey];\n\t}\n}\n\nexport const SHARED_RECURSION_TRACKER = new PathTracker();\n\ninterface DiscriminatedEntityPaths {\n\t[pathSegment: string]: DiscriminatedEntityPaths;\n\t[EntitiesKey]: Map>;\n\t[UnknownInteger]?: DiscriminatedEntityPaths;\n\t[UnknownKey]?: DiscriminatedEntityPaths;\n\t[UnknownNonAccessorKey]?: DiscriminatedEntityPaths;\n}\n\nexport class DiscriminatedPathTracker {\n\tprivate entityPaths: DiscriminatedEntityPaths = Object.create(null, {\n\t\t[EntitiesKey]: { value: new Map>() }\n\t});\n\n\ttrackEntityAtPathAndGetIfTracked(\n\t\tpath: ObjectPath,\n\t\tdiscriminator: unknown,\n\t\tentity: Entity\n\t): boolean {\n\t\tlet currentPaths = this.entityPaths;\n\t\tfor (const pathSegment of path) {\n\t\t\tcurrentPaths = currentPaths[pathSegment] =\n\t\t\t\tcurrentPaths[pathSegment] ||\n\t\t\t\tObject.create(null, { [EntitiesKey]: { value: new Map>() } });\n\t\t}\n\t\tconst trackedEntities = getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set());\n\t\tif (trackedEntities.has(entity)) return true;\n\t\ttrackedEntities.add(entity);\n\t\treturn false;\n\t}\n}\n","import { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport { WritableEntity } from '../../Entity';\nimport { HasEffectsContext, InclusionContext } from '../../ExecutionContext';\nimport {\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { ObjectPath, PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport { LiteralValue } from '../Literal';\nimport SpreadElement from '../SpreadElement';\nimport { IncludeChildren } from './Node';\n\nexport const UnknownValue = Symbol('Unknown Value');\nexport const UnknownTruthyValue = Symbol('Unknown Truthy Value');\n\nexport type LiteralValueOrUnknown = LiteralValue | typeof UnknownValue | typeof UnknownTruthyValue;\n\nexport interface InclusionOptions {\n\t/**\n\t * Include the id of a declarator even if unused to ensure it is a valid statement.\n\t */\n\tasSingleStatement?: boolean;\n}\n\nexport class ExpressionEntity implements WritableEntity {\n\tincluded = false;\n\n\tdeoptimizePath(_path: ObjectPath): void {}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\t{ thisArg }: NodeInteractionWithThisArg,\n\t\t_path: ObjectPath,\n\t\t_recursionTracker: PathTracker\n\t): void {\n\t\tthisArg!.deoptimizePath(UNKNOWN_PATH);\n\t}\n\n\t/**\n\t * If possible it returns a stringifyable literal value for this node that can be used\n\t * for inlining or comparing values.\n\t * Otherwise it should return UnknownValue.\n\t */\n\tgetLiteralValueAtPath(\n\t\t_path: ObjectPath,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\t_path: ObjectPath,\n\t\t_interaction: NodeInteractionCalled,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\t_path: ObjectPath,\n\t\t_interaction: NodeInteraction,\n\t\t_context: HasEffectsContext\n\t): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(\n\t\t_context: InclusionContext,\n\t\t_includeChildrenRecursively: IncludeChildren,\n\t\t_options?: InclusionOptions\n\t): void {\n\t\tthis.included = true;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tfor (const arg of args) {\n\t\t\targ.include(context, false);\n\t\t}\n\t}\n\n\tshouldBeIncluded(_context: InclusionContext): boolean {\n\t\treturn true;\n\t}\n}\n\nexport const UNKNOWN_EXPRESSION: ExpressionEntity =\n\tnew (class UnknownExpression extends ExpressionEntity {})();\n","import SpreadElement from './nodes/SpreadElement';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './nodes/shared/Expression';\n\nexport const INTERACTION_ACCESSED = 0;\nexport const INTERACTION_ASSIGNED = 1;\nexport const INTERACTION_CALLED = 2;\n\nexport interface NodeInteractionAccessed {\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_ACCESSED;\n}\n\nexport const NODE_INTERACTION_UNKNOWN_ACCESS: NodeInteractionAccessed = {\n\tthisArg: null,\n\ttype: INTERACTION_ACCESSED\n};\n\nexport interface NodeInteractionAssigned {\n\targs: readonly [ExpressionEntity];\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_ASSIGNED;\n}\n\nexport const UNKNOWN_ARG = [UNKNOWN_EXPRESSION] as const;\n\nexport const NODE_INTERACTION_UNKNOWN_ASSIGNMENT: NodeInteractionAssigned = {\n\targs: UNKNOWN_ARG,\n\tthisArg: null,\n\ttype: INTERACTION_ASSIGNED\n};\n\nexport interface NodeInteractionCalled {\n\targs: readonly (ExpressionEntity | SpreadElement)[];\n\tthisArg: ExpressionEntity | null;\n\ttype: typeof INTERACTION_CALLED;\n\twithNew: boolean;\n}\n\nexport const NO_ARGS = [];\n\n// While this is technically a call without arguments, we can compare against\n// this reference in places where precise values or thisArg would make a\n// difference\nexport const NODE_INTERACTION_UNKNOWN_CALL: NodeInteractionCalled = {\n\targs: NO_ARGS,\n\tthisArg: null,\n\ttype: INTERACTION_CALLED,\n\twithNew: false\n};\n\nexport type NodeInteraction =\n\t| NodeInteractionAccessed\n\t| NodeInteractionAssigned\n\t| NodeInteractionCalled;\n\nexport type NodeInteractionWithThisArg = NodeInteraction & { thisArg: ExpressionEntity };\n","import type ExternalModule from '../../ExternalModule';\nimport type Module from '../../Module';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type Identifier from '../nodes/Identifier';\nimport { ExpressionEntity } from '../nodes/shared/Expression';\nimport type { ObjectPath } from '../utils/PathTracker';\n\nexport default class Variable extends ExpressionEntity {\n\talwaysRendered = false;\n\tinitReached = false;\n\tisId = false;\n\t// both NamespaceVariable and ExternalVariable can be namespaces\n\tdeclare isNamespace?: boolean;\n\tisReassigned = false;\n\tkind: string | null = null;\n\tdeclare module?: Module | ExternalModule;\n\trenderBaseName: string | null = null;\n\trenderName: string | null = null;\n\n\tconstructor(public name: string) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Binds identifiers that reference this variable to this variable.\n\t * Necessary to be able to change variable names.\n\t */\n\taddReference(_identifier: Identifier): void {}\n\n\tgetBaseVariableName(): string {\n\t\treturn this.renderBaseName || this.renderName || this.name;\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\tconst name = this.renderName || this.name;\n\t\treturn this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\t{ type }: NodeInteraction,\n\t\t_context: HasEffectsContext\n\t): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 0;\n\t}\n\n\t/**\n\t * Marks this variable as being part of the bundle, which is usually the case when one of\n\t * its identifiers becomes part of the bundle. Returns true if it has not been included\n\t * previously.\n\t * Once a variable is included, it should take care all its declarations are included.\n\t */\n\tinclude(): void {\n\t\tthis.included = true;\n\t}\n\n\tmarkCalledFromTryStatement(): void {}\n\n\tsetRenderNames(baseName: string | null, name: string | null): void {\n\t\tthis.renderBaseName = baseName;\n\t\tthis.renderName = name;\n\t}\n}\n","import type ExternalModule from '../../ExternalModule';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type Identifier from '../nodes/Identifier';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class ExternalVariable extends Variable {\n\tisNamespace: boolean;\n\tmodule: ExternalModule;\n\treferenced = false;\n\n\tconstructor(module: ExternalModule, name: string) {\n\t\tsuper(name);\n\t\tthis.module = module;\n\t\tthis.isNamespace = name === '*';\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tthis.referenced = true;\n\t\tif (this.name === 'default' || this.name === '*') {\n\t\t\tthis.module.suggestName(identifier.name);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > (this.isNamespace ? 1 : 0);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.module.used = true;\n\t\t}\n\t}\n}\n","export const BLANK: Record = Object.freeze(Object.create(null));\nexport const EMPTY_OBJECT = Object.freeze({});\nexport const EMPTY_ARRAY = Object.freeze([]);\n","function getLocator(source, options) {\n if (options === void 0) { options = {}; }\n var offsetLine = options.offsetLine || 0;\n var offsetColumn = options.offsetColumn || 0;\n var originalLines = source.split('\\n');\n var start = 0;\n var lineRanges = originalLines.map(function (line, i) {\n var end = start + line.length + 1;\n var range = { start: start, end: end, line: i };\n start = end;\n return range;\n });\n var i = 0;\n function rangeContains(range, index) {\n return range.start <= index && index < range.end;\n }\n function getLocation(range, index) {\n return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };\n }\n function locate(search, startIndex) {\n if (typeof search === 'string') {\n search = source.indexOf(search, startIndex || 0);\n }\n var range = lineRanges[i];\n var d = search >= range.end ? 1 : -1;\n while (range) {\n if (rangeContains(range, search))\n return getLocation(range, search);\n i += d;\n range = lineRanges[i];\n }\n }\n ;\n return locate;\n}\nfunction locate(source, search, options) {\n if (typeof options === 'number') {\n throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');\n }\n return getLocator(source, options)(search, options && options.startIndex);\n}\n\nexport { getLocator, locate };","function spaces(i: number): string {\n\tlet result = '';\n\twhile (i--) result += ' ';\n\treturn result;\n}\n\nfunction tabsToSpaces(str: string): string {\n\treturn str.replace(/^\\t+/, match => match.split('\\t').join(' '));\n}\n\nexport default function getCodeFrame(source: string, line: number, column: number): string {\n\tlet lines = source.split('\\n');\n\n\tconst frameStart = Math.max(0, line - 3);\n\tlet frameEnd = Math.min(line + 2, lines.length);\n\n\tlines = lines.slice(frameStart, frameEnd);\n\twhile (!/\\S/.test(lines[lines.length - 1])) {\n\t\tlines.pop();\n\t\tframeEnd -= 1;\n\t}\n\n\tconst digits = String(frameEnd).length;\n\n\treturn lines\n\t\t.map((str, i) => {\n\t\t\tconst isErrorLine = frameStart + i + 1 === line;\n\n\t\t\tlet lineNum = String(i + frameStart + 1);\n\t\t\twhile (lineNum.length < digits) lineNum = ` ${lineNum}`;\n\n\t\t\tif (isErrorLine) {\n\t\t\t\tconst indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^';\n\t\t\t\treturn `${lineNum}: ${tabsToSpaces(str)}\\n${indicator}`;\n\t\t\t}\n\n\t\t\treturn `${lineNum}: ${tabsToSpaces(str)}`;\n\t\t})\n\t\t.join('\\n');\n}\n","export function printQuotedStringList(\n\tlist: readonly string[],\n\tverbs?: readonly [string, string]\n): string {\n\tconst isSingleItem = list.length <= 1;\n\tconst quotedList = list.map(item => `\"${item}\"`);\n\tlet output = isSingleItem\n\t\t? quotedList[0]\n\t\t: `${quotedList.slice(0, -1).join(', ')} and ${quotedList.slice(-1)[0]}`;\n\tif (verbs) {\n\t\toutput += ` ${isSingleItem ? verbs[0] : verbs[1]}`;\n\t}\n\treturn output;\n}\n","import { relative } from '../../browser/path';\nimport { basename, dirname, extname, isAbsolute, normalize, resolve } from './path';\n\nexport function getAliasName(id: string): string {\n\tconst base = basename(id);\n\treturn base.substring(0, base.length - extname(id).length);\n}\n\nexport default function relativeId(id: string): string {\n\tif (!isAbsolute(id)) return id;\n\treturn relative(resolve(), id);\n}\n\nexport function isPathFragment(name: string): boolean {\n\t// starting with \"/\", \"./\", \"../\", \"C:/\"\n\treturn (\n\t\tname[0] === '/' || (name[0] === '.' && (name[1] === '/' || name[1] === '.')) || isAbsolute(name)\n\t);\n}\n\nconst UPPER_DIR_REGEX = /^(\\.\\.\\/)*\\.\\.$/;\n\nexport function getImportPath(\n\timporterId: string,\n\ttargetPath: string,\n\tstripJsExtension: boolean,\n\tensureFileName: boolean\n): string {\n\tlet relativePath = normalize(relative(dirname(importerId), targetPath));\n\tif (stripJsExtension && relativePath.endsWith('.js')) {\n\t\trelativePath = relativePath.slice(0, -3);\n\t}\n\tif (ensureFileName) {\n\t\tif (relativePath === '') return '../' + basename(targetPath);\n\t\tif (UPPER_DIR_REGEX.test(relativePath)) {\n\t\t\treturn relativePath\n\t\t\t\t.split('/')\n\t\t\t\t.concat(['..', basename(targetPath)])\n\t\t\t\t.join('/');\n\t\t}\n\t}\n\treturn !relativePath ? '.' : relativePath.startsWith('..') ? relativePath : './' + relativePath;\n}\n","import { locate } from 'locate-character';\nimport type Module from '../Module';\nimport type {\n\tNormalizedInputOptions,\n\tRollupError,\n\tRollupLogProps,\n\tRollupWarning,\n\tWarningHandler\n} from '../rollup/types';\nimport getCodeFrame from './getCodeFrame';\nimport { printQuotedStringList } from './printStringList';\nimport relativeId from './relativeId';\n\nexport function error(base: Error | RollupError): never {\n\tif (!(base instanceof Error)) base = Object.assign(new Error(base.message), base);\n\tthrow base;\n}\n\nexport function augmentCodeLocation(\n\tprops: RollupLogProps,\n\tpos: number | { column: number; line: number },\n\tsource: string,\n\tid: string\n): void {\n\tif (typeof pos === 'object') {\n\t\tconst { line, column } = pos;\n\t\tprops.loc = { column, file: id, line };\n\t} else {\n\t\tprops.pos = pos;\n\t\tconst { line, column } = locate(source, pos, { offsetLine: 1 });\n\t\tprops.loc = { column, file: id, line };\n\t}\n\n\tif (props.frame === undefined) {\n\t\tconst { line, column } = props.loc;\n\t\tprops.frame = getCodeFrame(source, line, column);\n\t}\n}\n\nexport const enum Errors {\n\tALREADY_CLOSED = 'ALREADY_CLOSED',\n\tASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED',\n\tASSET_NOT_FOUND = 'ASSET_NOT_FOUND',\n\tASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET',\n\tASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING',\n\tBAD_LOADER = 'BAD_LOADER',\n\tCANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK',\n\tCHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED',\n\tCHUNK_INVALID = 'CHUNK_INVALID',\n\tCIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT',\n\tCYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT',\n\tDEPRECATED_FEATURE = 'DEPRECATED_FEATURE',\n\tEXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS',\n\tFILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT',\n\tFILE_NOT_FOUND = 'FILE_NOT_FOUND',\n\tINPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN',\n\tINVALID_CHUNK = 'INVALID_CHUNK',\n\tINVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION',\n\tINVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID',\n\tINVALID_OPTION = 'INVALID_OPTION',\n\tINVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK',\n\tINVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE',\n\tMISSING_EXPORT = 'MISSING_EXPORT',\n\tMISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT',\n\tMIXED_EXPORTS = 'MIXED_EXPORTS',\n\tNAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT',\n\tAMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES',\n\tNO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE',\n\tPLUGIN_ERROR = 'PLUGIN_ERROR',\n\tPREFER_NAMED_EXPORTS = 'PREFER_NAMED_EXPORTS',\n\tSYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT',\n\tUNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT',\n\tUNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY',\n\tUNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT',\n\tVALIDATION_ERROR = 'VALIDATION_ERROR'\n}\n\nexport function errAssetNotFinalisedForFileName(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_NOT_FINALISED,\n\t\tmessage: `Plugin error - Unable to get file name for asset \"${name}\". Ensure that the source is set and that generate is called first.`\n\t};\n}\n\nexport function errCannotEmitFromOptionsHook(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK,\n\t\tmessage: `Cannot emit files or set asset sources in the \"outputOptions\" hook, use the \"renderStart\" hook instead.`\n\t};\n}\n\nexport function errChunkNotGeneratedForFileName(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CHUNK_NOT_GENERATED,\n\t\tmessage: `Plugin error - Unable to get file name for chunk \"${name}\". Ensure that generate is called first.`\n\t};\n}\n\nexport function errChunkInvalid(\n\t{ fileName, code }: { code: string; fileName: string },\n\texception: { loc: { column: number; line: number }; message: string }\n): RollupLogProps {\n\tconst errorProps = {\n\t\tcode: Errors.CHUNK_INVALID,\n\t\tmessage: `Chunk \"${fileName}\" is not valid JavaScript: ${exception.message}.`\n\t};\n\taugmentCodeLocation(errorProps, exception.loc, code, fileName);\n\treturn errorProps;\n}\n\nexport function errCircularReexport(exportName: string, importedModule: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.CIRCULAR_REEXPORT,\n\t\tid: importedModule,\n\t\tmessage: `\"${exportName}\" cannot be exported from ${relativeId(\n\t\t\timportedModule\n\t\t)} as it is a reexport that references itself.`\n\t};\n}\n\nexport function errCyclicCrossChunkReexport(\n\texportName: string,\n\texporter: string,\n\treexporter: string,\n\timporter: string\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,\n\t\texporter,\n\t\timporter,\n\t\tmessage: `Export \"${exportName}\" of module ${relativeId(\n\t\t\texporter\n\t\t)} was reexported through module ${relativeId(\n\t\t\treexporter\n\t\t)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\\nEither change the import in ${relativeId(\n\t\t\timporter\n\t\t)} to point directly to the exporting module or do not use \"preserveModules\" to ensure these modules end up in the same chunk.`,\n\t\treexporter\n\t};\n}\n\nexport function errAssetReferenceIdNotFoundForSetSource(assetReferenceId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_NOT_FOUND,\n\t\tmessage: `Plugin error - Unable to set the source for unknown asset \"${assetReferenceId}\".`\n\t};\n}\n\nexport function errAssetSourceAlreadySet(name: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_SOURCE_ALREADY_SET,\n\t\tmessage: `Unable to set the source for asset \"${name}\", source already set.`\n\t};\n}\n\nexport function errNoAssetSourceSet(assetName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ASSET_SOURCE_MISSING,\n\t\tmessage: `Plugin error creating asset \"${assetName}\" - no asset source set.`\n\t};\n}\n\nexport function errBadLoader(id: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.BAD_LOADER,\n\t\tmessage: `Error loading ${relativeId(\n\t\t\tid\n\t\t)}: plugin load hook should return a string, a { code, map } object, or nothing/null`\n\t};\n}\n\nexport function errDeprecation(deprecation: string | RollupWarning): RollupLogProps {\n\treturn {\n\t\tcode: Errors.DEPRECATED_FEATURE,\n\t\t...(typeof deprecation === 'string' ? { message: deprecation } : deprecation)\n\t};\n}\n\nexport function errFileReferenceIdNotFoundForFilename(assetReferenceId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.FILE_NOT_FOUND,\n\t\tmessage: `Plugin error - Unable to get file name for unknown file \"${assetReferenceId}\".`\n\t};\n}\n\nexport function errFileNameConflict(fileName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.FILE_NAME_CONFLICT,\n\t\tmessage: `The emitted file \"${fileName}\" overwrites a previously emitted file of the same name.`\n\t};\n}\n\nexport function errInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,\n\t\tmessage: `The \"${hookName}\" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`\n\t};\n}\n\nexport function errCannotAssignModuleToChunk(\n\tmoduleId: string,\n\tassignToAlias: string,\n\tcurrentAlias: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_CHUNK,\n\t\tmessage: `Cannot assign ${relativeId(\n\t\t\tmoduleId\n\t\t)} to the \"${assignToAlias}\" chunk as it is already in the \"${currentAlias}\" chunk.`\n\t};\n}\n\nexport function errInvalidExportOptionValue(optionValue: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_EXPORT_OPTION,\n\t\tmessage: `\"output.exports\" must be \"default\", \"named\", \"none\", \"auto\", or left unspecified (defaults to \"auto\"), received \"${optionValue}\"`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errIncompatibleExportOptionValue(\n\toptionValue: string,\n\tkeys: readonly string[],\n\tentryModule: string\n): RollupLogProps {\n\treturn {\n\t\tcode: 'INVALID_EXPORT_OPTION',\n\t\tmessage: `\"${optionValue}\" was specified for \"output.exports\", but entry module \"${relativeId(\n\t\t\tentryModule\n\t\t)}\" has the following exports: ${keys.join(', ')}`\n\t};\n}\n\nexport function errInternalIdCannotBeExternal(source: string, importer: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_EXTERNAL_ID,\n\t\tmessage: `'${source}' is imported as an external by ${relativeId(\n\t\t\timporter\n\t\t)}, but is already an existing non-external module id.`\n\t};\n}\n\nexport function errInvalidOption(\n\toption: string,\n\turlHash: string,\n\texplanation: string,\n\tvalue?: string | boolean | null\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_OPTION,\n\t\tmessage: `Invalid value ${\n\t\t\tvalue !== undefined ? `${JSON.stringify(value)} ` : ''\n\t\t}for option \"${option}\" - ${explanation}.`,\n\t\turl: `https://rollupjs.org/guide/en/#${urlHash}`\n\t};\n}\n\nexport function errInvalidAddonPluginHook(hook: string, plugin: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_PLUGIN_HOOK,\n\t\thook,\n\t\tmessage: `Error running plugin hook ${hook} for plugin ${plugin}, expected a string, a function hook or an object with a \"handler\" string or function.`,\n\t\tplugin\n\t};\n}\n\nexport function errInvalidFunctionPluginHook(hook: string, plugin: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_PLUGIN_HOOK,\n\t\thook,\n\t\tmessage: `Error running plugin hook ${hook} for plugin ${plugin}, expected a function hook or an object with a \"handler\" function.`,\n\t\tplugin\n\t};\n}\n\nexport function errInvalidRollupPhaseForAddWatchFile(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_ROLLUP_PHASE,\n\t\tmessage: `Cannot call addWatchFile after the build has finished.`\n\t};\n}\n\nexport function errInvalidRollupPhaseForChunkEmission(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.INVALID_ROLLUP_PHASE,\n\t\tmessage: `Cannot emit chunks after module loading has finished.`\n\t};\n}\n\nexport function errMissingExport(\n\texportName: string,\n\timportingModule: string,\n\timportedModule: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_EXPORT,\n\t\tmessage: `'${exportName}' is not exported by ${relativeId(\n\t\t\timportedModule\n\t\t)}, imported by ${relativeId(importingModule)}`,\n\t\turl: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`\n\t};\n}\n\nexport function errImplicitDependantCannotBeExternal(\n\tunresolvedId: string,\n\timplicitlyLoadedBefore: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tunresolvedId\n\t\t)}\" that should be implicitly loaded before \"${relativeId(\n\t\t\timplicitlyLoadedBefore\n\t\t)}\" cannot be external.`\n\t};\n}\n\nexport function errUnresolvedImplicitDependant(\n\tunresolvedId: string,\n\timplicitlyLoadedBefore: string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tunresolvedId\n\t\t)}\" that should be implicitly loaded before \"${relativeId(\n\t\t\timplicitlyLoadedBefore\n\t\t)}\" could not be resolved.`\n\t};\n}\n\nexport function errImplicitDependantIsNotIncluded(module: Module): RollupLogProps {\n\tconst implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency =>\n\t\trelativeId(dependency.id)\n\t).sort();\n\treturn {\n\t\tcode: Errors.MISSING_IMPLICIT_DEPENDANT,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tmodule.id\n\t\t)}\" that should be implicitly loaded before ${printQuotedStringList(\n\t\t\timplicitDependencies\n\t\t)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`\n\t};\n}\n\nexport function errMixedExport(facadeModuleId: string, name?: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.MIXED_EXPORTS,\n\t\tid: facadeModuleId,\n\t\tmessage: `Entry module \"${relativeId(\n\t\t\tfacadeModuleId\n\t\t)}\" is using named and default exports together. Consumers of your bundle will have to use \\`${\n\t\t\tname || 'chunk'\n\t\t}[\"default\"]\\` to access the default export, which may not be what you want. Use \\`output.exports: \"named\"\\` to disable this warning`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errNamespaceConflict(\n\tname: string,\n\treexportingModuleId: string,\n\tsources: string[]\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.NAMESPACE_CONFLICT,\n\t\tmessage: `Conflicting namespaces: \"${relativeId(\n\t\t\treexportingModuleId\n\t\t)}\" re-exports \"${name}\" from one of the modules ${printQuotedStringList(\n\t\t\tsources.map(moduleId => relativeId(moduleId))\n\t\t)} (will be ignored)`,\n\t\tname,\n\t\treexporter: reexportingModuleId,\n\t\tsources\n\t};\n}\n\nexport function errAmbiguousExternalNamespaces(\n\tname: string,\n\treexportingModule: string,\n\tusedModule: string,\n\tsources: string[]\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.AMBIGUOUS_EXTERNAL_NAMESPACES,\n\t\tmessage: `Ambiguous external namespace resolution: \"${relativeId(\n\t\t\treexportingModule\n\t\t)}\" re-exports \"${name}\" from one of the external modules ${printQuotedStringList(\n\t\t\tsources.map(module => relativeId(module))\n\t\t)}, guessing \"${relativeId(usedModule)}\".`,\n\t\tname,\n\t\treexporter: reexportingModule,\n\t\tsources\n\t};\n}\n\nexport function errNoTransformMapOrAstWithoutCode(pluginName: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,\n\t\tmessage:\n\t\t\t`The plugin \"${pluginName}\" returned a \"map\" or \"ast\" without returning ` +\n\t\t\t'a \"code\". This will be ignored.'\n\t};\n}\n\nexport function errPreferNamedExports(facadeModuleId: string): RollupLogProps {\n\tconst file = relativeId(facadeModuleId);\n\treturn {\n\t\tcode: Errors.PREFER_NAMED_EXPORTS,\n\t\tid: facadeModuleId,\n\t\tmessage: `Entry module \"${file}\" is implicitly using \"default\" export mode, which means for CommonJS output that its default export is assigned to \"module.exports\". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set \"output.exports\" to either \"auto\" or \"default\", otherwise you might want to consider changing the signature of \"${file}\" to use named exports only.`,\n\t\turl: `https://rollupjs.org/guide/en/#outputexports`\n\t};\n}\n\nexport function errSyntheticNamedExportsNeedNamespaceExport(\n\tid: string,\n\tsyntheticNamedExportsOption: boolean | string\n): RollupLogProps {\n\treturn {\n\t\tcode: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,\n\t\tid,\n\t\tmessage: `Module \"${relativeId(\n\t\t\tid\n\t\t)}\" that is marked with 'syntheticNamedExports: ${JSON.stringify(\n\t\t\tsyntheticNamedExportsOption\n\t\t)}' needs ${\n\t\t\ttypeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'\n\t\t\t\t? `an explicit export named \"${syntheticNamedExportsOption}\"`\n\t\t\t\t: 'a default export'\n\t\t} that does not reexport an unresolved named export of the same module.`\n\t};\n}\n\nexport function errUnexpectedNamedImport(\n\tid: string,\n\timported: string,\n\tisReexport: boolean\n): RollupLogProps {\n\tconst importType = isReexport ? 'reexport' : 'import';\n\treturn {\n\t\tcode: Errors.UNEXPECTED_NAMED_IMPORT,\n\t\tid,\n\t\tmessage: `The named export \"${imported}\" was ${importType}ed from the external module ${relativeId(\n\t\t\tid\n\t\t)} even though its interop type is \"defaultOnly\". Either remove or change this ${importType} or change the value of the \"output.interop\" option.`,\n\t\turl: 'https://rollupjs.org/guide/en/#outputinterop'\n\t};\n}\n\nexport function errUnexpectedNamespaceReexport(id: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNEXPECTED_NAMED_IMPORT,\n\t\tid,\n\t\tmessage: `There was a namespace \"*\" reexport from the external module ${relativeId(\n\t\t\tid\n\t\t)} even though its interop type is \"defaultOnly\". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the \"output.interop\" option.`,\n\t\turl: 'https://rollupjs.org/guide/en/#outputinterop'\n\t};\n}\n\nexport function errEntryCannotBeExternal(unresolvedId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_ENTRY,\n\t\tmessage: `Entry module cannot be external (${relativeId(unresolvedId)}).`\n\t};\n}\n\nexport function errUnresolvedEntry(unresolvedId: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_ENTRY,\n\t\tmessage: `Could not resolve entry module (${relativeId(unresolvedId)}).`\n\t};\n}\n\nexport function errUnresolvedImport(source: string, importer: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_IMPORT,\n\t\tmessage: `Could not resolve '${source}' from ${relativeId(importer)}`\n\t};\n}\n\nexport function errUnresolvedImportTreatedAsExternal(\n\tsource: string,\n\timporter: string\n): RollupWarning {\n\treturn {\n\t\tcode: Errors.UNRESOLVED_IMPORT,\n\t\timporter: relativeId(importer),\n\t\tmessage: `'${source}' is imported by ${relativeId(\n\t\t\timporter\n\t\t)}, but could not be resolved – treating it as an external dependency`,\n\t\tsource,\n\t\turl: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'\n\t};\n}\n\nexport function errExternalSyntheticExports(source: string, importer: string): RollupWarning {\n\treturn {\n\t\tcode: Errors.EXTERNAL_SYNTHETIC_EXPORTS,\n\t\timporter: relativeId(importer),\n\t\tmessage: `External '${source}' can not have 'syntheticNamedExports' enabled.`,\n\t\tsource\n\t};\n}\n\nexport function errFailedValidation(message: string): RollupLogProps {\n\treturn {\n\t\tcode: Errors.VALIDATION_ERROR,\n\t\tmessage\n\t};\n}\n\nexport function errAlreadyClosed(): RollupLogProps {\n\treturn {\n\t\tcode: Errors.ALREADY_CLOSED,\n\t\tmessage: 'Bundle is already closed, no more calls to \"generate\" or \"write\" are allowed.'\n\t};\n}\n\nexport function warnDeprecation(\n\tdeprecation: string | RollupWarning,\n\tactiveDeprecation: boolean,\n\toptions: NormalizedInputOptions\n): void {\n\twarnDeprecationWithOptions(\n\t\tdeprecation,\n\t\tactiveDeprecation,\n\t\toptions.onwarn,\n\t\toptions.strictDeprecations\n\t);\n}\n\nexport function warnDeprecationWithOptions(\n\tdeprecation: string | RollupWarning,\n\tactiveDeprecation: boolean,\n\twarn: WarningHandler,\n\tstrictDeprecations: boolean\n): void {\n\tif (activeDeprecation || strictDeprecations) {\n\t\tconst warning = errDeprecation(deprecation);\n\t\tif (strictDeprecations) {\n\t\t\treturn error(warning);\n\t\t}\n\t\twarn(warning);\n\t}\n}\n","const RESERVED_NAMES: ReadonlySet = new Set([\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'NaN',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'undefined',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n]);\n\nexport default RESERVED_NAMES;\n","import RESERVED_NAMES from './RESERVED_NAMES';\n\nconst illegalCharacters = /[^$_a-zA-Z0-9]/g;\n\nconst startsWithDigit = (str: string): boolean => /\\d/.test(str[0]);\n\nconst needsEscape = (str: string) =>\n\tstartsWithDigit(str) || RESERVED_NAMES.has(str) || str === 'arguments';\n\nexport function isLegal(str: string): boolean {\n\tif (needsEscape(str)) {\n\t\treturn false;\n\t}\n\treturn !illegalCharacters.test(str);\n}\n\nexport function makeLegal(str: string): string {\n\tstr = str.replace(/-(\\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');\n\n\tif (needsEscape(str)) str = `_${str}`;\n\n\treturn str || '_';\n}\n","import ExternalVariable from './ast/variables/ExternalVariable';\nimport type {\n\tCustomPluginOptions,\n\tModuleInfo,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions\n} from './rollup/types';\nimport { EMPTY_ARRAY } from './utils/blank';\nimport { warnDeprecation } from './utils/error';\nimport { makeLegal } from './utils/identifierHelpers';\nimport { normalize, relative } from './utils/path';\nimport { printQuotedStringList } from './utils/printStringList';\nimport relativeId from './utils/relativeId';\n\nexport default class ExternalModule {\n\treadonly declarations = new Map();\n\tdefaultVariableName = '';\n\treadonly dynamicImporters: string[] = [];\n\texecIndex = Infinity;\n\treadonly exportedVariables = new Map();\n\treadonly importers: string[] = [];\n\treadonly info: ModuleInfo;\n\tmostCommonSuggestion = 0;\n\treadonly nameSuggestions = new Map();\n\tnamespaceVariableName = '';\n\treexported = false;\n\trenderPath: string = undefined as never;\n\tsuggestedVariableName: string;\n\tused = false;\n\tvariableName = '';\n\n\tconstructor(\n\t\tprivate readonly options: NormalizedInputOptions,\n\t\tpublic readonly id: string,\n\t\tmoduleSideEffects: boolean | 'no-treeshake',\n\t\tmeta: CustomPluginOptions,\n\t\tpublic readonly renormalizeRenderPath: boolean\n\t) {\n\t\tthis.suggestedVariableName = makeLegal(id.split(/[\\\\/]/).pop()!);\n\n\t\tconst { importers, dynamicImporters } = this;\n\t\tconst info: ModuleInfo = (this.info = {\n\t\t\tast: null,\n\t\t\tcode: null,\n\t\t\tdynamicallyImportedIdResolutions: EMPTY_ARRAY,\n\t\t\tdynamicallyImportedIds: EMPTY_ARRAY,\n\t\t\tget dynamicImporters() {\n\t\t\t\treturn dynamicImporters.sort();\n\t\t\t},\n\t\t\thasDefaultExport: null,\n\t\t\tget hasModuleSideEffects() {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',\n\t\t\t\t\tfalse,\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t\treturn info.moduleSideEffects;\n\t\t\t},\n\t\t\tid,\n\t\t\timplicitlyLoadedAfterOneOf: EMPTY_ARRAY,\n\t\t\timplicitlyLoadedBefore: EMPTY_ARRAY,\n\t\t\timportedIdResolutions: EMPTY_ARRAY,\n\t\t\timportedIds: EMPTY_ARRAY,\n\t\t\tget importers() {\n\t\t\t\treturn importers.sort();\n\t\t\t},\n\t\t\tisEntry: false,\n\t\t\tisExternal: true,\n\t\t\tisIncluded: null,\n\t\t\tmeta,\n\t\t\tmoduleSideEffects,\n\t\t\tsyntheticNamedExports: false\n\t\t});\n\t\t// Hide the deprecated key so that it only warns when accessed explicitly\n\t\tObject.defineProperty(this.info, 'hasModuleSideEffects', {\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tgetVariableForExportName(name: string): [variable: ExternalVariable] {\n\t\tconst declaration = this.declarations.get(name);\n\t\tif (declaration) return [declaration];\n\t\tconst externalVariable = new ExternalVariable(this, name);\n\n\t\tthis.declarations.set(name, externalVariable);\n\t\tthis.exportedVariables.set(externalVariable, name);\n\t\treturn [externalVariable];\n\t}\n\n\tsetRenderPath(options: NormalizedOutputOptions, inputBase: string): void {\n\t\tthis.renderPath =\n\t\t\ttypeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];\n\t\tif (!this.renderPath) {\n\t\t\tthis.renderPath = this.renormalizeRenderPath\n\t\t\t\t? normalize(relative(inputBase, this.id))\n\t\t\t\t: this.id;\n\t\t}\n\t}\n\n\tsuggestName(name: string): void {\n\t\tconst value = (this.nameSuggestions.get(name) ?? 0) + 1;\n\t\tthis.nameSuggestions.set(name, value);\n\n\t\tif (value > this.mostCommonSuggestion) {\n\t\t\tthis.mostCommonSuggestion = value;\n\t\t\tthis.suggestedVariableName = name;\n\t\t}\n\t}\n\n\twarnUnusedImports(): void {\n\t\tconst unused = Array.from(this.declarations)\n\t\t\t.filter(\n\t\t\t\t([name, declaration]) =>\n\t\t\t\t\tname !== '*' && !declaration.included && !this.reexported && !declaration.referenced\n\t\t\t)\n\t\t\t.map(([name]) => name);\n\n\t\tif (unused.length === 0) return;\n\n\t\tconst importersSet = new Set();\n\t\tfor (const name of unused) {\n\t\t\tfor (const importer of this.declarations.get(name)!.module.importers) {\n\t\t\t\timportersSet.add(importer);\n\t\t\t}\n\t\t}\n\t\tconst importersArray = [...importersSet];\n\t\tthis.options.onwarn({\n\t\t\tcode: 'UNUSED_EXTERNAL_IMPORT',\n\t\t\tmessage: `${printQuotedStringList(unused, ['is', 'are'])} imported from external module \"${\n\t\t\t\tthis.id\n\t\t\t}\" but never used in ${printQuotedStringList(\n\t\t\t\timportersArray.map(importer => relativeId(importer))\n\t\t\t)}.`,\n\t\t\tnames: unused,\n\t\t\tsource: this.id,\n\t\t\tsources: importersArray\n\t\t});\n\t}\n}\n","import { extname, win32, posix, isAbsolute, resolve } from 'path';\nimport pm from 'picomatch';\n\nconst addExtension = function addExtension(filename, ext = '.js') {\n let result = `${filename}`;\n if (!extname(filename))\n result += ext;\n return result;\n};\n\nclass WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }\n\t __init() {this.should_skip = false;}\n\t __init2() {this.should_remove = false;}\n\t __init3() {this.replacement = null;}\n\n\t __init4() {this.context = {\n\t\tskip: () => (this.should_skip = true),\n\t\tremove: () => (this.should_remove = true),\n\t\treplace: (node) => (this.replacement = node)\n\t};}\n\n\t replace(parent, prop, index, node) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop][index] = node;\n\t\t\t} else {\n\t\t\t\tparent[prop] = node;\n\t\t\t}\n\t\t}\n\t}\n\n\t remove(parent, prop, index) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop].splice(index, 1);\n\t\t\t} else {\n\t\t\t\tdelete parent[prop];\n\t\t\t}\n\t\t}\n\t}\n}\n\nclass SyncWalkerClass extends WalkerBase {\n\t\n\t\n\n\tconstructor(walker) {\n\t\tsuper();\n\t\tthis.enter = walker.enter;\n\t\tthis.leave = walker.leave;\n\t}\n\n\t visit(\n\t\tnode,\n\t\tparent,\n\t\tenter,\n\t\tleave,\n\t\tprop,\n\t\tindex\n\t) {\n\t\tif (node) {\n\t\t\tif (enter) {\n\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tthis.should_skip = false;\n\t\t\t\tthis.should_remove = false;\n\t\t\t\tthis.replacement = null;\n\n\t\t\t\tenter.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\tif (skipped) return node;\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\n\t\t\tfor (const key in node) {\n\t\t\t\tconst value = (node )[key];\n\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\t\tif (value[i] !== null && typeof value[i].type === 'string') {\n\t\t\t\t\t\t\tif (!this.visit(value[i], node, enter, leave, key, i)) {\n\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (value !== null && typeof value.type === \"string\") {\n\t\t\t\t\tthis.visit(value, node, enter, leave, key, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (leave) {\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tthis.replacement = null;\n\t\t\t\tthis.should_remove = false;\n\n\t\t\t\tleave.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.replacement = _replacement;\n\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\t\t}\n\n\t\treturn node;\n\t}\n}\n\nfunction walk(ast, walker) {\n\tconst instance = new SyncWalkerClass(walker);\n\treturn instance.visit(ast, null, walker.enter, walker.leave);\n}\n\nconst extractors = {\n ArrayPattern(names, param) {\n for (const element of param.elements) {\n if (element)\n extractors[element.type](names, element);\n }\n },\n AssignmentPattern(names, param) {\n extractors[param.left.type](names, param.left);\n },\n Identifier(names, param) {\n names.push(param.name);\n },\n MemberExpression() { },\n ObjectPattern(names, param) {\n for (const prop of param.properties) {\n // @ts-ignore Typescript reports that this is not a valid type\n if (prop.type === 'RestElement') {\n extractors.RestElement(names, prop);\n }\n else {\n extractors[prop.value.type](names, prop.value);\n }\n }\n },\n RestElement(names, param) {\n extractors[param.argument.type](names, param.argument);\n }\n};\nconst extractAssignedNames = function extractAssignedNames(param) {\n const names = [];\n extractors[param.type](names, param);\n return names;\n};\n\nconst blockDeclarations = {\n const: true,\n let: true\n};\nclass Scope {\n constructor(options = {}) {\n this.parent = options.parent;\n this.isBlockScope = !!options.block;\n this.declarations = Object.create(null);\n if (options.params) {\n options.params.forEach((param) => {\n extractAssignedNames(param).forEach((name) => {\n this.declarations[name] = true;\n });\n });\n }\n }\n addDeclaration(node, isBlockDeclaration, isVar) {\n if (!isBlockDeclaration && this.isBlockScope) {\n // it's a `var` or function node, and this\n // is a block scope, so we need to go up\n this.parent.addDeclaration(node, isBlockDeclaration, isVar);\n }\n else if (node.id) {\n extractAssignedNames(node.id).forEach((name) => {\n this.declarations[name] = true;\n });\n }\n }\n contains(name) {\n return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);\n }\n}\nconst attachScopes = function attachScopes(ast, propertyName = 'scope') {\n let scope = new Scope();\n walk(ast, {\n enter(n, parent) {\n const node = n;\n // function foo () {...}\n // class Foo {...}\n if (/(Function|Class)Declaration/.test(node.type)) {\n scope.addDeclaration(node, false, false);\n }\n // var foo = 1\n if (node.type === 'VariableDeclaration') {\n const { kind } = node;\n const isBlockDeclaration = blockDeclarations[kind];\n node.declarations.forEach((declaration) => {\n scope.addDeclaration(declaration, isBlockDeclaration, true);\n });\n }\n let newScope;\n // create new function scope\n if (/Function/.test(node.type)) {\n const func = node;\n newScope = new Scope({\n parent: scope,\n block: false,\n params: func.params\n });\n // named function expressions - the name is considered\n // part of the function's scope\n if (func.type === 'FunctionExpression' && func.id) {\n newScope.addDeclaration(func, false, false);\n }\n }\n // create new for scope\n if (/For(In|Of)?Statement/.test(node.type)) {\n newScope = new Scope({\n parent: scope,\n block: true\n });\n }\n // create new block scope\n if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {\n newScope = new Scope({\n parent: scope,\n block: true\n });\n }\n // catch clause has its own block scope\n if (node.type === 'CatchClause') {\n newScope = new Scope({\n parent: scope,\n params: node.param ? [node.param] : [],\n block: true\n });\n }\n if (newScope) {\n Object.defineProperty(node, propertyName, {\n value: newScope,\n configurable: true\n });\n scope = newScope;\n }\n },\n leave(n) {\n const node = n;\n if (node[propertyName])\n scope = scope.parent;\n }\n });\n return scope;\n};\n\n// Helper since Typescript can't detect readonly arrays with Array.isArray\nfunction isArray(arg) {\n return Array.isArray(arg);\n}\nfunction ensureArray(thing) {\n if (isArray(thing))\n return thing;\n if (thing == null)\n return [];\n return [thing];\n}\n\nconst normalizePath = function normalizePath(filename) {\n return filename.split(win32.sep).join(posix.sep);\n};\n\nfunction getMatcherString(id, resolutionBase) {\n if (resolutionBase === false || isAbsolute(id) || id.startsWith('*')) {\n return normalizePath(id);\n }\n // resolve('') is valid and will default to process.cwd()\n const basePath = normalizePath(resolve(resolutionBase || ''))\n // escape all possible (posix + win) path characters that might interfere with regex\n .replace(/[-^$*+?.()|[\\]{}]/g, '\\\\$&');\n // Note that we use posix.join because:\n // 1. the basePath has been normalized to use /\n // 2. the incoming glob (id) matcher, also uses /\n // otherwise Node will force backslash (\\) on windows\n return posix.join(basePath, normalizePath(id));\n}\nconst createFilter = function createFilter(include, exclude, options) {\n const resolutionBase = options && options.resolve;\n const getMatcher = (id) => id instanceof RegExp\n ? id\n : {\n test: (what) => {\n // this refactor is a tad overly verbose but makes for easy debugging\n const pattern = getMatcherString(id, resolutionBase);\n const fn = pm(pattern, { dot: true });\n const result = fn(what);\n return result;\n }\n };\n const includeMatchers = ensureArray(include).map(getMatcher);\n const excludeMatchers = ensureArray(exclude).map(getMatcher);\n return function result(id) {\n if (typeof id !== 'string')\n return false;\n if (/\\0/.test(id))\n return false;\n const pathId = normalizePath(id);\n for (let i = 0; i < excludeMatchers.length; ++i) {\n const matcher = excludeMatchers[i];\n if (matcher.test(pathId))\n return false;\n }\n for (let i = 0; i < includeMatchers.length; ++i) {\n const matcher = includeMatchers[i];\n if (matcher.test(pathId))\n return true;\n }\n return !includeMatchers.length;\n };\n};\n\nconst reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';\nconst builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';\nconst forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));\nforbiddenIdentifiers.add('');\nconst makeLegalIdentifier = function makeLegalIdentifier(str) {\n let identifier = str\n .replace(/-(\\w)/g, (_, letter) => letter.toUpperCase())\n .replace(/[^$_a-zA-Z0-9]/g, '_');\n if (/\\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) {\n identifier = `_${identifier}`;\n }\n return identifier || '_';\n};\n\nfunction stringify(obj) {\n return (JSON.stringify(obj) || 'undefined').replace(/[\\u2028\\u2029]/g, (char) => `\\\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);\n}\nfunction serializeArray(arr, indent, baseIndent) {\n let output = '[';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n for (let i = 0; i < arr.length; i++) {\n const key = arr[i];\n output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}]`;\n}\nfunction serializeObject(obj, indent, baseIndent) {\n let output = '{';\n const separator = indent ? `\\n${baseIndent}${indent}` : '';\n const entries = Object.entries(obj);\n for (let i = 0; i < entries.length; i++) {\n const [key, value] = entries[i];\n const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);\n output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;\n }\n return `${output}${indent ? `\\n${baseIndent}` : ''}}`;\n}\nfunction serialize(obj, indent, baseIndent) {\n if (typeof obj === 'object' && obj !== null) {\n if (Array.isArray(obj))\n return serializeArray(obj, indent, baseIndent);\n if (obj instanceof Date)\n return `new Date(${obj.getTime()})`;\n if (obj instanceof RegExp)\n return obj.toString();\n return serializeObject(obj, indent, baseIndent);\n }\n if (typeof obj === 'number') {\n if (obj === Infinity)\n return 'Infinity';\n if (obj === -Infinity)\n return '-Infinity';\n if (obj === 0)\n return 1 / obj === Infinity ? '0' : '-0';\n if (obj !== obj)\n return 'NaN'; // eslint-disable-line no-self-compare\n }\n if (typeof obj === 'symbol') {\n const key = Symbol.keyFor(obj);\n if (key !== undefined)\n return `Symbol.for(${stringify(key)})`;\n }\n if (typeof obj === 'bigint')\n return `${obj}n`;\n return stringify(obj);\n}\nconst dataToEsm = function dataToEsm(data, options = {}) {\n const t = options.compact ? '' : 'indent' in options ? options.indent : '\\t';\n const _ = options.compact ? '' : ' ';\n const n = options.compact ? '' : '\\n';\n const declarationType = options.preferConst ? 'const' : 'var';\n if (options.namedExports === false ||\n typeof data !== 'object' ||\n Array.isArray(data) ||\n data instanceof Date ||\n data instanceof RegExp ||\n data === null) {\n const code = serialize(data, options.compact ? null : t, '');\n const magic = _ || (/^[{[\\-\\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape\n return `export default${magic}${code};`;\n }\n let namedExportCode = '';\n const defaultExportRows = [];\n for (const [key, value] of Object.entries(data)) {\n if (key === makeLegalIdentifier(key)) {\n if (options.objectShorthand)\n defaultExportRows.push(key);\n else\n defaultExportRows.push(`${key}:${_}${key}`);\n namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;\n }\n else {\n defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);\n }\n }\n return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;\n};\n\n// TODO: remove this in next major\nvar index = {\n addExtension,\n attachScopes,\n createFilter,\n dataToEsm,\n extractAssignedNames,\n makeLegalIdentifier,\n normalizePath\n};\n\nexport { addExtension, attachScopes, createFilter, dataToEsm, index as default, extractAssignedNames, makeLegalIdentifier, normalizePath };\n","import type { Entity } from './Entity';\nimport type { ExpressionEntity } from './nodes/shared/Expression';\nimport { DiscriminatedPathTracker, PathTracker } from './utils/PathTracker';\nimport type ThisVariable from './variables/ThisVariable';\n\ninterface ExecutionContextIgnore {\n\tbreaks: boolean;\n\tcontinues: boolean;\n\tlabels: Set;\n\treturnYield: boolean;\n}\n\nexport const BROKEN_FLOW_NONE = 0;\nexport const BROKEN_FLOW_BREAK_CONTINUE = 1;\nexport const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;\n\ninterface ControlFlowContext {\n\tbrokenFlow: number;\n\tincludedLabels: Set;\n}\n\nexport interface InclusionContext extends ControlFlowContext {\n\tincludedCallArguments: Set;\n}\n\nexport interface HasEffectsContext extends ControlFlowContext {\n\taccessed: PathTracker;\n\tassigned: PathTracker;\n\tbrokenFlow: number;\n\tcalled: DiscriminatedPathTracker;\n\tignore: ExecutionContextIgnore;\n\tinstantiated: DiscriminatedPathTracker;\n\treplacedVariableInits: Map;\n}\n\nexport function createInclusionContext(): InclusionContext {\n\treturn {\n\t\tbrokenFlow: BROKEN_FLOW_NONE,\n\t\tincludedCallArguments: new Set(),\n\t\tincludedLabels: new Set()\n\t};\n}\n\nexport function createHasEffectsContext(): HasEffectsContext {\n\treturn {\n\t\taccessed: new PathTracker(),\n\t\tassigned: new PathTracker(),\n\t\tbrokenFlow: BROKEN_FLOW_NONE,\n\t\tcalled: new DiscriminatedPathTracker(),\n\t\tignore: {\n\t\t\tbreaks: false,\n\t\t\tcontinues: false,\n\t\t\tlabels: new Set(),\n\t\t\treturnYield: false\n\t\t},\n\t\tincludedLabels: new Set(),\n\t\tinstantiated: new DiscriminatedPathTracker(),\n\t\treplacedVariableInits: new Map()\n\t};\n}\n","import type { HasEffectsContext } from './ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from './NodeInteractions';\nimport type { LiteralValue } from './nodes/Literal';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './nodes/shared/Expression';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype ObjectPathKey,\n\tSHARED_RECURSION_TRACKER\n} from './utils/PathTracker';\n\nexport interface MemberDescription {\n\thasEffectsWhenCalled:\n\t\t| ((interaction: NodeInteractionCalled, context: HasEffectsContext) => boolean)\n\t\t| null;\n\treturns: ExpressionEntity;\n}\n\nexport interface MemberDescriptions {\n\t[key: string]: MemberDescription;\n}\n\ninterface RawMemberDescription {\n\tvalue: MemberDescription;\n}\n\nfunction assembleMemberDescriptions(\n\tmemberDescriptions: { [key: string]: RawMemberDescription },\n\tinheritedDescriptions: MemberDescriptions | null = null\n): MemberDescriptions {\n\treturn Object.create(inheritedDescriptions, memberDescriptions);\n}\n\nexport const UNDEFINED_EXPRESSION: ExpressionEntity =\n\tnew (class UndefinedExpression extends ExpressionEntity {\n\t\tgetLiteralValueAtPath() {\n\t\t\treturn undefined;\n\t\t}\n\t})();\n\nconst returnsUnknown: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_EXPRESSION\n\t}\n};\n\nexport const UNKNOWN_LITERAL_BOOLEAN: ExpressionEntity =\n\tnew (class UnknownBoolean extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalBooleanMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsBoolean: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_BOOLEAN\n\t}\n};\n\nexport const UNKNOWN_LITERAL_NUMBER: ExpressionEntity =\n\tnew (class UnknownNumber extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalNumberMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsNumber: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_NUMBER\n\t}\n};\n\nexport const UNKNOWN_LITERAL_STRING: ExpressionEntity =\n\tnew (class UnknownString extends ExpressionEntity {\n\t\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\t\tif (path.length === 1) {\n\t\t\t\treturn getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(\n\t\t\tpath: ObjectPath,\n\t\t\tinteraction: NodeInteraction,\n\t\t\tcontext: HasEffectsContext\n\t\t): boolean {\n\t\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\t\treturn path.length > 1;\n\t\t\t}\n\t\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\t\treturn hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t})();\n\nconst returnsString: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled: null,\n\t\treturns: UNKNOWN_LITERAL_STRING\n\t}\n};\n\nconst stringReplace: RawMemberDescription = {\n\tvalue: {\n\t\thasEffectsWhenCalled({ args }, context) {\n\t\t\tconst arg1 = args[1];\n\t\t\treturn (\n\t\t\t\targs.length < 2 ||\n\t\t\t\t(typeof arg1.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, {\n\t\t\t\t\tdeoptimizeCache() {}\n\t\t\t\t}) === 'symbol' &&\n\t\t\t\t\targ1.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context))\n\t\t\t);\n\t\t},\n\t\treturns: UNKNOWN_LITERAL_STRING\n\t}\n};\n\nconst objectMembers: MemberDescriptions = assembleMemberDescriptions({\n\thasOwnProperty: returnsBoolean,\n\tisPrototypeOf: returnsBoolean,\n\tpropertyIsEnumerable: returnsBoolean,\n\ttoLocaleString: returnsString,\n\ttoString: returnsString,\n\tvalueOf: returnsUnknown\n});\n\nconst literalBooleanMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\tvalueOf: returnsBoolean\n\t},\n\tobjectMembers\n);\n\nconst literalNumberMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\ttoExponential: returnsString,\n\t\ttoFixed: returnsString,\n\t\ttoLocaleString: returnsString,\n\t\ttoPrecision: returnsString,\n\t\tvalueOf: returnsNumber\n\t},\n\tobjectMembers\n);\n\nexport const literalStringMembers: MemberDescriptions = assembleMemberDescriptions(\n\t{\n\t\tanchor: returnsString,\n\n\t\tat: returnsUnknown,\n\t\tbig: returnsString,\n\t\tblink: returnsString,\n\t\tbold: returnsString,\n\t\tcharAt: returnsString,\n\t\tcharCodeAt: returnsNumber,\n\t\tcodePointAt: returnsUnknown,\n\t\tconcat: returnsString,\n\t\tendsWith: returnsBoolean,\n\t\tfixed: returnsString,\n\t\tfontcolor: returnsString,\n\t\tfontsize: returnsString,\n\t\tincludes: returnsBoolean,\n\t\tindexOf: returnsNumber,\n\t\titalics: returnsString,\n\t\tlastIndexOf: returnsNumber,\n\t\tlink: returnsString,\n\t\tlocaleCompare: returnsNumber,\n\t\tmatch: returnsUnknown,\n\t\tmatchAll: returnsUnknown,\n\t\tnormalize: returnsString,\n\t\tpadEnd: returnsString,\n\t\tpadStart: returnsString,\n\t\trepeat: returnsString,\n\t\treplace: stringReplace,\n\t\treplaceAll: stringReplace,\n\t\tsearch: returnsNumber,\n\t\tslice: returnsString,\n\t\tsmall: returnsString,\n\t\tsplit: returnsUnknown,\n\t\tstartsWith: returnsBoolean,\n\t\tstrike: returnsString,\n\t\tsub: returnsString,\n\t\tsubstr: returnsString,\n\t\tsubstring: returnsString,\n\t\tsup: returnsString,\n\t\ttoLocaleLowerCase: returnsString,\n\t\ttoLocaleUpperCase: returnsString,\n\t\ttoLowerCase: returnsString,\n\t\ttoString: returnsString, // overrides the toString() method of the Object object; it does not inherit Object.prototype.toString()\n\t\ttoUpperCase: returnsString,\n\t\ttrim: returnsString,\n\t\ttrimEnd: returnsString,\n\t\ttrimLeft: returnsString,\n\t\ttrimRight: returnsString,\n\t\ttrimStart: returnsString,\n\t\tvalueOf: returnsString\n\t},\n\tobjectMembers\n);\n\nexport function getLiteralMembersForValue(\n\tvalue: T\n): MemberDescriptions {\n\tswitch (typeof value) {\n\t\tcase 'boolean':\n\t\t\treturn literalBooleanMembers;\n\t\tcase 'number':\n\t\t\treturn literalNumberMembers;\n\t\tcase 'string':\n\t\t\treturn literalStringMembers;\n\t}\n\treturn Object.create(null);\n}\n\nexport function hasMemberEffectWhenCalled(\n\tmembers: MemberDescriptions,\n\tmemberName: ObjectPathKey,\n\tinteraction: NodeInteractionCalled,\n\tcontext: HasEffectsContext\n): boolean {\n\tif (typeof memberName !== 'string' || !members[memberName]) {\n\t\treturn true;\n\t}\n\treturn members[memberName].hasEffectsWhenCalled?.(interaction, context) || false;\n}\n\nexport function getMemberReturnExpressionWhenCalled(\n\tmembers: MemberDescriptions,\n\tmemberName: ObjectPathKey\n): ExpressionEntity {\n\tif (typeof memberName !== 'string' || !members[memberName]) return UNKNOWN_EXPRESSION;\n\treturn members[memberName].returns;\n}\n","// AST walker module for Mozilla Parser API compatible trees\n\n// A simple walk is one where you simply specify callbacks to be\n// called on specific nodes. The last two arguments are optional. A\n// simple use would be\n//\n// walk.simple(myTree, {\n// Expression: function(node) { ... }\n// });\n//\n// to do something with all expressions. All Parser API node types\n// can be used to identify node types, as well as Expression and\n// Statement, which denote categories of nodes.\n//\n// The base argument can be used to pass a custom (recursive)\n// walker, and state can be used to give this walked an initial\n// state.\n\nfunction simple(node, visitors, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type, found = visitors[type];\n baseVisitor[type](node, st, c);\n if (found) { found(node, st); }\n })(node, state, override);\n}\n\n// An ancestor walk keeps an array of ancestor nodes (including the\n// current node) and passes them to the callback as third parameter\n// (and also as state parameter when no other state is present).\nfunction ancestor(node, visitors, baseVisitor, state, override) {\n var ancestors = [];\n if (!baseVisitor) { baseVisitor = base\n ; }(function c(node, st, override) {\n var type = override || node.type, found = visitors[type];\n var isNew = node !== ancestors[ancestors.length - 1];\n if (isNew) { ancestors.push(node); }\n baseVisitor[type](node, st, c);\n if (found) { found(node, st || ancestors, ancestors); }\n if (isNew) { ancestors.pop(); }\n })(node, state, override);\n}\n\n// A recursive walk is one where your functions override the default\n// walkers. They can modify and replace the state parameter that's\n// threaded through the walk, and can opt how and whether to walk\n// their child nodes (by calling their third argument on these\n// nodes).\nfunction recursive(node, state, funcs, baseVisitor, override) {\n var visitor = funcs ? make(funcs, baseVisitor || undefined) : baseVisitor\n ;(function c(node, st, override) {\n visitor[override || node.type](node, st, c);\n })(node, state, override);\n}\n\nfunction makeTest(test) {\n if (typeof test === \"string\")\n { return function (type) { return type === test; } }\n else if (!test)\n { return function () { return true; } }\n else\n { return test }\n}\n\nvar Found = function Found(node, state) { this.node = node; this.state = state; };\n\n// A full walk triggers the callback on each node\nfunction full(node, callback, baseVisitor, state, override) {\n if (!baseVisitor) { baseVisitor = base; }\n var last\n ;(function c(node, st, override) {\n var type = override || node.type;\n baseVisitor[type](node, st, c);\n if (last !== node) {\n callback(node, st, type);\n last = node;\n }\n })(node, state, override);\n}\n\n// An fullAncestor walk is like an ancestor walk, but triggers\n// the callback on each node\nfunction fullAncestor(node, callback, baseVisitor, state) {\n if (!baseVisitor) { baseVisitor = base; }\n var ancestors = [], last\n ;(function c(node, st, override) {\n var type = override || node.type;\n var isNew = node !== ancestors[ancestors.length - 1];\n if (isNew) { ancestors.push(node); }\n baseVisitor[type](node, st, c);\n if (last !== node) {\n callback(node, st || ancestors, ancestors, type);\n last = node;\n }\n if (isNew) { ancestors.pop(); }\n })(node, state);\n}\n\n// Find a node with a given start, end, and type (all are optional,\n// null can be used as wildcard). Returns a {node, state} object, or\n// undefined when it doesn't find a matching node.\nfunction findNodeAt(node, start, end, test, baseVisitor, state) {\n if (!baseVisitor) { baseVisitor = base; }\n test = makeTest(test);\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if ((start == null || node.start <= start) &&\n (end == null || node.end >= end))\n { baseVisitor[type](node, st, c); }\n if ((start == null || node.start === start) &&\n (end == null || node.end === end) &&\n test(type, node))\n { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the innermost node of a given type that contains the given\n// position. Interface similar to findNodeAt.\nfunction findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the outermost matching node after a given position.\nfunction findNodeAfter(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n if (node.end < pos) { return }\n var type = override || node.type;\n if (node.start >= pos && test(type, node)) { throw new Found(node, st) }\n baseVisitor[type](node, st, c);\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}\n\n// Find the outermost matching node before a given position.\nfunction findNodeBefore(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n var max\n ;(function c(node, st, override) {\n if (node.start > pos) { return }\n var type = override || node.type;\n if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))\n { max = new Found(node, st); }\n baseVisitor[type](node, st, c);\n })(node, state);\n return max\n}\n\n// Used to create a custom walker. Will fill in all missing node\n// type properties with the defaults.\nfunction make(funcs, baseVisitor) {\n var visitor = Object.create(baseVisitor || base);\n for (var type in funcs) { visitor[type] = funcs[type]; }\n return visitor\n}\n\nfunction skipThrough(node, st, c) { c(node, st); }\nfunction ignore(_node, _st, _c) {}\n\n// Node walkers.\n\nvar base = {};\n\nbase.Program = base.BlockStatement = base.StaticBlock = function (node, st, c) {\n for (var i = 0, list = node.body; i < list.length; i += 1)\n {\n var stmt = list[i];\n\n c(stmt, st, \"Statement\");\n }\n};\nbase.Statement = skipThrough;\nbase.EmptyStatement = ignore;\nbase.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =\n function (node, st, c) { return c(node.expression, st, \"Expression\"); };\nbase.IfStatement = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.consequent, st, \"Statement\");\n if (node.alternate) { c(node.alternate, st, \"Statement\"); }\n};\nbase.LabeledStatement = function (node, st, c) { return c(node.body, st, \"Statement\"); };\nbase.BreakStatement = base.ContinueStatement = ignore;\nbase.WithStatement = function (node, st, c) {\n c(node.object, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.SwitchStatement = function (node, st, c) {\n c(node.discriminant, st, \"Expression\");\n for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {\n var cs = list$1[i$1];\n\n if (cs.test) { c(cs.test, st, \"Expression\"); }\n for (var i = 0, list = cs.consequent; i < list.length; i += 1)\n {\n var cons = list[i];\n\n c(cons, st, \"Statement\");\n }\n }\n};\nbase.SwitchCase = function (node, st, c) {\n if (node.test) { c(node.test, st, \"Expression\"); }\n for (var i = 0, list = node.consequent; i < list.length; i += 1)\n {\n var cons = list[i];\n\n c(cons, st, \"Statement\");\n }\n};\nbase.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {\n if (node.argument) { c(node.argument, st, \"Expression\"); }\n};\nbase.ThrowStatement = base.SpreadElement =\n function (node, st, c) { return c(node.argument, st, \"Expression\"); };\nbase.TryStatement = function (node, st, c) {\n c(node.block, st, \"Statement\");\n if (node.handler) { c(node.handler, st); }\n if (node.finalizer) { c(node.finalizer, st, \"Statement\"); }\n};\nbase.CatchClause = function (node, st, c) {\n if (node.param) { c(node.param, st, \"Pattern\"); }\n c(node.body, st, \"Statement\");\n};\nbase.WhileStatement = base.DoWhileStatement = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.ForStatement = function (node, st, c) {\n if (node.init) { c(node.init, st, \"ForInit\"); }\n if (node.test) { c(node.test, st, \"Expression\"); }\n if (node.update) { c(node.update, st, \"Expression\"); }\n c(node.body, st, \"Statement\");\n};\nbase.ForInStatement = base.ForOfStatement = function (node, st, c) {\n c(node.left, st, \"ForInit\");\n c(node.right, st, \"Expression\");\n c(node.body, st, \"Statement\");\n};\nbase.ForInit = function (node, st, c) {\n if (node.type === \"VariableDeclaration\") { c(node, st); }\n else { c(node, st, \"Expression\"); }\n};\nbase.DebuggerStatement = ignore;\n\nbase.FunctionDeclaration = function (node, st, c) { return c(node, st, \"Function\"); };\nbase.VariableDeclaration = function (node, st, c) {\n for (var i = 0, list = node.declarations; i < list.length; i += 1)\n {\n var decl = list[i];\n\n c(decl, st);\n }\n};\nbase.VariableDeclarator = function (node, st, c) {\n c(node.id, st, \"Pattern\");\n if (node.init) { c(node.init, st, \"Expression\"); }\n};\n\nbase.Function = function (node, st, c) {\n if (node.id) { c(node.id, st, \"Pattern\"); }\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n c(param, st, \"Pattern\");\n }\n c(node.body, st, node.expression ? \"Expression\" : \"Statement\");\n};\n\nbase.Pattern = function (node, st, c) {\n if (node.type === \"Identifier\")\n { c(node, st, \"VariablePattern\"); }\n else if (node.type === \"MemberExpression\")\n { c(node, st, \"MemberPattern\"); }\n else\n { c(node, st); }\n};\nbase.VariablePattern = ignore;\nbase.MemberPattern = skipThrough;\nbase.RestElement = function (node, st, c) { return c(node.argument, st, \"Pattern\"); };\nbase.ArrayPattern = function (node, st, c) {\n for (var i = 0, list = node.elements; i < list.length; i += 1) {\n var elt = list[i];\n\n if (elt) { c(elt, st, \"Pattern\"); }\n }\n};\nbase.ObjectPattern = function (node, st, c) {\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n if (prop.type === \"Property\") {\n if (prop.computed) { c(prop.key, st, \"Expression\"); }\n c(prop.value, st, \"Pattern\");\n } else if (prop.type === \"RestElement\") {\n c(prop.argument, st, \"Pattern\");\n }\n }\n};\n\nbase.Expression = skipThrough;\nbase.ThisExpression = base.Super = base.MetaProperty = ignore;\nbase.ArrayExpression = function (node, st, c) {\n for (var i = 0, list = node.elements; i < list.length; i += 1) {\n var elt = list[i];\n\n if (elt) { c(elt, st, \"Expression\"); }\n }\n};\nbase.ObjectExpression = function (node, st, c) {\n for (var i = 0, list = node.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n c(prop, st);\n }\n};\nbase.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;\nbase.SequenceExpression = function (node, st, c) {\n for (var i = 0, list = node.expressions; i < list.length; i += 1)\n {\n var expr = list[i];\n\n c(expr, st, \"Expression\");\n }\n};\nbase.TemplateLiteral = function (node, st, c) {\n for (var i = 0, list = node.quasis; i < list.length; i += 1)\n {\n var quasi = list[i];\n\n c(quasi, st);\n }\n\n for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)\n {\n var expr = list$1[i$1];\n\n c(expr, st, \"Expression\");\n }\n};\nbase.TemplateElement = ignore;\nbase.UnaryExpression = base.UpdateExpression = function (node, st, c) {\n c(node.argument, st, \"Expression\");\n};\nbase.BinaryExpression = base.LogicalExpression = function (node, st, c) {\n c(node.left, st, \"Expression\");\n c(node.right, st, \"Expression\");\n};\nbase.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {\n c(node.left, st, \"Pattern\");\n c(node.right, st, \"Expression\");\n};\nbase.ConditionalExpression = function (node, st, c) {\n c(node.test, st, \"Expression\");\n c(node.consequent, st, \"Expression\");\n c(node.alternate, st, \"Expression\");\n};\nbase.NewExpression = base.CallExpression = function (node, st, c) {\n c(node.callee, st, \"Expression\");\n if (node.arguments)\n { for (var i = 0, list = node.arguments; i < list.length; i += 1)\n {\n var arg = list[i];\n\n c(arg, st, \"Expression\");\n } }\n};\nbase.MemberExpression = function (node, st, c) {\n c(node.object, st, \"Expression\");\n if (node.computed) { c(node.property, st, \"Expression\"); }\n};\nbase.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {\n if (node.declaration)\n { c(node.declaration, st, node.type === \"ExportNamedDeclaration\" || node.declaration.id ? \"Statement\" : \"Expression\"); }\n if (node.source) { c(node.source, st, \"Expression\"); }\n};\nbase.ExportAllDeclaration = function (node, st, c) {\n if (node.exported)\n { c(node.exported, st); }\n c(node.source, st, \"Expression\");\n};\nbase.ImportDeclaration = function (node, st, c) {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1)\n {\n var spec = list[i];\n\n c(spec, st);\n }\n c(node.source, st, \"Expression\");\n};\nbase.ImportExpression = function (node, st, c) {\n c(node.source, st, \"Expression\");\n};\nbase.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.PrivateIdentifier = base.Literal = ignore;\n\nbase.TaggedTemplateExpression = function (node, st, c) {\n c(node.tag, st, \"Expression\");\n c(node.quasi, st, \"Expression\");\n};\nbase.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, \"Class\"); };\nbase.Class = function (node, st, c) {\n if (node.id) { c(node.id, st, \"Pattern\"); }\n if (node.superClass) { c(node.superClass, st, \"Expression\"); }\n c(node.body, st);\n};\nbase.ClassBody = function (node, st, c) {\n for (var i = 0, list = node.body; i < list.length; i += 1)\n {\n var elt = list[i];\n\n c(elt, st);\n }\n};\nbase.MethodDefinition = base.PropertyDefinition = base.Property = function (node, st, c) {\n if (node.computed) { c(node.key, st, \"Expression\"); }\n if (node.value) { c(node.value, st, \"Expression\"); }\n};\n\nexport { ancestor, base, findNodeAfter, findNodeAround, findNodeAt, findNodeBefore, full, fullAncestor, make, recursive, simple };\n","export type tArrayExpression = 'ArrayExpression';\nexport type tArrayPattern = 'ArrayPattern';\nexport type tArrowFunctionExpression = 'ArrowFunctionExpression';\nexport type tAssignmentExpression = 'AssignmentExpression';\nexport type tAssignmentPattern = 'AssignmentPattern';\nexport type tAwaitExpression = 'AwaitExpression';\nexport type tBinaryExpression = 'BinaryExpression';\nexport type tBlockStatement = 'BlockStatement';\nexport type tBreakStatement = 'BreakStatement';\nexport type tCallExpression = 'CallExpression';\nexport type tCatchClause = 'CatchClause';\nexport type tChainExpression = 'ChainExpression';\nexport type tClassBody = 'ClassBody';\nexport type tClassDeclaration = 'ClassDeclaration';\nexport type tClassExpression = 'ClassExpression';\nexport type tConditionalExpression = 'ConditionalExpression';\nexport type tContinueStatement = 'ContinueStatement';\nexport type tDoWhileStatement = 'DoWhileStatement';\nexport type tEmptyStatement = 'EmptyStatement';\nexport type tExportAllDeclaration = 'ExportAllDeclaration';\nexport type tExportDefaultDeclaration = 'ExportDefaultDeclaration';\nexport type tExportNamedDeclaration = 'ExportNamedDeclaration';\nexport type tExportSpecifier = 'ExportSpecifier';\nexport type tExpressionStatement = 'ExpressionStatement';\nexport type tForStatement = 'ForStatement';\nexport type tForInStatement = 'ForInStatement';\nexport type tForOfStatement = 'ForOfStatement';\nexport type tFunctionDeclaration = 'FunctionDeclaration';\nexport type tFunctionExpression = 'FunctionExpression';\nexport type tIdentifier = 'Identifier';\nexport type tIfStatement = 'IfStatement';\nexport type tImport = 'Import';\nexport type tImportDeclaration = 'ImportDeclaration';\nexport type tImportExpression = 'ImportExpression';\nexport type tImportDefaultSpecifier = 'ImportDefaultSpecifier';\nexport type tImportNamespaceSpecifier = 'ImportNamespaceSpecifier';\nexport type tImportSpecifier = 'ImportSpecifier';\nexport type tLabeledStatement = 'LabeledStatement';\nexport type tLiteral = 'Literal';\nexport type tLogicalExpression = 'LogicalExpression';\nexport type tMemberExpression = 'MemberExpression';\nexport type tMetaProperty = 'MetaProperty';\nexport type tMethodDefinition = 'MethodDefinition';\nexport type tNewExpression = 'NewExpression';\nexport type tObjectExpression = 'ObjectExpression';\nexport type tObjectPattern = 'ObjectPattern';\nexport type tPrivateIdentifier = 'PrivateIdentifier';\nexport type tProgram = 'Program';\nexport type tProperty = 'Property';\nexport type tPropertyDefinition = 'PropertyDefinition';\nexport type tRestElement = 'RestElement';\nexport type tReturnStatement = 'ReturnStatement';\nexport type tSequenceExpression = 'SequenceExpression';\nexport type tSpreadElement = 'SpreadElement';\nexport type tStaticBlock = 'StaticBlock';\nexport type tSuper = 'Super';\nexport type tSwitchCase = 'SwitchCase';\nexport type tSwitchStatement = 'SwitchStatement';\nexport type tTaggedTemplateExpression = 'TaggedTemplateExpression';\nexport type tTemplateElement = 'TemplateElement';\nexport type tTemplateLiteral = 'TemplateLiteral';\nexport type tThisExpression = 'ThisExpression';\nexport type tThrowStatement = 'ThrowStatement';\nexport type tTryStatement = 'TryStatement';\nexport type tUnaryExpression = 'UnaryExpression';\nexport type tUpdateExpression = 'UpdateExpression';\nexport type tVariableDeclarator = 'VariableDeclarator';\nexport type tVariableDeclaration = 'VariableDeclaration';\nexport type tWhileStatement = 'WhileStatement';\nexport type tYieldExpression = 'YieldExpression';\n\nexport const ArrayExpression: tArrayExpression = 'ArrayExpression';\nexport const ArrayPattern: tArrayPattern = 'ArrayPattern';\nexport const ArrowFunctionExpression: tArrowFunctionExpression = 'ArrowFunctionExpression';\nexport const AssignmentExpression: tAssignmentExpression = 'AssignmentExpression';\nexport const AssignmentPattern: tAssignmentPattern = 'AssignmentPattern';\nexport const AwaitExpression: tAwaitExpression = 'AwaitExpression';\nexport const BinaryExpression: tBinaryExpression = 'BinaryExpression';\nexport const BlockStatement: tBlockStatement = 'BlockStatement';\nexport const BreakStatement: tBreakStatement = 'BreakStatement';\nexport const CallExpression: tCallExpression = 'CallExpression';\nexport const CatchClause: tCatchClause = 'CatchClause';\nexport const ChainExpression: tChainExpression = 'ChainExpression';\nexport const ClassBody: tClassBody = 'ClassBody';\nexport const ClassDeclaration: tClassDeclaration = 'ClassDeclaration';\nexport const ClassExpression: tClassExpression = 'ClassExpression';\nexport const ConditionalExpression: tConditionalExpression = 'ConditionalExpression';\nexport const ContinueStatement: tContinueStatement = 'ContinueStatement';\nexport const DoWhileStatement: tDoWhileStatement = 'DoWhileStatement';\nexport const EmptyStatement: tEmptyStatement = 'EmptyStatement';\nexport const ExportAllDeclaration: tExportAllDeclaration = 'ExportAllDeclaration';\nexport const ExportDefaultDeclaration: tExportDefaultDeclaration = 'ExportDefaultDeclaration';\nexport const ExportNamedDeclaration: tExportNamedDeclaration = 'ExportNamedDeclaration';\nexport const ExportSpecifier: tExportSpecifier = 'ExportSpecifier';\nexport const ExpressionStatement: tExpressionStatement = 'ExpressionStatement';\nexport const ForStatement: tForStatement = 'ForStatement';\nexport const ForInStatement: tForInStatement = 'ForInStatement';\nexport const ForOfStatement: tForOfStatement = 'ForOfStatement';\nexport const FunctionDeclaration: tFunctionDeclaration = 'FunctionDeclaration';\nexport const FunctionExpression: tFunctionExpression = 'FunctionExpression';\nexport const Identifier: tIdentifier = 'Identifier';\nexport const IfStatement: tIfStatement = 'IfStatement';\nexport const Import: tImport = 'Import';\nexport const ImportDeclaration: tImportDeclaration = 'ImportDeclaration';\nexport const ImportExpression: tImportExpression = 'ImportExpression';\nexport const ImportDefaultSpecifier: tImportDefaultSpecifier = 'ImportDefaultSpecifier';\nexport const ImportNamespaceSpecifier: tImportNamespaceSpecifier = 'ImportNamespaceSpecifier';\nexport const ImportSpecifier: tImportSpecifier = 'ImportSpecifier';\nexport const LabeledStatement: tLabeledStatement = 'LabeledStatement';\nexport const Literal: tLiteral = 'Literal';\nexport const LogicalExpression: tLogicalExpression = 'LogicalExpression';\nexport const MemberExpression: tMemberExpression = 'MemberExpression';\nexport const MetaProperty: tMetaProperty = 'MetaProperty';\nexport const MethodDefinition: tMethodDefinition = 'MethodDefinition';\nexport const NewExpression: tNewExpression = 'NewExpression';\nexport const ObjectExpression: tObjectExpression = 'ObjectExpression';\nexport const ObjectPattern: tObjectPattern = 'ObjectPattern';\nexport const PrivateIdentifier: tPrivateIdentifier = 'PrivateIdentifier';\nexport const Program: tProgram = 'Program';\nexport const Property: tProperty = 'Property';\nexport const PropertyDefinition: tPropertyDefinition = 'PropertyDefinition';\nexport const RestElement: tRestElement = 'RestElement';\nexport const ReturnStatement: tReturnStatement = 'ReturnStatement';\nexport const SequenceExpression: tSequenceExpression = 'SequenceExpression';\nexport const SpreadElement: tSpreadElement = 'SpreadElement';\nexport const StaticBlock: tStaticBlock = 'StaticBlock';\nexport const Super: tSuper = 'Super';\nexport const SwitchCase: tSwitchCase = 'SwitchCase';\nexport const SwitchStatement: tSwitchStatement = 'SwitchStatement';\nexport const TaggedTemplateExpression: tTaggedTemplateExpression = 'TaggedTemplateExpression';\nexport const TemplateElement: tTemplateElement = 'TemplateElement';\nexport const TemplateLiteral: tTemplateLiteral = 'TemplateLiteral';\nexport const ThisExpression: tThisExpression = 'ThisExpression';\nexport const ThrowStatement: tThrowStatement = 'ThrowStatement';\nexport const TryStatement: tTryStatement = 'TryStatement';\nexport const UnaryExpression: tUnaryExpression = 'UnaryExpression';\nexport const UpdateExpression: tUpdateExpression = 'UpdateExpression';\nexport const VariableDeclarator: tVariableDeclarator = 'VariableDeclarator';\nexport const VariableDeclaration: tVariableDeclaration = 'VariableDeclaration';\nexport const WhileStatement: tWhileStatement = 'WhileStatement';\nexport const YieldExpression: tYieldExpression = 'YieldExpression';\n","// this looks ridiculous, but it prevents sourcemap tooling from mistaking\n// this for an actual sourceMappingURL\nexport let SOURCEMAPPING_URL = 'sourceMa';\nSOURCEMAPPING_URL += 'ppingURL';\n\nconst whiteSpaceNoNewline =\n\t'[ \\\\f\\\\r\\\\t\\\\v\\\\u00a0\\\\u1680\\\\u2000-\\\\u200a\\\\u2028\\\\u2029\\\\u202f\\\\u205f\\\\u3000\\\\ufeff]';\n\nexport const SOURCEMAPPING_URL_RE = new RegExp(`^#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`);\n","import * as acorn from 'acorn';\nimport { base as basicWalker } from 'acorn-walk';\nimport {\n\tBinaryExpression,\n\tCallExpression,\n\tChainExpression,\n\tConditionalExpression,\n\tExpressionStatement,\n\tLogicalExpression,\n\tNewExpression,\n\tSequenceExpression\n} from '../ast/nodes/NodeType';\nimport { SOURCEMAPPING_URL_RE } from './sourceMappingURL';\n\ninterface CommentState {\n\tannotationIndex: number;\n\tannotations: acorn.Comment[];\n\tcode: string;\n}\n\nexport const ANNOTATION_KEY = '_rollupAnnotations';\nexport const INVALID_COMMENT_KEY = '_rollupRemoved';\n\ninterface NodeWithComments extends acorn.Node {\n\t[ANNOTATION_KEY]?: acorn.Comment[];\n\t[INVALID_COMMENT_KEY]?: acorn.Comment[];\n}\n\nfunction handlePureAnnotationsOfNode(\n\tnode: acorn.Node,\n\tstate: CommentState,\n\ttype = node.type\n): void {\n\tconst { annotations } = state;\n\tlet comment = annotations[state.annotationIndex];\n\twhile (comment && node.start >= comment.end) {\n\t\tmarkPureNode(node, comment, state.code);\n\t\tcomment = annotations[++state.annotationIndex];\n\t}\n\tif (comment && comment.end <= node.end) {\n\t\tbasicWalker[type](node, state, handlePureAnnotationsOfNode);\n\t\twhile ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) {\n\t\t\t++state.annotationIndex;\n\t\t\tannotateNode(node, comment, false);\n\t\t}\n\t}\n}\n\nconst neitherWithespaceNorBrackets = /[^\\s(]/g;\nconst noWhitespace = /\\S/g;\n\nfunction markPureNode(node: NodeWithComments, comment: acorn.Comment, code: string): void {\n\tconst annotatedNodes: NodeWithComments[] = [];\n\tlet invalidAnnotation: boolean | undefined;\n\tconst codeInBetween = code.slice(comment.end, node.start);\n\tif (doesNotMatchOutsideComment(codeInBetween, neitherWithespaceNorBrackets)) {\n\t\tconst parentStart = node.start;\n\t\twhile (true) {\n\t\t\tannotatedNodes.push(node);\n\t\t\tswitch (node.type) {\n\t\t\t\tcase ExpressionStatement:\n\t\t\t\tcase ChainExpression:\n\t\t\t\t\tnode = (node as any).expression;\n\t\t\t\t\tcontinue;\n\t\t\t\tcase SequenceExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).expressions[0];\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase ConditionalExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).test;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase LogicalExpression:\n\t\t\t\tcase BinaryExpression:\n\t\t\t\t\t// if there are parentheses, the annotation would apply to the entire expression\n\t\t\t\t\tif (doesNotMatchOutsideComment(code.slice(parentStart, node.start), noWhitespace)) {\n\t\t\t\t\t\tnode = (node as any).left;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CallExpression:\n\t\t\t\tcase NewExpression:\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tinvalidAnnotation = true;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t} else {\n\t\tinvalidAnnotation = true;\n\t}\n\tif (invalidAnnotation) {\n\t\tannotateNode(node, comment, false);\n\t} else {\n\t\tfor (const node of annotatedNodes) {\n\t\t\tannotateNode(node, comment, true);\n\t\t}\n\t}\n}\n\nfunction doesNotMatchOutsideComment(code: string, forbiddenChars: RegExp): boolean {\n\tlet nextMatch: RegExpExecArray | null;\n\twhile ((nextMatch = forbiddenChars.exec(code)) !== null) {\n\t\tif (nextMatch[0] === '/') {\n\t\t\tconst charCodeAfterSlash = code.charCodeAt(forbiddenChars.lastIndex);\n\t\t\tif (charCodeAfterSlash === 42 /*\"*\"*/) {\n\t\t\t\tforbiddenChars.lastIndex = code.indexOf('*/', forbiddenChars.lastIndex + 1) + 2;\n\t\t\t\tcontinue;\n\t\t\t} else if (charCodeAfterSlash === 47 /*\"/\"*/) {\n\t\t\t\tforbiddenChars.lastIndex = code.indexOf('\\n', forbiddenChars.lastIndex + 1) + 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tforbiddenChars.lastIndex = 0;\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nconst pureCommentRegex = /[@#]__PURE__/;\n\nexport function addAnnotations(\n\tcomments: readonly acorn.Comment[],\n\tesTreeAst: acorn.Node,\n\tcode: string\n): void {\n\tconst annotations: acorn.Comment[] = [];\n\tconst sourceMappingComments: acorn.Comment[] = [];\n\tfor (const comment of comments) {\n\t\tif (pureCommentRegex.test(comment.value)) {\n\t\t\tannotations.push(comment);\n\t\t} else if (SOURCEMAPPING_URL_RE.test(comment.value)) {\n\t\t\tsourceMappingComments.push(comment);\n\t\t}\n\t}\n\tfor (const comment of sourceMappingComments) {\n\t\tannotateNode(esTreeAst, comment, false);\n\t}\n\thandlePureAnnotationsOfNode(esTreeAst, {\n\t\tannotationIndex: 0,\n\t\tannotations,\n\t\tcode\n\t});\n}\n\nfunction annotateNode(node: NodeWithComments, comment: acorn.Comment, valid: boolean): void {\n\tconst key = valid ? ANNOTATION_KEY : INVALID_COMMENT_KEY;\n\tconst property = node[key];\n\tif (property) {\n\t\tproperty.push(comment);\n\t} else {\n\t\tnode[key] = [comment];\n\t}\n}\n","import type { GenericEsTreeNode } from './nodes/shared/Node';\n\nexport const keys: {\n\t[name: string]: string[];\n} = {\n\tLiteral: [],\n\tProgram: ['body']\n};\n\nexport function getAndCreateKeys(esTreeNode: GenericEsTreeNode): string[] {\n\tkeys[esTreeNode.type] = Object.keys(esTreeNode).filter(\n\t\tkey => typeof esTreeNode[key] === 'object' && key.charCodeAt(0) !== 95 /* _ */\n\t);\n\treturn keys[esTreeNode.type];\n}\n","import * as acorn from 'acorn';\nimport { locate, type Location } from 'locate-character';\nimport type MagicString from 'magic-string';\nimport type { AstContext } from '../../../Module';\nimport { ANNOTATION_KEY, INVALID_COMMENT_KEY } from '../../../utils/pureComments';\nimport type { NodeRenderOptions, RenderOptions } from '../../../utils/renderHelpers';\nimport type { Entity } from '../../Entity';\nimport {\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../../ExecutionContext';\nimport { INTERACTION_ASSIGNED, NodeInteractionAssigned } from '../../NodeInteractions';\nimport { getAndCreateKeys, keys } from '../../keys';\nimport type ChildScope from '../../scopes/ChildScope';\nimport { EMPTY_PATH, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport type Variable from '../../variables/Variable';\nimport * as NodeType from '../NodeType';\nimport { ExpressionEntity, InclusionOptions } from './Expression';\n\nexport interface GenericEsTreeNode extends acorn.Node {\n\t[key: string]: any;\n}\n\nexport const INCLUDE_PARAMETERS = 'variables' as const;\nexport type IncludeChildren = boolean | typeof INCLUDE_PARAMETERS;\n\nexport interface Node extends Entity {\n\tannotations?: acorn.Comment[];\n\tcontext: AstContext;\n\tend: number;\n\tesTreeNode: GenericEsTreeNode;\n\tincluded: boolean;\n\tkeys: string[];\n\tneedsBoundaries?: boolean;\n\tparent: Node | { type?: string };\n\tpreventChildBlockScope?: boolean;\n\tstart: number;\n\ttype: string;\n\tvariable?: Variable | null;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void;\n\n\t/**\n\t * Called once all nodes have been initialised and the scopes have been\n\t * populated.\n\t */\n\tbind(): void;\n\n\t/**\n\t * Determine if this Node would have an effect on the bundle. This is usually\n\t * true for already included nodes. Exceptions are e.g. break statements which\n\t * only have an effect if their surrounding loop or switch statement is\n\t * included.\n\t * The options pass on information like this about the current execution path.\n\t */\n\thasEffects(context: HasEffectsContext): boolean;\n\n\t/**\n\t * Special version of hasEffects for assignment left-hand sides which ensures\n\t * that accessor effects are checked as well. This is necessary to do from the\n\t * child so that member expressions can use the correct thisArg value.\n\t * setAssignedValue needs to be called during initialise to use this.\n\t */\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean;\n\n\t/**\n\t * Includes the node in the bundle. If the flag is not set, children are\n\t * usually included if they are necessary for this node (e.g. a function body)\n\t * or if they have effects. Necessary variables need to be included as well.\n\t */\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\toptions?: InclusionOptions\n\t): void;\n\n\t/**\n\t * Special version of include for assignment left-hand sides which ensures\n\t * that accessors are handled correctly. This is necessary to do from the\n\t * child so that member expressions can use the correct thisArg value.\n\t * setAssignedValue needs to be called during initialise to use this.\n\t */\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\tdeoptimizeAccess: boolean\n\t): void;\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void;\n\n\t/**\n\t * Sets the assigned value e.g. for assignment expression left. This must be\n\t * called during initialise in case hasEffects/includeAsAssignmentTarget are\n\t * used.\n\t */\n\tsetAssignedValue(value: ExpressionEntity): void;\n\n\t/**\n\t * Start a new execution path to determine if this node has an effect on the\n\t * bundle and should therefore be included. Included nodes should always be\n\t * included again in subsequent visits as the inclusion of additional\n\t * variables may require the inclusion of more child nodes in e.g. block\n\t * statements.\n\t */\n\tshouldBeIncluded(context: InclusionContext): boolean;\n}\n\nexport type StatementNode = Node;\n\nexport interface ExpressionNode extends ExpressionEntity, Node {}\n\nexport class NodeBase extends ExpressionEntity implements ExpressionNode {\n\tdeclare annotations?: acorn.Comment[];\n\tcontext: AstContext;\n\tdeclare end: number;\n\tesTreeNode: acorn.Node;\n\tkeys: string[];\n\tparent: Node | { context: AstContext; type: string };\n\tdeclare scope: ChildScope;\n\tdeclare start: number;\n\tdeclare type: keyof typeof NodeType;\n\t/**\n\t * This will be populated during initialise if setAssignedValue is called.\n\t */\n\tprotected declare assignmentInteraction: NodeInteractionAssigned;\n\t/**\n\t * Nodes can apply custom deoptimizations once they become part of the\n\t * executed code. To do this, they must initialize this as false, implement\n\t * applyDeoptimizations and call this from include and hasEffects if they have\n\t * custom handlers\n\t */\n\tprotected deoptimized = false;\n\n\tconstructor(\n\t\tesTreeNode: GenericEsTreeNode,\n\t\tparent: Node | { context: AstContext; type: string },\n\t\tparentScope: ChildScope\n\t) {\n\t\tsuper();\n\t\tthis.esTreeNode = esTreeNode;\n\t\tthis.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);\n\t\tthis.parent = parent;\n\t\tthis.context = parent.context;\n\t\tthis.createScope(parentScope);\n\t\tthis.parseNode(esTreeNode);\n\t\tthis.initialise();\n\t\tthis.context.magicString.addSourcemapLocation(this.start);\n\t\tthis.context.magicString.addSourcemapLocation(this.end);\n\t}\n\n\taddExportedVariables(\n\t\t_variables: readonly Variable[],\n\t\t_exportNamesByVariable: ReadonlyMap\n\t): void {}\n\n\t/**\n\t * Override this to bind assignments to variables and do any initialisations that\n\t * require the scopes to be populated with variables.\n\t */\n\tbind(): void {\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.bind();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.bind();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Override if this node should receive a different scope than the parent scope.\n\t */\n\tcreateScope(parentScope: ChildScope): void {\n\t\tthis.scope = parentScope;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tif (child?.hasEffects(context)) return true;\n\t\t\t\t}\n\t\t\t} else if (value.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, _checkAccess: boolean): boolean {\n\t\treturn (\n\t\t\tthis.hasEffects(context) ||\n\t\t\tthis.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)\n\t\t);\n\t}\n\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t_options?: InclusionOptions\n\t): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.include(context, includeChildrenRecursively);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t_deoptimizeAccess: boolean\n\t) {\n\t\tthis.include(context, includeChildrenRecursively);\n\t}\n\n\t/**\n\t * Override to perform special initialisation steps after the scope is initialised\n\t */\n\tinitialise(): void {}\n\n\tinsertSemicolon(code: MagicString): void {\n\t\tif (code.original[this.end - 1] !== ';') {\n\t\t\tcode.appendLeft(this.end, ';');\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tfor (const [key, value] of Object.entries(esTreeNode)) {\n\t\t\t// That way, we can override this function to add custom initialisation and then call super.parseNode\n\t\t\tif (this.hasOwnProperty(key)) continue;\n\t\t\tif (key.charCodeAt(0) === 95 /* _ */) {\n\t\t\t\tif (key === ANNOTATION_KEY) {\n\t\t\t\t\tthis.annotations = value;\n\t\t\t\t} else if (key === INVALID_COMMENT_KEY) {\n\t\t\t\t\tfor (const { start, end } of value as acorn.Comment[])\n\t\t\t\t\t\tthis.context.magicString.remove(start, end);\n\t\t\t\t}\n\t\t\t} else if (typeof value !== 'object' || value === null) {\n\t\t\t\t(this as GenericEsTreeNode)[key] = value;\n\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t(this as GenericEsTreeNode)[key] = [];\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\t(this as GenericEsTreeNode)[key].push(\n\t\t\t\t\t\tchild === null\n\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t: new (this.context.getNodeConstructor(child.type))(child, this, this.scope)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t(this as GenericEsTreeNode)[key] = new (this.context.getNodeConstructor(value.type))(\n\t\t\t\t\tvalue,\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.scope\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.render(code, options);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.render(code, options);\n\t\t\t}\n\t\t}\n\t}\n\n\tsetAssignedValue(value: ExpressionEntity): void {\n\t\tthis.assignmentInteraction = { args: [value], thisArg: null, type: INTERACTION_ASSIGNED };\n\t}\n\n\tshouldBeIncluded(context: InclusionContext): boolean {\n\t\treturn this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext()));\n\t}\n\n\t/**\n\t * Just deoptimize everything by default so that when e.g. we do not track\n\t * something properly, it is deoptimized.\n\t * @protected\n\t */\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const key of this.keys) {\n\t\t\tconst value = (this as GenericEsTreeNode)[key];\n\t\t\tif (value === null) continue;\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tfor (const child of value) {\n\t\t\t\t\tchild?.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvalue.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n\nexport { NodeBase as StatementBase };\n\nexport function locateNode(node: Node): Location & { file: string } {\n\tconst location = locate(node.context.code, node.start, { offsetLine: 1 }) as Location & {\n\t\tfile: string;\n\t};\n\tlocation.file = node.context.fileName;\n\tlocation.toString = () => JSON.stringify(location);\n\n\treturn location;\n}\n\nexport function logNode(node: Node): string {\n\treturn node.context.code.slice(node.start, node.end);\n}\n","import type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NODE_INTERACTION_UNKNOWN_ACCESS } from '../NodeInteractions';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH, UnknownKey } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class SpreadElement extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tSpreadElement;\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (path.length > 0) {\n\t\t\tthis.argument.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tinteraction,\n\t\t\t\t[UnknownKey, ...path],\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\treturn (\n\t\t\tthis.argument.hasEffects(context) ||\n\t\t\t(propertyReadSideEffects &&\n\t\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\t\tthis.argument.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\tUNKNOWN_PATH,\n\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\t\t\tcontext\n\t\t\t\t\t)))\n\t\t);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\t// Only properties of properties of the argument could become subject to reassignment\n\t\t// This will also reassign the return values of iterators\n\t\tthis.argument.deoptimizePath([UnknownKey, UnknownKey]);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_INTEGER_PATH } from '../../utils/PathTracker';\nimport {\n\tUNKNOWN_LITERAL_BOOLEAN,\n\tUNKNOWN_LITERAL_NUMBER,\n\tUNKNOWN_LITERAL_STRING\n} from '../../values';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression';\n\ntype MethodDescription = {\n\tcallsArgs: number[] | null;\n\tmutatesSelfAsArray: boolean | 'deopt-only';\n} & (\n\t| {\n\t\t\treturns: 'self' | (() => ExpressionEntity);\n\t\t\treturnsPrimitive: null;\n\t }\n\t| {\n\t\t\treturns: null;\n\t\t\treturnsPrimitive: ExpressionEntity;\n\t }\n);\n\nexport class Method extends ExpressionEntity {\n\tconstructor(private readonly description: MethodDescription) {\n\t\tsuper();\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\t{ type, thisArg }: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath\n\t): void {\n\t\tif (type === INTERACTION_CALLED && path.length === 0 && this.description.mutatesSelfAsArray) {\n\t\t\tthisArg.deoptimizePath(UNKNOWN_INTEGER_PATH);\n\t\t}\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\t{ thisArg }: NodeInteractionCalled\n\t): ExpressionEntity {\n\t\tif (path.length > 0) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn (\n\t\t\tthis.description.returnsPrimitive ||\n\t\t\t(this.description.returns === 'self'\n\t\t\t\t? thisArg || UNKNOWN_EXPRESSION\n\t\t\t\t: this.description.returns())\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst { type } = interaction;\n\t\tif (path.length > (type === INTERACTION_ACCESSED ? 1 : 0)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (type === INTERACTION_CALLED) {\n\t\t\tif (\n\t\t\t\tthis.description.mutatesSelfAsArray === true &&\n\t\t\t\tinteraction.thisArg?.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tUNKNOWN_INTEGER_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (this.description.callsArgs) {\n\t\t\t\tfor (const argIndex of this.description.callsArgs) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tinteraction.args[argIndex]?.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\t\t\tcontext\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport const METHOD_RETURNS_BOOLEAN = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_BOOLEAN\n\t})\n];\n\nexport const METHOD_RETURNS_STRING = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_STRING\n\t})\n];\n\nexport const METHOD_RETURNS_NUMBER = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nexport const METHOD_RETURNS_UNKNOWN = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: false,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n","import { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport {\n\tObjectPath,\n\tObjectPathKey,\n\tPathTracker,\n\tUNKNOWN_INTEGER_PATH,\n\tUNKNOWN_PATH,\n\tUnknownInteger,\n\tUnknownKey,\n\tUnknownNonAccessorKey\n} from '../../utils/PathTracker';\nimport {\n\tExpressionEntity,\n\tLiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownTruthyValue,\n\tUnknownValue\n} from './Expression';\n\nexport interface ObjectProperty {\n\tkey: ObjectPathKey;\n\tkind: 'init' | 'set' | 'get';\n\tproperty: ExpressionEntity;\n}\n\nexport interface PropertyMap {\n\t[key: string]: ExpressionEntity[];\n}\nconst INTEGER_REG_EXP = /^\\d+$/;\n\nexport class ObjectEntity extends ExpressionEntity {\n\tprivate readonly allProperties: ExpressionEntity[] = [];\n\tprivate readonly deoptimizedPaths: Record = Object.create(null);\n\tprivate readonly expressionsToBeDeoptimizedByKey: Record =\n\t\tObject.create(null);\n\tprivate readonly gettersByKey: PropertyMap = Object.create(null);\n\tprivate hasLostTrack = false;\n\tprivate hasUnknownDeoptimizedInteger = false;\n\tprivate hasUnknownDeoptimizedProperty = false;\n\tprivate readonly propertiesAndGettersByKey: PropertyMap = Object.create(null);\n\tprivate readonly propertiesAndSettersByKey: PropertyMap = Object.create(null);\n\tprivate readonly settersByKey: PropertyMap = Object.create(null);\n\tprivate readonly thisParametersToBeDeoptimized = new Set();\n\tprivate readonly unknownIntegerProps: ExpressionEntity[] = [];\n\tprivate readonly unmatchableGetters: ExpressionEntity[] = [];\n\tprivate readonly unmatchablePropertiesAndGetters: ExpressionEntity[] = [];\n\tprivate readonly unmatchableSetters: ExpressionEntity[] = [];\n\n\t// If a PropertyMap is used, this will be taken as propertiesAndGettersByKey\n\t// and we assume there are no setters or getters\n\tconstructor(\n\t\tproperties: ObjectProperty[] | PropertyMap,\n\t\tprivate prototypeExpression: ExpressionEntity | null,\n\t\tprivate immutable = false\n\t) {\n\t\tsuper();\n\t\tif (Array.isArray(properties)) {\n\t\t\tthis.buildPropertyMaps(properties);\n\t\t} else {\n\t\t\tthis.propertiesAndGettersByKey = this.propertiesAndSettersByKey = properties;\n\t\t\tfor (const propertiesForKey of Object.values(properties)) {\n\t\t\t\tthis.allProperties.push(...propertiesForKey);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizeAllProperties(noAccessors?: boolean): void {\n\t\tconst isDeoptimized = this.hasLostTrack || this.hasUnknownDeoptimizedProperty;\n\t\tif (noAccessors) {\n\t\t\tthis.hasUnknownDeoptimizedProperty = true;\n\t\t} else {\n\t\t\tthis.hasLostTrack = true;\n\t\t}\n\t\tif (isDeoptimized) {\n\t\t\treturn;\n\t\t}\n\t\tfor (const properties of Object.values(this.propertiesAndGettersByKey).concat(\n\t\t\tObject.values(this.settersByKey)\n\t\t)) {\n\t\t\tfor (const property of properties) {\n\t\t\t\tproperty.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\t// While the prototype itself cannot be mutated, each property can\n\t\tthis.prototypeExpression?.deoptimizePath([UnknownKey, UnknownKey]);\n\t\tthis.deoptimizeCachedEntities();\n\t}\n\n\tdeoptimizeIntegerProperties(): void {\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\tthis.hasUnknownDeoptimizedProperty ||\n\t\t\tthis.hasUnknownDeoptimizedInteger\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.hasUnknownDeoptimizedInteger = true;\n\t\tfor (const [key, propertiesAndGetters] of Object.entries(this.propertiesAndGettersByKey)) {\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const property of propertiesAndGetters) {\n\t\t\t\t\tproperty.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.deoptimizeCachedIntegerEntities();\n\t}\n\n\t// Assumption: If only a specific path is deoptimized, no accessors are created\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (this.hasLostTrack || this.immutable) {\n\t\t\treturn;\n\t\t}\n\t\tconst key = path[0];\n\t\tif (path.length === 1) {\n\t\t\tif (typeof key !== 'string') {\n\t\t\t\tif (key === UnknownInteger) {\n\t\t\t\t\treturn this.deoptimizeIntegerProperties();\n\t\t\t\t}\n\t\t\t\treturn this.deoptimizeAllProperties(key === UnknownNonAccessorKey);\n\t\t\t}\n\t\t\tif (!this.deoptimizedPaths[key]) {\n\t\t\t\tthis.deoptimizedPaths[key] = true;\n\n\t\t\t\t// we only deoptimizeCache exact matches as in all other cases,\n\t\t\t\t// we do not return a literal value or return expression\n\t\t\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimizedByKey[key];\n\t\t\t\tif (expressionsToBeDeoptimized) {\n\t\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);\n\t\tfor (const property of typeof key === 'string'\n\t\t\t? (this.propertiesAndGettersByKey[key] || this.unmatchablePropertiesAndGetters).concat(\n\t\t\t\t\tthis.settersByKey[key] || this.unmatchableSetters\n\t\t\t )\n\t\t\t: this.allProperties) {\n\t\t\tproperty.deoptimizePath(subPath);\n\t\t}\n\t\tthis.prototypeExpression?.deoptimizePath(path.length === 1 ? [...path, UnknownKey] : path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tconst [key, ...subPath] = path;\n\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\t// single paths that are deoptimized will not become getters or setters\n\t\t\t((interaction.type === INTERACTION_CALLED || path.length > 1) &&\n\t\t\t\t(this.hasUnknownDeoptimizedProperty ||\n\t\t\t\t\t(typeof key === 'string' && this.deoptimizedPaths[key])))\n\t\t) {\n\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\treturn;\n\t\t}\n\n\t\tconst [propertiesForExactMatchByKey, relevantPropertiesByKey, relevantUnmatchableProperties] =\n\t\t\tinteraction.type === INTERACTION_CALLED || path.length > 1\n\t\t\t\t? [\n\t\t\t\t\t\tthis.propertiesAndGettersByKey,\n\t\t\t\t\t\tthis.propertiesAndGettersByKey,\n\t\t\t\t\t\tthis.unmatchablePropertiesAndGetters\n\t\t\t\t ]\n\t\t\t\t: interaction.type === INTERACTION_ACCESSED\n\t\t\t\t? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]\n\t\t\t\t: [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];\n\n\t\tif (typeof key === 'string') {\n\t\t\tif (propertiesForExactMatchByKey[key]) {\n\t\t\t\tconst properties = relevantPropertiesByKey[key];\n\t\t\t\tif (properties) {\n\t\t\t\t\tfor (const property of properties) {\n\t\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!this.immutable) {\n\t\t\t\t\tthis.thisParametersToBeDeoptimized.add(interaction.thisArg);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (const property of relevantUnmatchableProperties) {\n\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t}\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const property of this.unknownIntegerProps) {\n\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const properties of Object.values(relevantPropertiesByKey).concat([\n\t\t\t\trelevantUnmatchableProperties\n\t\t\t])) {\n\t\t\t\tfor (const property of properties) {\n\t\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const property of this.unknownIntegerProps) {\n\t\t\t\tproperty.deoptimizeThisOnInteractionAtPath(interaction, subPath, recursionTracker);\n\t\t\t}\n\t\t}\n\t\tif (!this.immutable) {\n\t\t\tthis.thisParametersToBeDeoptimized.add(interaction.thisArg);\n\t\t}\n\t\tthis.prototypeExpression?.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length === 0) {\n\t\t\treturn UnknownTruthyValue;\n\t\t}\n\t\tconst key = path[0];\n\t\tconst expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin);\n\t\tif (expressionAtPath) {\n\t\t\treturn expressionAtPath.getLiteralValueAtPath(path.slice(1), recursionTracker, origin);\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t}\n\t\tif (path.length === 1) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (path.length === 0) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst [key, ...subPath] = path;\n\t\tconst expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin);\n\t\tif (expressionAtPath) {\n\t\t\treturn expressionAtPath.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tsubPath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst [key, ...subPath] = path;\n\t\tif (subPath.length || interaction.type === INTERACTION_CALLED) {\n\t\t\tconst expressionAtPath = this.getMemberExpression(key);\n\t\t\tif (expressionAtPath) {\n\t\t\t\treturn expressionAtPath.hasEffectsOnInteractionAtPath(subPath, interaction, context);\n\t\t\t}\n\t\t\tif (this.prototypeExpression) {\n\t\t\t\treturn this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tif (key === UnknownNonAccessorKey) return false;\n\t\tif (this.hasLostTrack) return true;\n\t\tconst [propertiesAndAccessorsByKey, accessorsByKey, unmatchableAccessors] =\n\t\t\tinteraction.type === INTERACTION_ACCESSED\n\t\t\t\t? [this.propertiesAndGettersByKey, this.gettersByKey, this.unmatchableGetters]\n\t\t\t\t: [this.propertiesAndSettersByKey, this.settersByKey, this.unmatchableSetters];\n\t\tif (typeof key === 'string') {\n\t\t\tif (propertiesAndAccessorsByKey[key]) {\n\t\t\t\tconst accessors = accessorsByKey[key];\n\t\t\t\tif (accessors) {\n\t\t\t\t\tfor (const accessor of accessors) {\n\t\t\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (const accessor of unmatchableAccessors) {\n\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (const accessors of Object.values(accessorsByKey).concat([unmatchableAccessors])) {\n\t\t\t\tfor (const accessor of accessors) {\n\t\t\t\t\tif (accessor.hasEffectsOnInteractionAtPath(subPath, interaction, context)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.prototypeExpression) {\n\t\t\treturn this.prototypeExpression.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate buildPropertyMaps(properties: readonly ObjectProperty[]): void {\n\t\tconst {\n\t\t\tallProperties,\n\t\t\tpropertiesAndGettersByKey,\n\t\t\tpropertiesAndSettersByKey,\n\t\t\tsettersByKey,\n\t\t\tgettersByKey,\n\t\t\tunknownIntegerProps,\n\t\t\tunmatchablePropertiesAndGetters,\n\t\t\tunmatchableGetters,\n\t\t\tunmatchableSetters\n\t\t} = this;\n\t\tconst unmatchablePropertiesAndSetters: ExpressionEntity[] = [];\n\t\tfor (let index = properties.length - 1; index >= 0; index--) {\n\t\t\tconst { key, kind, property } = properties[index];\n\t\t\tallProperties.push(property);\n\t\t\tif (typeof key !== 'string') {\n\t\t\t\tif (key === UnknownInteger) {\n\t\t\t\t\tunknownIntegerProps.push(property);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (kind === 'set') unmatchableSetters.push(property);\n\t\t\t\tif (kind === 'get') unmatchableGetters.push(property);\n\t\t\t\tif (kind !== 'get') unmatchablePropertiesAndSetters.push(property);\n\t\t\t\tif (kind !== 'set') unmatchablePropertiesAndGetters.push(property);\n\t\t\t} else {\n\t\t\t\tif (kind === 'set') {\n\t\t\t\t\tif (!propertiesAndSettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];\n\t\t\t\t\t\tsettersByKey[key] = [property, ...unmatchableSetters];\n\t\t\t\t\t}\n\t\t\t\t} else if (kind === 'get') {\n\t\t\t\t\tif (!propertiesAndGettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];\n\t\t\t\t\t\tgettersByKey[key] = [property, ...unmatchableGetters];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (!propertiesAndSettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndSettersByKey[key] = [property, ...unmatchablePropertiesAndSetters];\n\t\t\t\t\t}\n\t\t\t\t\tif (!propertiesAndGettersByKey[key]) {\n\t\t\t\t\t\tpropertiesAndGettersByKey[key] = [property, ...unmatchablePropertiesAndGetters];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate deoptimizeCachedEntities() {\n\t\tfor (const expressionsToBeDeoptimized of Object.values(this.expressionsToBeDeoptimizedByKey)) {\n\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t}\n\t\tfor (const expression of this.thisParametersToBeDeoptimized) {\n\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t}\n\n\tprivate deoptimizeCachedIntegerEntities() {\n\t\tfor (const [key, expressionsToBeDeoptimized] of Object.entries(\n\t\t\tthis.expressionsToBeDeoptimizedByKey\n\t\t)) {\n\t\t\tif (INTEGER_REG_EXP.test(key)) {\n\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const expression of this.thisParametersToBeDeoptimized) {\n\t\t\texpression.deoptimizePath(UNKNOWN_INTEGER_PATH);\n\t\t}\n\t}\n\n\tprivate getMemberExpression(key: ObjectPathKey): ExpressionEntity | null {\n\t\tif (\n\t\t\tthis.hasLostTrack ||\n\t\t\tthis.hasUnknownDeoptimizedProperty ||\n\t\t\ttypeof key !== 'string' ||\n\t\t\t(this.hasUnknownDeoptimizedInteger && INTEGER_REG_EXP.test(key)) ||\n\t\t\tthis.deoptimizedPaths[key]\n\t\t) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst properties = this.propertiesAndGettersByKey[key];\n\t\tif (properties?.length === 1) {\n\t\t\treturn properties[0];\n\t\t}\n\t\tif (\n\t\t\tproperties ||\n\t\t\tthis.unmatchablePropertiesAndGetters.length > 0 ||\n\t\t\t(this.unknownIntegerProps.length && INTEGER_REG_EXP.test(key))\n\t\t) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate getMemberExpressionAndTrackDeopt(\n\t\tkey: ObjectPathKey,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity | null {\n\t\tif (typeof key !== 'string') {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tconst expression = this.getMemberExpression(key);\n\t\tif (!(expression === UNKNOWN_EXPRESSION || this.immutable)) {\n\t\t\tconst expressionsToBeDeoptimized = (this.expressionsToBeDeoptimizedByKey[key] =\n\t\t\t\tthis.expressionsToBeDeoptimizedByKey[key] || []);\n\t\t\texpressionsToBeDeoptimized.push(origin);\n\t\t}\n\t\treturn expression;\n\t}\n}\n","import {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { ObjectPath, ObjectPathKey, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport { ExpressionEntity, LiteralValueOrUnknown, UnknownValue } from './Expression';\nimport {\n\tMETHOD_RETURNS_BOOLEAN,\n\tMETHOD_RETURNS_STRING,\n\tMETHOD_RETURNS_UNKNOWN\n} from './MethodTypes';\nimport { ObjectEntity, type PropertyMap } from './ObjectEntity';\n\nconst isInteger = (prop: ObjectPathKey): boolean => typeof prop === 'string' && /^\\d+$/.test(prop);\n\n// This makes sure unknown properties are not handled as \"undefined\" but as\n// \"unknown\" but without access side effects. An exception is done for numeric\n// properties as we do not expect new builtin properties to be numbers, this\n// will improve tree-shaking for out-of-bounds array properties\nconst OBJECT_PROTOTYPE_FALLBACK: ExpressionEntity =\n\tnew (class ObjectPrototypeFallbackExpression extends ExpressionEntity {\n\t\tdeoptimizeThisOnInteractionAtPath(\n\t\t\t{ type, thisArg }: NodeInteractionWithThisArg,\n\t\t\tpath: ObjectPath\n\t\t): void {\n\t\t\tif (type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) {\n\t\t\t\tthisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\n\t\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\t\t// We ignore number properties as we do not expect new properties to be\n\t\t\t// numbers and also want to keep handling out-of-bound array elements as\n\t\t\t// \"undefined\"\n\t\t\treturn path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue;\n\t\t}\n\n\t\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\t\treturn path.length > 1 || type === INTERACTION_CALLED;\n\t\t}\n\t})();\n\nexport const OBJECT_PROTOTYPE = new ObjectEntity(\n\t{\n\t\t__proto__: null,\n\t\thasOwnProperty: METHOD_RETURNS_BOOLEAN,\n\t\tisPrototypeOf: METHOD_RETURNS_BOOLEAN,\n\t\tpropertyIsEnumerable: METHOD_RETURNS_BOOLEAN,\n\t\ttoLocaleString: METHOD_RETURNS_STRING,\n\t\ttoString: METHOD_RETURNS_STRING,\n\t\tvalueOf: METHOD_RETURNS_UNKNOWN\n\t} as unknown as PropertyMap,\n\tOBJECT_PROTOTYPE_FALLBACK,\n\ttrue\n);\n","import { UnknownInteger } from '../../utils/PathTracker';\nimport { UNKNOWN_LITERAL_BOOLEAN, UNKNOWN_LITERAL_NUMBER } from '../../values';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './Expression';\nimport {\n\tMethod,\n\tMETHOD_RETURNS_BOOLEAN,\n\tMETHOD_RETURNS_NUMBER,\n\tMETHOD_RETURNS_STRING,\n\tMETHOD_RETURNS_UNKNOWN\n} from './MethodTypes';\nimport { ObjectEntity, type ObjectProperty, type PropertyMap } from './ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\n\nconst NEW_ARRAY_PROPERTIES: ObjectProperty[] = [\n\t{ key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION },\n\t{ key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER }\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_BOOLEAN\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: () => new ObjectEntity(NEW_ARRAY_PROPERTIES, ARRAY_PROTOTYPE),\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_NUMBER: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_LITERAL_NUMBER\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: 'deopt-only',\n\t\treturns: null,\n\t\treturnsPrimitive: UNKNOWN_EXPRESSION\n\t})\n];\n\nconst METHOD_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: null,\n\t\tmutatesSelfAsArray: true,\n\t\treturns: 'self',\n\t\treturnsPrimitive: null\n\t})\n];\n\nconst METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF: [ExpressionEntity] = [\n\tnew Method({\n\t\tcallsArgs: [0],\n\t\tmutatesSelfAsArray: true,\n\t\treturns: 'self',\n\t\treturnsPrimitive: null\n\t})\n];\n\nexport const ARRAY_PROTOTYPE = new ObjectEntity(\n\t{\n\t\t__proto__: null,\n\t\t// We assume that accessors have effects as we do not track the accessed value afterwards\n\t\tat: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tconcat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tcopyWithin: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tentries: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tevery: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,\n\t\tfill: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tfilter: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tfind: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tfindIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,\n\t\tfindLast: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tfindLastIndex: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NUMBER,\n\t\tflat: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tflatMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tforEach: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tgroup: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tgroupToMap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\tincludes: METHOD_RETURNS_BOOLEAN,\n\t\tindexOf: METHOD_RETURNS_NUMBER,\n\t\tjoin: METHOD_RETURNS_STRING,\n\t\tkeys: METHOD_RETURNS_UNKNOWN,\n\t\tlastIndexOf: METHOD_RETURNS_NUMBER,\n\t\tmap: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tpop: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,\n\t\tpush: METHOD_MUTATES_SELF_RETURNS_NUMBER,\n\t\treduce: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\treduceRight: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_UNKNOWN,\n\t\treverse: METHOD_MUTATES_SELF_RETURNS_SELF,\n\t\tshift: METHOD_MUTATES_SELF_RETURNS_UNKNOWN,\n\t\tslice: METHOD_DEOPTS_SELF_RETURNS_NEW_ARRAY,\n\t\tsome: METHOD_CALLS_ARG_DEOPTS_SELF_RETURNS_BOOLEAN,\n\t\tsort: METHOD_CALLS_ARG_MUTATES_SELF_RETURNS_SELF,\n\t\tsplice: METHOD_MUTATES_SELF_RETURNS_NEW_ARRAY,\n\t\ttoLocaleString: METHOD_RETURNS_STRING,\n\t\ttoString: METHOD_RETURNS_STRING,\n\t\tunshift: METHOD_MUTATES_SELF_RETURNS_NUMBER,\n\t\tvalues: METHOD_DEOPTS_SELF_RETURNS_UNKNOWN\n\t} as unknown as PropertyMap,\n\tOBJECT_PROTOTYPE,\n\ttrue\n);\n","import Module, { AstContext } from '../../Module';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { createInclusionContext, HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionCalled, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport type Identifier from '../nodes/Identifier';\nimport * as NodeType from '../nodes/NodeType';\nimport type SpreadElement from '../nodes/SpreadElement';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from '../nodes/shared/Expression';\nimport type { Node } from '../nodes/shared/Node';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class LocalVariable extends Variable {\n\tcalledFromTryStatement = false;\n\treadonly declarations: (Identifier | ExportDefaultDeclaration)[];\n\tinit: ExpressionEntity | null;\n\treadonly module: Module;\n\n\t// Caching and deoptimization:\n\t// We track deoptimization when we do not return something unknown\n\tprotected deoptimizationTracker: PathTracker;\n\tprivate additionalInitializers: ExpressionEntity[] | null = null;\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\n\tconstructor(\n\t\tname: string,\n\t\tdeclarator: Identifier | ExportDefaultDeclaration | null,\n\t\tinit: ExpressionEntity | null,\n\t\tcontext: AstContext\n\t) {\n\t\tsuper(name);\n\t\tthis.declarations = declarator ? [declarator] : [];\n\t\tthis.init = init;\n\t\tthis.deoptimizationTracker = context.deoptimizationTracker;\n\t\tthis.module = context.module;\n\t}\n\n\taddDeclaration(identifier: Identifier, init: ExpressionEntity | null): void {\n\t\tthis.declarations.push(identifier);\n\t\tconst additionalInitializers = this.markInitializersForDeoptimization();\n\t\tif (init !== null) {\n\t\t\tadditionalInitializers.push(init);\n\t\t}\n\t}\n\n\tconsolidateInitializers(): void {\n\t\tif (this.additionalInitializers !== null) {\n\t\t\tfor (const initializer of this.additionalInitializers) {\n\t\t\t\tinitializer.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t\tthis.additionalInitializers = null;\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tthis.isReassigned ||\n\t\t\tthis.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tif (path.length === 0) {\n\t\t\tif (!this.isReassigned) {\n\t\t\t\tthis.isReassigned = true;\n\t\t\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;\n\t\t\t\tthis.expressionsToBeDeoptimized = [];\n\t\t\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\t\t\texpression.deoptimizeCache();\n\t\t\t\t}\n\t\t\t\tthis.init?.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.init?.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn interaction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\trecursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => this.init!.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker),\n\t\t\tundefined\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => {\n\t\t\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\t\t\treturn this.init!.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t\t},\n\t\t\tUnknownValue\n\t\t);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (this.isReassigned || !this.init) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\tthis.init,\n\t\t\t() => {\n\t\t\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\t\t\treturn this.init!.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t);\n\t\t\t},\n\t\t\tUNKNOWN_EXPRESSION\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!context.accessed.trackEntityAtPathAndGetIfTracked(path, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\tif (this.included) return true;\n\t\t\t\tif (path.length === 0) return false;\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!context.assigned.trackEntityAtPathAndGetIfTracked(path, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\tif (this.isReassigned) return true;\n\t\t\t\treturn (this.init &&\n\t\t\t\t\t!(\n\t\t\t\t\t\tinteraction.withNew ? context.instantiated : context.called\n\t\t\t\t\t).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) &&\n\t\t\t\t\tthis.init.hasEffectsOnInteractionAtPath(path, interaction, context))!;\n\t\t}\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tfor (const declaration of this.declarations) {\n\t\t\t\t// If node is a default export, it can save a tree-shaking run to include the full declaration now\n\t\t\t\tif (!declaration.included) declaration.include(createInclusionContext(), false);\n\t\t\t\tlet node = declaration.parent as Node;\n\t\t\t\twhile (!node.included) {\n\t\t\t\t\t// We do not want to properly include parents in case they are part of a dead branch\n\t\t\t\t\t// in which case .include() might pull in more dead code\n\t\t\t\t\tnode.included = true;\n\t\t\t\t\tif (node.type === NodeType.Program) break;\n\t\t\t\t\tnode = node.parent as Node;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tif (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {\n\t\t\tfor (const arg of args) {\n\t\t\t\targ.include(context, false);\n\t\t\t}\n\t\t} else if (this.init) {\n\t\t\tcontext.includedCallArguments.add(this.init);\n\t\t\tthis.init.includeCallArguments(context, args);\n\t\t\tcontext.includedCallArguments.delete(this.init);\n\t\t}\n\t}\n\n\tmarkCalledFromTryStatement(): void {\n\t\tthis.calledFromTryStatement = true;\n\t}\n\n\tmarkInitializersForDeoptimization(): ExpressionEntity[] {\n\t\tif (this.additionalInitializers === null) {\n\t\t\tthis.additionalInitializers = this.init === null ? [] : [this.init];\n\t\t\tthis.init = UNKNOWN_EXPRESSION;\n\t\t\tthis.isReassigned = true;\n\t\t}\n\t\treturn this.additionalInitializers;\n\t}\n}\n","const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';\nconst base = 64;\n\nexport function toBase64(num: number): string {\n\tlet outStr = '';\n\tdo {\n\t\tconst curDigit = num % base;\n\t\tnum = Math.floor(num / base);\n\t\toutStr = chars[curDigit] + outStr;\n\t} while (num !== 0);\n\treturn outStr;\n}\n","import RESERVED_NAMES from './RESERVED_NAMES';\nimport { toBase64 } from './base64';\n\nexport function getSafeName(baseName: string, usedNames: Set): string {\n\tlet safeName = baseName;\n\tlet count = 1;\n\twhile (usedNames.has(safeName) || RESERVED_NAMES.has(safeName)) {\n\t\tsafeName = `${baseName}$${toBase64(count++)}`;\n\t}\n\tusedNames.add(safeName);\n\treturn safeName;\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type ChildScope from './ChildScope';\n\nexport default class Scope {\n\tchildren: ChildScope[] = [];\n\tvariables = new Map();\n\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\t_isHoisted: boolean\n\t): LocalVariable {\n\t\tconst name = identifier.name;\n\t\tlet variable = this.variables.get(name) as LocalVariable;\n\t\tif (variable) {\n\t\t\tvariable.addDeclaration(identifier, init);\n\t\t} else {\n\t\t\tvariable = new LocalVariable(\n\t\t\t\tidentifier.name,\n\t\t\t\tidentifier,\n\t\t\t\tinit || UNDEFINED_EXPRESSION,\n\t\t\t\tcontext\n\t\t\t);\n\t\t\tthis.variables.set(name, variable);\n\t\t}\n\t\treturn variable;\n\t}\n\n\tcontains(name: string): boolean {\n\t\treturn this.variables.has(name);\n\t}\n\n\tfindVariable(_name: string): Variable {\n\t\tthrow new Error('Internal Error: findVariable needs to be implemented by a subclass');\n\t}\n}\n","import type { InternalModuleFormat } from '../../rollup/types';\nimport { getSafeName } from '../../utils/safeName';\nimport type ImportExpression from '../nodes/ImportExpression';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type Variable from '../variables/Variable';\nimport Scope from './Scope';\n\nexport default class ChildScope extends Scope {\n\treadonly accessedOutsideVariables = new Map();\n\tparent: Scope;\n\tprivate declare accessedDynamicImports?: Set;\n\n\tconstructor(parent: Scope) {\n\t\tsuper();\n\t\tthis.parent = parent;\n\t\tparent.children.push(this);\n\t}\n\n\taddAccessedDynamicImport(importExpression: ImportExpression): void {\n\t\t(this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(\n\t\t\timportExpression\n\t\t);\n\t\tif (this.parent instanceof ChildScope) {\n\t\t\tthis.parent.addAccessedDynamicImport(importExpression);\n\t\t}\n\t}\n\n\taddAccessedGlobals(\n\t\tglobals: readonly string[],\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst accessedGlobals = accessedGlobalsByScope.get(this) || new Set();\n\t\tfor (const name of globals) {\n\t\t\taccessedGlobals.add(name);\n\t\t}\n\t\taccessedGlobalsByScope.set(this, accessedGlobals);\n\t\tif (this.parent instanceof ChildScope) {\n\t\t\tthis.parent.addAccessedGlobals(globals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\taddNamespaceMemberAccess(name: string, variable: Variable): void {\n\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\t(this.parent as ChildScope).addNamespaceMemberAccess(name, variable);\n\t}\n\n\taddReturnExpression(expression: ExpressionEntity): void {\n\t\tthis.parent instanceof ChildScope && this.parent.addReturnExpression(expression);\n\t}\n\n\taddUsedOutsideNames(\n\t\tusedNames: Set,\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\tfor (const variable of this.accessedOutsideVariables.values()) {\n\t\t\tif (variable.included) {\n\t\t\t\tusedNames.add(variable.getBaseVariableName());\n\t\t\t\tif (format === 'system' && exportNamesByVariable.has(variable)) {\n\t\t\t\t\tusedNames.add('exports');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst accessedGlobals = accessedGlobalsByScope.get(this);\n\t\tif (accessedGlobals) {\n\t\t\tfor (const name of accessedGlobals) {\n\t\t\t\tusedNames.add(name);\n\t\t\t}\n\t\t}\n\t}\n\n\tcontains(name: string): boolean {\n\t\treturn this.variables.has(name) || this.parent.contains(name);\n\t}\n\n\tdeconflict(\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\tconst usedNames = new Set();\n\t\tthis.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);\n\t\tif (this.accessedDynamicImports) {\n\t\t\tfor (const importExpression of this.accessedDynamicImports) {\n\t\t\t\tif (importExpression.inlineNamespace) {\n\t\t\t\t\tusedNames.add(importExpression.inlineNamespace.getBaseVariableName());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const [name, variable] of this.variables) {\n\t\t\tif (variable.included || variable.alwaysRendered) {\n\t\t\t\tvariable.setRenderNames(null, getSafeName(name, usedNames));\n\t\t\t}\n\t\t}\n\t\tfor (const scope of this.children) {\n\t\t\tscope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn (this.parent as ChildScope).findLexicalBoundary();\n\t}\n\n\tfindVariable(name: string): Variable {\n\t\tconst knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);\n\t\tif (knownVariable) {\n\t\t\treturn knownVariable;\n\t\t}\n\t\tconst variable = this.parent.findVariable(name);\n\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\treturn variable;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type Identifier from '../nodes/Identifier';\nimport SpreadElement from '../nodes/SpreadElement';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport LocalVariable from '../variables/LocalVariable';\nimport ChildScope from './ChildScope';\nimport type Scope from './Scope';\n\nexport default class ParameterScope extends ChildScope {\n\treadonly hoistedBodyVarScope: ChildScope;\n\n\tprotected parameters: readonly LocalVariable[][] = [];\n\tprivate context: AstContext;\n\tprivate hasRest = false;\n\n\tconstructor(parent: Scope, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.context = context;\n\t\tthis.hoistedBodyVarScope = new ChildScope(this);\n\t}\n\n\t/**\n\t * Adds a parameter to this scope. Parameters must be added in the correct\n\t * order, e.g. from left to right.\n\t */\n\taddParameterDeclaration(identifier: Identifier): LocalVariable {\n\t\tconst name = identifier.name;\n\t\tlet variable = this.hoistedBodyVarScope.variables.get(name) as LocalVariable;\n\t\tif (variable) {\n\t\t\tvariable.addDeclaration(identifier, null);\n\t\t} else {\n\t\t\tvariable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context);\n\t\t}\n\t\tthis.variables.set(name, variable);\n\t\treturn variable;\n\t}\n\n\taddParameterVariables(parameters: LocalVariable[][], hasRest: boolean): void {\n\t\tthis.parameters = parameters;\n\t\tfor (const parameterList of parameters) {\n\t\t\tfor (const parameter of parameterList) {\n\t\t\t\tparameter.alwaysRendered = true;\n\t\t\t}\n\t\t}\n\t\tthis.hasRest = hasRest;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tlet calledFromTryStatement = false;\n\t\tlet argIncluded = false;\n\t\tconst restParam = this.hasRest && this.parameters[this.parameters.length - 1];\n\t\tfor (const checkedArg of args) {\n\t\t\tif (checkedArg instanceof SpreadElement) {\n\t\t\t\tfor (const arg of args) {\n\t\t\t\t\targ.include(context, false);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfor (let index = args.length - 1; index >= 0; index--) {\n\t\t\tconst paramVars = this.parameters[index] || restParam;\n\t\t\tconst arg = args[index];\n\t\t\tif (paramVars) {\n\t\t\t\tcalledFromTryStatement = false;\n\t\t\t\tif (paramVars.length === 0) {\n\t\t\t\t\t// handle empty destructuring\n\t\t\t\t\targIncluded = true;\n\t\t\t\t} else {\n\t\t\t\t\tfor (const variable of paramVars) {\n\t\t\t\t\t\tif (variable.included) {\n\t\t\t\t\t\t\targIncluded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (variable.calledFromTryStatement) {\n\t\t\t\t\t\t\tcalledFromTryStatement = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!argIncluded && arg.shouldBeIncluded(context)) {\n\t\t\t\targIncluded = true;\n\t\t\t}\n\t\t\tif (argIncluded) {\n\t\t\t\targ.include(context, calledFromTryStatement);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport { UNKNOWN_PATH } from '../utils/PathTracker';\nimport ParameterScope from './ParameterScope';\n\nexport default class ReturnValueScope extends ParameterScope {\n\tprivate returnExpression: ExpressionEntity | null = null;\n\tprivate returnExpressions: ExpressionEntity[] = [];\n\n\taddReturnExpression(expression: ExpressionEntity): void {\n\t\tthis.returnExpressions.push(expression);\n\t}\n\n\tgetReturnExpression(): ExpressionEntity {\n\t\tif (this.returnExpression === null) this.updateReturnExpression();\n\t\treturn this.returnExpression!;\n\t}\n\n\tprivate updateReturnExpression() {\n\t\tif (this.returnExpressions.length === 1) {\n\t\t\tthis.returnExpression = this.returnExpressions[0];\n\t\t} else {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\tfor (const expression of this.returnExpressions) {\n\t\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n}\n","//@ts-check\n/** @typedef { import('estree').Node} Node */\n/** @typedef {Node | {\n * type: 'PropertyDefinition';\n * computed: boolean;\n * value: Node\n * }} NodeWithPropertyDefinition */\n\n/**\n *\n * @param {NodeWithPropertyDefinition} node\n * @param {NodeWithPropertyDefinition} parent\n * @returns boolean\n */\nexport default function is_reference (node, parent) {\n\tif (node.type === 'MemberExpression') {\n\t\treturn !node.computed && is_reference(node.object, node);\n\t}\n\n\tif (node.type === 'Identifier') {\n\t\tif (!parent) return true;\n\n\t\tswitch (parent.type) {\n\t\t\t// disregard `bar` in `foo.bar`\n\t\t\tcase 'MemberExpression': return parent.computed || node === parent.object;\n\n\t\t\t// disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`\n\t\t\tcase 'MethodDefinition': return parent.computed;\n\n\t\t\t// disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`\n\t\t\tcase 'PropertyDefinition': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`\n\t\t\tcase 'Property': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `export { foo as bar }` or\n\t\t\t// the foo in `import { foo as bar }`\n\t\t\tcase 'ExportSpecifier':\n\t\t\tcase 'ImportSpecifier': return node === parent.local;\n\n\t\t\t// disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`\n\t\t\tcase 'LabeledStatement':\n\t\t\tcase 'BreakStatement':\n\t\t\tcase 'ContinueStatement': return false;\n\t\t\tdefault: return true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/* eslint sort-keys: \"off\" */\n\nimport { HasEffectsContext } from '../../ExecutionContext';\nimport { NODE_INTERACTION_UNKNOWN_ASSIGNMENT, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath } from '../../utils/PathTracker';\nimport { UNKNOWN_NON_ACCESSOR_PATH } from '../../utils/PathTracker';\n\nconst ValueProperties = Symbol('Value Properties');\n\ninterface ValueDescription {\n\thasEffectsWhenCalled(interaction: NodeInteractionCalled, context: HasEffectsContext): boolean;\n}\n\ninterface GlobalDescription {\n\t[pathKey: string]: GlobalDescription | null;\n\t[ValueProperties]: ValueDescription;\n\t__proto__: null;\n}\n\nconst PURE: ValueDescription = {\n\thasEffectsWhenCalled() {\n\t\treturn false;\n\t}\n};\n\nconst IMPURE: ValueDescription = {\n\thasEffectsWhenCalled() {\n\t\treturn true;\n\t}\n};\n\n// We use shortened variables to reduce file size here\n/* OBJECT */\nconst O: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: IMPURE\n};\n\n/* PURE FUNCTION */\nconst PF: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE\n};\n\n/* FUNCTION THAT MUTATES FIRST ARG WITHOUT TRIGGERING ACCESSORS */\nconst MUTATES_ARG_WITHOUT_ACCESSOR: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: {\n\t\thasEffectsWhenCalled({ args }, context) {\n\t\t\treturn (\n\t\t\t\t!args.length ||\n\t\t\t\targs[0].hasEffectsOnInteractionAtPath(\n\t\t\t\t\tUNKNOWN_NON_ACCESSOR_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n};\n\n/* CONSTRUCTOR */\nconst C: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: IMPURE,\n\tprototype: O\n};\n\n/* PURE CONSTRUCTOR */\nconst PC: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tprototype: O\n};\n\nconst ARRAY_TYPE: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tfrom: PF,\n\tof: PF,\n\tprototype: O\n};\n\nconst INTL_MEMBER: GlobalDescription = {\n\t__proto__: null,\n\t[ValueProperties]: PURE,\n\tsupportedLocalesOf: PC\n};\n\nconst knownGlobals: GlobalDescription = {\n\t// Placeholders for global objects to avoid shape mutations\n\tglobal: O,\n\tglobalThis: O,\n\tself: O,\n\twindow: O,\n\n\t// Common globals\n\t__proto__: null,\n\t[ValueProperties]: IMPURE,\n\tArray: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tfrom: O,\n\t\tisArray: PF,\n\t\tof: PF,\n\t\tprototype: O\n\t},\n\tArrayBuffer: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tisView: PF,\n\t\tprototype: O\n\t},\n\tAtomics: O,\n\tBigInt: C,\n\tBigInt64Array: C,\n\tBigUint64Array: C,\n\tBoolean: PC,\n\tconstructor: C,\n\tDataView: PC,\n\tDate: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tnow: PF,\n\t\tparse: PF,\n\t\tprototype: O,\n\t\tUTC: PF\n\t},\n\tdecodeURI: PF,\n\tdecodeURIComponent: PF,\n\tencodeURI: PF,\n\tencodeURIComponent: PF,\n\tError: PC,\n\tescape: PF,\n\teval: O,\n\tEvalError: PC,\n\tFloat32Array: ARRAY_TYPE,\n\tFloat64Array: ARRAY_TYPE,\n\tFunction: C,\n\thasOwnProperty: O,\n\tInfinity: O,\n\tInt16Array: ARRAY_TYPE,\n\tInt32Array: ARRAY_TYPE,\n\tInt8Array: ARRAY_TYPE,\n\tisFinite: PF,\n\tisNaN: PF,\n\tisPrototypeOf: O,\n\tJSON: O,\n\tMap: PC,\n\tMath: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tabs: PF,\n\t\tacos: PF,\n\t\tacosh: PF,\n\t\tasin: PF,\n\t\tasinh: PF,\n\t\tatan: PF,\n\t\tatan2: PF,\n\t\tatanh: PF,\n\t\tcbrt: PF,\n\t\tceil: PF,\n\t\tclz32: PF,\n\t\tcos: PF,\n\t\tcosh: PF,\n\t\texp: PF,\n\t\texpm1: PF,\n\t\tfloor: PF,\n\t\tfround: PF,\n\t\thypot: PF,\n\t\timul: PF,\n\t\tlog: PF,\n\t\tlog10: PF,\n\t\tlog1p: PF,\n\t\tlog2: PF,\n\t\tmax: PF,\n\t\tmin: PF,\n\t\tpow: PF,\n\t\trandom: PF,\n\t\tround: PF,\n\t\tsign: PF,\n\t\tsin: PF,\n\t\tsinh: PF,\n\t\tsqrt: PF,\n\t\ttan: PF,\n\t\ttanh: PF,\n\t\ttrunc: PF\n\t},\n\tNaN: O,\n\tNumber: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tisFinite: PF,\n\t\tisInteger: PF,\n\t\tisNaN: PF,\n\t\tisSafeInteger: PF,\n\t\tparseFloat: PF,\n\t\tparseInt: PF,\n\t\tprototype: O\n\t},\n\tObject: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tcreate: PF,\n\t\t// Technically those can throw in certain situations, but we ignore this as\n\t\t// code that relies on this will hopefully wrap this in a try-catch, which\n\t\t// deoptimizes everything anyway\n\t\tdefineProperty: MUTATES_ARG_WITHOUT_ACCESSOR,\n\t\tdefineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,\n\t\tgetOwnPropertyDescriptor: PF,\n\t\tgetOwnPropertyNames: PF,\n\t\tgetOwnPropertySymbols: PF,\n\t\tgetPrototypeOf: PF,\n\t\thasOwn: PF,\n\t\tis: PF,\n\t\tisExtensible: PF,\n\t\tisFrozen: PF,\n\t\tisSealed: PF,\n\t\tkeys: PF,\n\t\tfromEntries: PF,\n\t\tentries: PF,\n\t\tprototype: O\n\t},\n\tparseFloat: PF,\n\tparseInt: PF,\n\tPromise: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tall: O,\n\t\tprototype: O,\n\t\trace: O,\n\t\treject: O,\n\t\tresolve: O\n\t},\n\tpropertyIsEnumerable: O,\n\tProxy: O,\n\tRangeError: PC,\n\tReferenceError: PC,\n\tReflect: O,\n\tRegExp: PC,\n\tSet: PC,\n\tSharedArrayBuffer: C,\n\tString: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tfromCharCode: PF,\n\t\tfromCodePoint: PF,\n\t\tprototype: O,\n\t\traw: PF\n\t},\n\tSymbol: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: PURE,\n\t\tfor: PF,\n\t\tkeyFor: PF,\n\t\tprototype: O\n\t},\n\tSyntaxError: PC,\n\ttoLocaleString: O,\n\ttoString: O,\n\tTypeError: PC,\n\tUint16Array: ARRAY_TYPE,\n\tUint32Array: ARRAY_TYPE,\n\tUint8Array: ARRAY_TYPE,\n\tUint8ClampedArray: ARRAY_TYPE,\n\t// Technically, this is a global, but it needs special handling\n\t// undefined: ?,\n\tunescape: PF,\n\tURIError: PC,\n\tvalueOf: O,\n\tWeakMap: PC,\n\tWeakSet: PC,\n\n\t// Additional globals shared by Node and Browser that are not strictly part of the language\n\tclearInterval: C,\n\tclearTimeout: C,\n\tconsole: O,\n\tIntl: {\n\t\t__proto__: null,\n\t\t[ValueProperties]: IMPURE,\n\t\tCollator: INTL_MEMBER,\n\t\tDateTimeFormat: INTL_MEMBER,\n\t\tListFormat: INTL_MEMBER,\n\t\tNumberFormat: INTL_MEMBER,\n\t\tPluralRules: INTL_MEMBER,\n\t\tRelativeTimeFormat: INTL_MEMBER\n\t},\n\tsetInterval: C,\n\tsetTimeout: C,\n\tTextDecoder: C,\n\tTextEncoder: C,\n\tURL: C,\n\tURLSearchParams: C,\n\n\t// Browser specific globals\n\tAbortController: C,\n\tAbortSignal: C,\n\taddEventListener: O,\n\talert: O,\n\tAnalyserNode: C,\n\tAnimation: C,\n\tAnimationEvent: C,\n\tapplicationCache: O,\n\tApplicationCache: C,\n\tApplicationCacheErrorEvent: C,\n\tatob: O,\n\tAttr: C,\n\tAudio: C,\n\tAudioBuffer: C,\n\tAudioBufferSourceNode: C,\n\tAudioContext: C,\n\tAudioDestinationNode: C,\n\tAudioListener: C,\n\tAudioNode: C,\n\tAudioParam: C,\n\tAudioProcessingEvent: C,\n\tAudioScheduledSourceNode: C,\n\tAudioWorkletNode: C,\n\tBarProp: C,\n\tBaseAudioContext: C,\n\tBatteryManager: C,\n\tBeforeUnloadEvent: C,\n\tBiquadFilterNode: C,\n\tBlob: C,\n\tBlobEvent: C,\n\tblur: O,\n\tBroadcastChannel: C,\n\tbtoa: O,\n\tByteLengthQueuingStrategy: C,\n\tCache: C,\n\tcaches: O,\n\tCacheStorage: C,\n\tcancelAnimationFrame: O,\n\tcancelIdleCallback: O,\n\tCanvasCaptureMediaStreamTrack: C,\n\tCanvasGradient: C,\n\tCanvasPattern: C,\n\tCanvasRenderingContext2D: C,\n\tChannelMergerNode: C,\n\tChannelSplitterNode: C,\n\tCharacterData: C,\n\tclientInformation: O,\n\tClipboardEvent: C,\n\tclose: O,\n\tclosed: O,\n\tCloseEvent: C,\n\tComment: C,\n\tCompositionEvent: C,\n\tconfirm: O,\n\tConstantSourceNode: C,\n\tConvolverNode: C,\n\tCountQueuingStrategy: C,\n\tcreateImageBitmap: O,\n\tCredential: C,\n\tCredentialsContainer: C,\n\tcrypto: O,\n\tCrypto: C,\n\tCryptoKey: C,\n\tCSS: C,\n\tCSSConditionRule: C,\n\tCSSFontFaceRule: C,\n\tCSSGroupingRule: C,\n\tCSSImportRule: C,\n\tCSSKeyframeRule: C,\n\tCSSKeyframesRule: C,\n\tCSSMediaRule: C,\n\tCSSNamespaceRule: C,\n\tCSSPageRule: C,\n\tCSSRule: C,\n\tCSSRuleList: C,\n\tCSSStyleDeclaration: C,\n\tCSSStyleRule: C,\n\tCSSStyleSheet: C,\n\tCSSSupportsRule: C,\n\tCustomElementRegistry: C,\n\tcustomElements: O,\n\tCustomEvent: C,\n\tDataTransfer: C,\n\tDataTransferItem: C,\n\tDataTransferItemList: C,\n\tdefaultstatus: O,\n\tdefaultStatus: O,\n\tDelayNode: C,\n\tDeviceMotionEvent: C,\n\tDeviceOrientationEvent: C,\n\tdevicePixelRatio: O,\n\tdispatchEvent: O,\n\tdocument: O,\n\tDocument: C,\n\tDocumentFragment: C,\n\tDocumentType: C,\n\tDOMError: C,\n\tDOMException: C,\n\tDOMImplementation: C,\n\tDOMMatrix: C,\n\tDOMMatrixReadOnly: C,\n\tDOMParser: C,\n\tDOMPoint: C,\n\tDOMPointReadOnly: C,\n\tDOMQuad: C,\n\tDOMRect: C,\n\tDOMRectReadOnly: C,\n\tDOMStringList: C,\n\tDOMStringMap: C,\n\tDOMTokenList: C,\n\tDragEvent: C,\n\tDynamicsCompressorNode: C,\n\tElement: C,\n\tErrorEvent: C,\n\tEvent: C,\n\tEventSource: C,\n\tEventTarget: C,\n\texternal: O,\n\tfetch: O,\n\tFile: C,\n\tFileList: C,\n\tFileReader: C,\n\tfind: O,\n\tfocus: O,\n\tFocusEvent: C,\n\tFontFace: C,\n\tFontFaceSetLoadEvent: C,\n\tFormData: C,\n\tframes: O,\n\tGainNode: C,\n\tGamepad: C,\n\tGamepadButton: C,\n\tGamepadEvent: C,\n\tgetComputedStyle: O,\n\tgetSelection: O,\n\tHashChangeEvent: C,\n\tHeaders: C,\n\thistory: O,\n\tHistory: C,\n\tHTMLAllCollection: C,\n\tHTMLAnchorElement: C,\n\tHTMLAreaElement: C,\n\tHTMLAudioElement: C,\n\tHTMLBaseElement: C,\n\tHTMLBodyElement: C,\n\tHTMLBRElement: C,\n\tHTMLButtonElement: C,\n\tHTMLCanvasElement: C,\n\tHTMLCollection: C,\n\tHTMLContentElement: C,\n\tHTMLDataElement: C,\n\tHTMLDataListElement: C,\n\tHTMLDetailsElement: C,\n\tHTMLDialogElement: C,\n\tHTMLDirectoryElement: C,\n\tHTMLDivElement: C,\n\tHTMLDListElement: C,\n\tHTMLDocument: C,\n\tHTMLElement: C,\n\tHTMLEmbedElement: C,\n\tHTMLFieldSetElement: C,\n\tHTMLFontElement: C,\n\tHTMLFormControlsCollection: C,\n\tHTMLFormElement: C,\n\tHTMLFrameElement: C,\n\tHTMLFrameSetElement: C,\n\tHTMLHeadElement: C,\n\tHTMLHeadingElement: C,\n\tHTMLHRElement: C,\n\tHTMLHtmlElement: C,\n\tHTMLIFrameElement: C,\n\tHTMLImageElement: C,\n\tHTMLInputElement: C,\n\tHTMLLabelElement: C,\n\tHTMLLegendElement: C,\n\tHTMLLIElement: C,\n\tHTMLLinkElement: C,\n\tHTMLMapElement: C,\n\tHTMLMarqueeElement: C,\n\tHTMLMediaElement: C,\n\tHTMLMenuElement: C,\n\tHTMLMetaElement: C,\n\tHTMLMeterElement: C,\n\tHTMLModElement: C,\n\tHTMLObjectElement: C,\n\tHTMLOListElement: C,\n\tHTMLOptGroupElement: C,\n\tHTMLOptionElement: C,\n\tHTMLOptionsCollection: C,\n\tHTMLOutputElement: C,\n\tHTMLParagraphElement: C,\n\tHTMLParamElement: C,\n\tHTMLPictureElement: C,\n\tHTMLPreElement: C,\n\tHTMLProgressElement: C,\n\tHTMLQuoteElement: C,\n\tHTMLScriptElement: C,\n\tHTMLSelectElement: C,\n\tHTMLShadowElement: C,\n\tHTMLSlotElement: C,\n\tHTMLSourceElement: C,\n\tHTMLSpanElement: C,\n\tHTMLStyleElement: C,\n\tHTMLTableCaptionElement: C,\n\tHTMLTableCellElement: C,\n\tHTMLTableColElement: C,\n\tHTMLTableElement: C,\n\tHTMLTableRowElement: C,\n\tHTMLTableSectionElement: C,\n\tHTMLTemplateElement: C,\n\tHTMLTextAreaElement: C,\n\tHTMLTimeElement: C,\n\tHTMLTitleElement: C,\n\tHTMLTrackElement: C,\n\tHTMLUListElement: C,\n\tHTMLUnknownElement: C,\n\tHTMLVideoElement: C,\n\tIDBCursor: C,\n\tIDBCursorWithValue: C,\n\tIDBDatabase: C,\n\tIDBFactory: C,\n\tIDBIndex: C,\n\tIDBKeyRange: C,\n\tIDBObjectStore: C,\n\tIDBOpenDBRequest: C,\n\tIDBRequest: C,\n\tIDBTransaction: C,\n\tIDBVersionChangeEvent: C,\n\tIdleDeadline: C,\n\tIIRFilterNode: C,\n\tImage: C,\n\tImageBitmap: C,\n\tImageBitmapRenderingContext: C,\n\tImageCapture: C,\n\tImageData: C,\n\tindexedDB: O,\n\tinnerHeight: O,\n\tinnerWidth: O,\n\tInputEvent: C,\n\tIntersectionObserver: C,\n\tIntersectionObserverEntry: C,\n\tisSecureContext: O,\n\tKeyboardEvent: C,\n\tKeyframeEffect: C,\n\tlength: O,\n\tlocalStorage: O,\n\tlocation: O,\n\tLocation: C,\n\tlocationbar: O,\n\tmatchMedia: O,\n\tMediaDeviceInfo: C,\n\tMediaDevices: C,\n\tMediaElementAudioSourceNode: C,\n\tMediaEncryptedEvent: C,\n\tMediaError: C,\n\tMediaKeyMessageEvent: C,\n\tMediaKeySession: C,\n\tMediaKeyStatusMap: C,\n\tMediaKeySystemAccess: C,\n\tMediaList: C,\n\tMediaQueryList: C,\n\tMediaQueryListEvent: C,\n\tMediaRecorder: C,\n\tMediaSettingsRange: C,\n\tMediaSource: C,\n\tMediaStream: C,\n\tMediaStreamAudioDestinationNode: C,\n\tMediaStreamAudioSourceNode: C,\n\tMediaStreamEvent: C,\n\tMediaStreamTrack: C,\n\tMediaStreamTrackEvent: C,\n\tmenubar: O,\n\tMessageChannel: C,\n\tMessageEvent: C,\n\tMessagePort: C,\n\tMIDIAccess: C,\n\tMIDIConnectionEvent: C,\n\tMIDIInput: C,\n\tMIDIInputMap: C,\n\tMIDIMessageEvent: C,\n\tMIDIOutput: C,\n\tMIDIOutputMap: C,\n\tMIDIPort: C,\n\tMimeType: C,\n\tMimeTypeArray: C,\n\tMouseEvent: C,\n\tmoveBy: O,\n\tmoveTo: O,\n\tMutationEvent: C,\n\tMutationObserver: C,\n\tMutationRecord: C,\n\tname: O,\n\tNamedNodeMap: C,\n\tNavigationPreloadManager: C,\n\tnavigator: O,\n\tNavigator: C,\n\tNetworkInformation: C,\n\tNode: C,\n\tNodeFilter: O,\n\tNodeIterator: C,\n\tNodeList: C,\n\tNotification: C,\n\tOfflineAudioCompletionEvent: C,\n\tOfflineAudioContext: C,\n\toffscreenBuffering: O,\n\tOffscreenCanvas: C,\n\topen: O,\n\topenDatabase: O,\n\tOption: C,\n\torigin: O,\n\tOscillatorNode: C,\n\touterHeight: O,\n\touterWidth: O,\n\tPageTransitionEvent: C,\n\tpageXOffset: O,\n\tpageYOffset: O,\n\tPannerNode: C,\n\tparent: O,\n\tPath2D: C,\n\tPaymentAddress: C,\n\tPaymentRequest: C,\n\tPaymentRequestUpdateEvent: C,\n\tPaymentResponse: C,\n\tperformance: O,\n\tPerformance: C,\n\tPerformanceEntry: C,\n\tPerformanceLongTaskTiming: C,\n\tPerformanceMark: C,\n\tPerformanceMeasure: C,\n\tPerformanceNavigation: C,\n\tPerformanceNavigationTiming: C,\n\tPerformanceObserver: C,\n\tPerformanceObserverEntryList: C,\n\tPerformancePaintTiming: C,\n\tPerformanceResourceTiming: C,\n\tPerformanceTiming: C,\n\tPeriodicWave: C,\n\tPermissions: C,\n\tPermissionStatus: C,\n\tpersonalbar: O,\n\tPhotoCapabilities: C,\n\tPlugin: C,\n\tPluginArray: C,\n\tPointerEvent: C,\n\tPopStateEvent: C,\n\tpostMessage: O,\n\tPresentation: C,\n\tPresentationAvailability: C,\n\tPresentationConnection: C,\n\tPresentationConnectionAvailableEvent: C,\n\tPresentationConnectionCloseEvent: C,\n\tPresentationConnectionList: C,\n\tPresentationReceiver: C,\n\tPresentationRequest: C,\n\tprint: O,\n\tProcessingInstruction: C,\n\tProgressEvent: C,\n\tPromiseRejectionEvent: C,\n\tprompt: O,\n\tPushManager: C,\n\tPushSubscription: C,\n\tPushSubscriptionOptions: C,\n\tqueueMicrotask: O,\n\tRadioNodeList: C,\n\tRange: C,\n\tReadableStream: C,\n\tRemotePlayback: C,\n\tremoveEventListener: O,\n\tRequest: C,\n\trequestAnimationFrame: O,\n\trequestIdleCallback: O,\n\tresizeBy: O,\n\tResizeObserver: C,\n\tResizeObserverEntry: C,\n\tresizeTo: O,\n\tResponse: C,\n\tRTCCertificate: C,\n\tRTCDataChannel: C,\n\tRTCDataChannelEvent: C,\n\tRTCDtlsTransport: C,\n\tRTCIceCandidate: C,\n\tRTCIceTransport: C,\n\tRTCPeerConnection: C,\n\tRTCPeerConnectionIceEvent: C,\n\tRTCRtpReceiver: C,\n\tRTCRtpSender: C,\n\tRTCSctpTransport: C,\n\tRTCSessionDescription: C,\n\tRTCStatsReport: C,\n\tRTCTrackEvent: C,\n\tscreen: O,\n\tScreen: C,\n\tscreenLeft: O,\n\tScreenOrientation: C,\n\tscreenTop: O,\n\tscreenX: O,\n\tscreenY: O,\n\tScriptProcessorNode: C,\n\tscroll: O,\n\tscrollbars: O,\n\tscrollBy: O,\n\tscrollTo: O,\n\tscrollX: O,\n\tscrollY: O,\n\tSecurityPolicyViolationEvent: C,\n\tSelection: C,\n\tServiceWorker: C,\n\tServiceWorkerContainer: C,\n\tServiceWorkerRegistration: C,\n\tsessionStorage: O,\n\tShadowRoot: C,\n\tSharedWorker: C,\n\tSourceBuffer: C,\n\tSourceBufferList: C,\n\tspeechSynthesis: O,\n\tSpeechSynthesisEvent: C,\n\tSpeechSynthesisUtterance: C,\n\tStaticRange: C,\n\tstatus: O,\n\tstatusbar: O,\n\tStereoPannerNode: C,\n\tstop: O,\n\tStorage: C,\n\tStorageEvent: C,\n\tStorageManager: C,\n\tstyleMedia: O,\n\tStyleSheet: C,\n\tStyleSheetList: C,\n\tSubtleCrypto: C,\n\tSVGAElement: C,\n\tSVGAngle: C,\n\tSVGAnimatedAngle: C,\n\tSVGAnimatedBoolean: C,\n\tSVGAnimatedEnumeration: C,\n\tSVGAnimatedInteger: C,\n\tSVGAnimatedLength: C,\n\tSVGAnimatedLengthList: C,\n\tSVGAnimatedNumber: C,\n\tSVGAnimatedNumberList: C,\n\tSVGAnimatedPreserveAspectRatio: C,\n\tSVGAnimatedRect: C,\n\tSVGAnimatedString: C,\n\tSVGAnimatedTransformList: C,\n\tSVGAnimateElement: C,\n\tSVGAnimateMotionElement: C,\n\tSVGAnimateTransformElement: C,\n\tSVGAnimationElement: C,\n\tSVGCircleElement: C,\n\tSVGClipPathElement: C,\n\tSVGComponentTransferFunctionElement: C,\n\tSVGDefsElement: C,\n\tSVGDescElement: C,\n\tSVGDiscardElement: C,\n\tSVGElement: C,\n\tSVGEllipseElement: C,\n\tSVGFEBlendElement: C,\n\tSVGFEColorMatrixElement: C,\n\tSVGFEComponentTransferElement: C,\n\tSVGFECompositeElement: C,\n\tSVGFEConvolveMatrixElement: C,\n\tSVGFEDiffuseLightingElement: C,\n\tSVGFEDisplacementMapElement: C,\n\tSVGFEDistantLightElement: C,\n\tSVGFEDropShadowElement: C,\n\tSVGFEFloodElement: C,\n\tSVGFEFuncAElement: C,\n\tSVGFEFuncBElement: C,\n\tSVGFEFuncGElement: C,\n\tSVGFEFuncRElement: C,\n\tSVGFEGaussianBlurElement: C,\n\tSVGFEImageElement: C,\n\tSVGFEMergeElement: C,\n\tSVGFEMergeNodeElement: C,\n\tSVGFEMorphologyElement: C,\n\tSVGFEOffsetElement: C,\n\tSVGFEPointLightElement: C,\n\tSVGFESpecularLightingElement: C,\n\tSVGFESpotLightElement: C,\n\tSVGFETileElement: C,\n\tSVGFETurbulenceElement: C,\n\tSVGFilterElement: C,\n\tSVGForeignObjectElement: C,\n\tSVGGElement: C,\n\tSVGGeometryElement: C,\n\tSVGGradientElement: C,\n\tSVGGraphicsElement: C,\n\tSVGImageElement: C,\n\tSVGLength: C,\n\tSVGLengthList: C,\n\tSVGLinearGradientElement: C,\n\tSVGLineElement: C,\n\tSVGMarkerElement: C,\n\tSVGMaskElement: C,\n\tSVGMatrix: C,\n\tSVGMetadataElement: C,\n\tSVGMPathElement: C,\n\tSVGNumber: C,\n\tSVGNumberList: C,\n\tSVGPathElement: C,\n\tSVGPatternElement: C,\n\tSVGPoint: C,\n\tSVGPointList: C,\n\tSVGPolygonElement: C,\n\tSVGPolylineElement: C,\n\tSVGPreserveAspectRatio: C,\n\tSVGRadialGradientElement: C,\n\tSVGRect: C,\n\tSVGRectElement: C,\n\tSVGScriptElement: C,\n\tSVGSetElement: C,\n\tSVGStopElement: C,\n\tSVGStringList: C,\n\tSVGStyleElement: C,\n\tSVGSVGElement: C,\n\tSVGSwitchElement: C,\n\tSVGSymbolElement: C,\n\tSVGTextContentElement: C,\n\tSVGTextElement: C,\n\tSVGTextPathElement: C,\n\tSVGTextPositioningElement: C,\n\tSVGTitleElement: C,\n\tSVGTransform: C,\n\tSVGTransformList: C,\n\tSVGTSpanElement: C,\n\tSVGUnitTypes: C,\n\tSVGUseElement: C,\n\tSVGViewElement: C,\n\tTaskAttributionTiming: C,\n\tText: C,\n\tTextEvent: C,\n\tTextMetrics: C,\n\tTextTrack: C,\n\tTextTrackCue: C,\n\tTextTrackCueList: C,\n\tTextTrackList: C,\n\tTimeRanges: C,\n\ttoolbar: O,\n\ttop: O,\n\tTouch: C,\n\tTouchEvent: C,\n\tTouchList: C,\n\tTrackEvent: C,\n\tTransitionEvent: C,\n\tTreeWalker: C,\n\tUIEvent: C,\n\tValidityState: C,\n\tvisualViewport: O,\n\tVisualViewport: C,\n\tVTTCue: C,\n\tWaveShaperNode: C,\n\tWebAssembly: O,\n\tWebGL2RenderingContext: C,\n\tWebGLActiveInfo: C,\n\tWebGLBuffer: C,\n\tWebGLContextEvent: C,\n\tWebGLFramebuffer: C,\n\tWebGLProgram: C,\n\tWebGLQuery: C,\n\tWebGLRenderbuffer: C,\n\tWebGLRenderingContext: C,\n\tWebGLSampler: C,\n\tWebGLShader: C,\n\tWebGLShaderPrecisionFormat: C,\n\tWebGLSync: C,\n\tWebGLTexture: C,\n\tWebGLTransformFeedback: C,\n\tWebGLUniformLocation: C,\n\tWebGLVertexArrayObject: C,\n\tWebSocket: C,\n\tWheelEvent: C,\n\tWindow: C,\n\tWorker: C,\n\tWritableStream: C,\n\tXMLDocument: C,\n\tXMLHttpRequest: C,\n\tXMLHttpRequestEventTarget: C,\n\tXMLHttpRequestUpload: C,\n\tXMLSerializer: C,\n\tXPathEvaluator: C,\n\tXPathExpression: C,\n\tXPathResult: C,\n\tXSLTProcessor: C\n};\n\nfor (const global of ['window', 'global', 'self', 'globalThis']) {\n\tknownGlobals[global] = knownGlobals;\n}\n\nexport function getGlobalAtPath(path: ObjectPath): ValueDescription | null {\n\tlet currentGlobal: GlobalDescription | null = knownGlobals;\n\tfor (const pathSegment of path) {\n\t\tif (typeof pathSegment !== 'string') {\n\t\t\treturn null;\n\t\t}\n\t\tcurrentGlobal = currentGlobal[pathSegment];\n\t\tif (!currentGlobal) {\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn currentGlobal[ValueProperties];\n}\n","import { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport {\n\tLiteralValueOrUnknown,\n\tUnknownTruthyValue,\n\tUnknownValue\n} from '../nodes/shared/Expression';\nimport { getGlobalAtPath } from '../nodes/shared/knownGlobals';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { PathTracker } from '../utils/PathTracker';\nimport Variable from './Variable';\n\nexport default class GlobalVariable extends Variable {\n\t// Ensure we use live-bindings for globals as we do not know if they have\n\t// been reassigned\n\tisReassigned = true;\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\t_recursionTracker: PathTracker,\n\t\t_origin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn getGlobalAtPath([this.name, ...path]) ? UnknownTruthyValue : UnknownValue;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\tif (path.length === 0) {\n\t\t\t\t\t// Technically, \"undefined\" is a global variable of sorts\n\t\t\t\t\treturn this.name !== 'undefined' && !getGlobalAtPath([this.name]);\n\t\t\t\t}\n\t\t\t\treturn !getGlobalAtPath([this.name, ...path].slice(0, -1));\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn true;\n\t\t\tcase INTERACTION_CALLED: {\n\t\t\t\tconst globalAtPath = getGlobalAtPath([this.name, ...path]);\n\t\t\t\treturn !globalAtPath || globalAtPath.hasEffectsWhenCalled(interaction, context);\n\t\t\t}\n\t\t}\n\t}\n}\n","import isReference, { type NodeWithFieldDefinition } from 'is-reference';\nimport type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from '../NodeInteractions';\nimport type FunctionScope from '../scopes/FunctionScope';\nimport { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker';\nimport GlobalVariable from '../variables/GlobalVariable';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport * as NodeType from './NodeType';\nimport type SpreadElement from './SpreadElement';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION\n} from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport type IdentifierWithVariable = Identifier & { variable: Variable };\n\nconst tdzVariableKinds = {\n\t__proto__: null,\n\tclass: true,\n\tconst: true,\n\tlet: true,\n\tvar: true\n};\n\nexport default class Identifier extends NodeBase implements PatternNode {\n\tdeclare name: string;\n\tdeclare type: NodeType.tIdentifier;\n\tvariable: Variable | null = null;\n\tprivate isTDZAccess: boolean | null = null;\n\n\taddExportedVariables(\n\t\tvariables: Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tif (exportNamesByVariable.has(this.variable!)) {\n\t\t\tvariables.push(this.variable!);\n\t\t}\n\t}\n\n\tbind(): void {\n\t\tif (!this.variable && isReference(this, this.parent as NodeWithFieldDefinition)) {\n\t\t\tthis.variable = this.scope.findVariable(this.name);\n\t\t\tthis.variable.addReference(this);\n\t\t}\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tlet variable: LocalVariable;\n\t\tconst { treeshake } = this.context.options;\n\t\tswitch (kind) {\n\t\t\tcase 'var':\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, true);\n\t\t\t\tif (treeshake && treeshake.correctVarValueBeforeDeclaration) {\n\t\t\t\t\t// Necessary to make sure the init is deoptimized. We cannot call deoptimizePath here.\n\t\t\t\t\tvariable.markInitializersForDeoptimization();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'function':\n\t\t\t\t// in strict mode, functions are only hoisted within a scope but not across block scopes\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, false);\n\t\t\t\tbreak;\n\t\t\tcase 'let':\n\t\t\tcase 'const':\n\t\t\tcase 'class':\n\t\t\t\tvariable = this.scope.addDeclaration(this, this.context, init, false);\n\t\t\t\tbreak;\n\t\t\tcase 'parameter':\n\t\t\t\tvariable = (this.scope as FunctionScope).addParameterDeclaration(this);\n\t\t\t\tbreak;\n\t\t\t/* istanbul ignore next */\n\t\t\tdefault:\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tthrow new Error(`Internal Error: Unexpected identifier kind ${kind}.`);\n\t\t}\n\t\tvariable.kind = kind;\n\t\treturn [(this.variable = variable)];\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0 && !this.scope.contains(this.name)) {\n\t\t\tthis.disallowImportReassignment();\n\t\t}\n\t\t// We keep conditional chaining because an unknown Node could have an\n\t\t// Identifier as property that might be deoptimized by default\n\t\tthis.variable?.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.variable!.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getVariableRespectingTDZ()!.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getVariableRespectingTDZ()!.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (this.isPossibleTDZ() && this.variable!.kind !== 'var') {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).unknownGlobalSideEffects &&\n\t\t\tthis.variable instanceof GlobalVariable &&\n\t\t\tthis.variable.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\tcontext\n\t\t\t)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\treturn (\n\t\t\t\t\tthis.variable !== null &&\n\t\t\t\t\tthis.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t\t);\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn (\n\t\t\t\t\tpath.length > 0 ? this.getVariableRespectingTDZ() : this.variable\n\t\t\t\t)!.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\treturn this.getVariableRespectingTDZ()!.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\tcontext\n\t\t\t\t);\n\t\t}\n\t}\n\n\tinclude(): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.variable !== null) {\n\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t}\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tthis.variable!.includeCallArguments(context, args);\n\t}\n\n\tisPossibleTDZ(): boolean {\n\t\t// return cached value to avoid issues with the next tree-shaking pass\n\t\tif (this.isTDZAccess !== null) return this.isTDZAccess;\n\n\t\tif (\n\t\t\t!(this.variable instanceof LocalVariable) ||\n\t\t\t!this.variable.kind ||\n\t\t\t!(this.variable.kind in tdzVariableKinds)\n\t\t) {\n\t\t\treturn (this.isTDZAccess = false);\n\t\t}\n\n\t\tlet decl_id;\n\t\tif (\n\t\t\tthis.variable.declarations &&\n\t\t\tthis.variable.declarations.length === 1 &&\n\t\t\t(decl_id = this.variable.declarations[0] as any) &&\n\t\t\tthis.start < decl_id.start &&\n\t\t\tclosestParentFunctionOrProgram(this) === closestParentFunctionOrProgram(decl_id)\n\t\t) {\n\t\t\t// a variable accessed before its declaration\n\t\t\t// in the same function or at top level of module\n\t\t\treturn (this.isTDZAccess = true);\n\t\t}\n\n\t\tif (!this.variable.initReached) {\n\t\t\t// Either a const/let TDZ violation or\n\t\t\t// var use before declaration was encountered.\n\t\t\treturn (this.isTDZAccess = true);\n\t\t}\n\n\t\treturn (this.isTDZAccess = false);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.variable!.initReached = true;\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\t{ snippets: { getPropertyAccess } }: RenderOptions,\n\t\t{ renderedParentType, isCalleeOfRenderedParent, isShorthandProperty }: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (this.variable) {\n\t\t\tconst name = this.variable.getName(getPropertyAccess);\n\n\t\t\tif (name !== this.name) {\n\t\t\t\tcode.overwrite(this.start, this.end, name, {\n\t\t\t\t\tcontentOnly: true,\n\t\t\t\t\tstoreName: true\n\t\t\t\t});\n\t\t\t\tif (isShorthandProperty) {\n\t\t\t\t\tcode.prependRight(this.start, `${this.name}: `);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// In strict mode, any variable named \"eval\" must be the actual \"eval\" function\n\t\t\tif (\n\t\t\t\tname === 'eval' &&\n\t\t\t\trenderedParentType === NodeType.CallExpression &&\n\t\t\t\tisCalleeOfRenderedParent\n\t\t\t) {\n\t\t\t\tcode.appendRight(this.start, '0, ');\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.variable instanceof LocalVariable) {\n\t\t\tthis.variable.consolidateInitializers();\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate disallowImportReassignment(): never {\n\t\treturn this.context.error(\n\t\t\t{\n\t\t\t\tcode: 'ILLEGAL_REASSIGNMENT',\n\t\t\t\tmessage: `Illegal reassignment to import '${this.name}'`\n\t\t\t},\n\t\t\tthis.start\n\t\t);\n\t}\n\n\tprivate getVariableRespectingTDZ(): ExpressionEntity | null {\n\t\tif (this.isPossibleTDZ()) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn this.variable;\n\t}\n}\n\nfunction closestParentFunctionOrProgram(node: any): any {\n\twhile (node && !/^Program|Function/.test(node.type)) {\n\t\tnode = node.parent;\n\t}\n\t// one of: ArrowFunctionExpression, FunctionDeclaration, FunctionExpression or Program\n\treturn node;\n}\n","import type MagicString from 'magic-string';\nimport * as NodeType from '../ast/nodes/NodeType';\nimport type { Node } from '../ast/nodes/shared/Node';\n\nexport function treeshakeNode(node: Node, code: MagicString, start: number, end: number): void {\n\tcode.remove(start, end);\n\tif (node.annotations) {\n\t\tfor (const annotation of node.annotations) {\n\t\t\tif (annotation.start < start) {\n\t\t\t\tcode.remove(annotation.start, annotation.end);\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function removeAnnotations(node: Node, code: MagicString): void {\n\tif (!node.annotations && node.parent.type === NodeType.ExpressionStatement) {\n\t\tnode = node.parent as Node;\n\t}\n\tif (node.annotations) {\n\t\tfor (const annotation of node.annotations) {\n\t\t\tcode.remove(annotation.start, annotation.end);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { Node, StatementNode } from '../ast/nodes/shared/Node';\nimport type Variable from '../ast/variables/Variable';\nimport type { InternalModuleFormat } from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport type { GenerateCodeSnippets } from './generateCodeSnippets';\nimport { treeshakeNode } from './treeshakeNode';\n\nexport interface RenderOptions {\n\tdynamicImportFunction: string | undefined;\n\texportNamesByVariable: Map;\n\tformat: InternalModuleFormat;\n\tfreeze: boolean;\n\tindent: string;\n\tnamespaceToStringTag: boolean;\n\toutputPluginDriver: PluginDriver;\n\tsnippets: GenerateCodeSnippets;\n}\n\nexport interface NodeRenderOptions {\n\tend?: number;\n\tisCalleeOfRenderedParent?: boolean;\n\tisNoStatement?: boolean;\n\tisShorthandProperty?: boolean;\n\tpreventASI?: boolean;\n\t/* Indicates if the direct parent of an element changed.\n\tNecessary for determining the \"this\" context of callees. */\n\trenderedParentType?: string;\n\t/* Indicates if the parent or ancestor surrounding an element has changed and what it changed to.\n\tNecessary for adding parentheses. */\n\trenderedSurroundingElement?: string;\n\tstart?: number;\n}\n\nexport const NO_SEMICOLON: NodeRenderOptions = { isNoStatement: true };\n\n// This assumes there are only white-space and comments between start and the string we are looking for\nexport function findFirstOccurrenceOutsideComment(\n\tcode: string,\n\tsearchString: string,\n\tstart = 0\n): number {\n\tlet searchPos: number, charCodeAfterSlash: number;\n\tsearchPos = code.indexOf(searchString, start);\n\twhile (true) {\n\t\tstart = code.indexOf('/', start);\n\t\tif (start === -1 || start >= searchPos) return searchPos;\n\t\tcharCodeAfterSlash = code.charCodeAt(++start);\n\t\t++start;\n\n\t\t// With our assumption, '/' always starts a comment. Determine comment type:\n\t\tstart =\n\t\t\tcharCodeAfterSlash === 47 /*\"/\"*/\n\t\t\t\t? code.indexOf('\\n', start) + 1\n\t\t\t\t: code.indexOf('*/', start) + 2;\n\t\tif (start > searchPos) {\n\t\t\tsearchPos = code.indexOf(searchString, start);\n\t\t}\n\t}\n}\n\nconst NON_WHITESPACE = /\\S/g;\n\nexport function findNonWhiteSpace(code: string, index: number): number {\n\tNON_WHITESPACE.lastIndex = index;\n\tconst result = NON_WHITESPACE.exec(code)!;\n\treturn result.index;\n}\n\n// This assumes \"code\" only contains white-space and comments\n// Returns position of line-comment if applicable\nfunction findFirstLineBreakOutsideComment(code: string): [number, number] {\n\tlet lineBreakPos,\n\t\tcharCodeAfterSlash,\n\t\tstart = 0;\n\tlineBreakPos = code.indexOf('\\n', start);\n\twhile (true) {\n\t\tstart = code.indexOf('/', start);\n\t\tif (start === -1 || start > lineBreakPos) return [lineBreakPos, lineBreakPos + 1];\n\n\t\t// With our assumption, '/' always starts a comment. Determine comment type:\n\t\tcharCodeAfterSlash = code.charCodeAt(start + 1);\n\t\tif (charCodeAfterSlash === 47 /*\"/\"*/) return [start, lineBreakPos + 1];\n\t\tstart = code.indexOf('*/', start + 3) + 2;\n\t\tif (start > lineBreakPos) {\n\t\t\tlineBreakPos = code.indexOf('\\n', start);\n\t\t}\n\t}\n}\n\nexport function renderStatementList(\n\tstatements: readonly StatementNode[],\n\tcode: MagicString,\n\tstart: number,\n\tend: number,\n\toptions: RenderOptions\n): void {\n\tlet currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart;\n\tlet nextNode = statements[0];\n\tlet nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries;\n\tif (nextNodeNeedsBoundaries) {\n\t\tnextNodeStart =\n\t\t\tstart + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1];\n\t}\n\n\tfor (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) {\n\t\tcurrentNode = nextNode;\n\t\tcurrentNodeStart = nextNodeStart;\n\t\tcurrentNodeNeedsBoundaries = nextNodeNeedsBoundaries;\n\t\tnextNode = statements[nextIndex];\n\t\tnextNodeNeedsBoundaries =\n\t\t\tnextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries;\n\t\tif (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) {\n\t\t\tnextNodeStart =\n\t\t\t\tcurrentNode.end +\n\t\t\t\tfindFirstLineBreakOutsideComment(\n\t\t\t\t\tcode.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start)\n\t\t\t\t)[1];\n\t\t\tif (currentNode.included) {\n\t\t\t\tcurrentNodeNeedsBoundaries\n\t\t\t\t\t? currentNode.render(code, options, {\n\t\t\t\t\t\t\tend: nextNodeStart,\n\t\t\t\t\t\t\tstart: currentNodeStart\n\t\t\t\t\t })\n\t\t\t\t\t: currentNode.render(code, options);\n\t\t\t} else {\n\t\t\t\ttreeshakeNode(currentNode, code, currentNodeStart!, nextNodeStart);\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentNode.render(code, options);\n\t\t}\n\t}\n}\n\n// This assumes that the first character is not part of the first node\nexport function getCommaSeparatedNodesWithBoundaries(\n\tnodes: readonly N[],\n\tcode: MagicString,\n\tstart: number,\n\tend: number\n): {\n\tcontentEnd: number;\n\tend: number;\n\tnode: N;\n\tseparator: number | null;\n\tstart: number;\n}[] {\n\tconst splitUpNodes = [];\n\tlet node, nextNode, nextNodeStart, contentEnd, char;\n\tlet separator = start - 1;\n\n\tfor (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) {\n\t\tnextNode = nodes[nextIndex];\n\t\tif (node !== undefined) {\n\t\t\tseparator =\n\t\t\t\tnode.end +\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ',');\n\t\t}\n\t\tnextNodeStart = contentEnd =\n\t\t\tseparator +\n\t\t\t1 +\n\t\t\tfindFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1];\n\t\twhile (\n\t\t\t((char = code.original.charCodeAt(nextNodeStart)),\n\t\t\tchar === 32 /*\" \"*/ || char === 9 /*\"\\t\"*/ || char === 10 /*\"\\n\"*/ || char === 13) /*\"\\r\"*/\n\t\t)\n\t\t\tnextNodeStart++;\n\t\tif (node !== undefined) {\n\t\t\tsplitUpNodes.push({\n\t\t\t\tcontentEnd,\n\t\t\t\tend: nextNodeStart,\n\t\t\t\tnode,\n\t\t\t\tseparator,\n\t\t\t\tstart\n\t\t\t});\n\t\t}\n\t\tnode = nextNode;\n\t\tstart = nextNodeStart;\n\t}\n\tsplitUpNodes.push({\n\t\tcontentEnd: end,\n\t\tend,\n\t\tnode: node as N,\n\t\tseparator: null,\n\t\tstart\n\t});\n\treturn splitUpNodes;\n}\n\n// This assumes there are only white-space and comments between start and end\nexport function removeLineBreaks(code: MagicString, start: number, end: number): void {\n\twhile (true) {\n\t\tconst [removeStart, removeEnd] = findFirstLineBreakOutsideComment(\n\t\t\tcode.original.slice(start, end)\n\t\t);\n\t\tif (removeStart === -1) {\n\t\t\tbreak;\n\t\t}\n\t\tcode.remove(start + removeStart, (start += removeEnd));\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type LocalVariable from '../variables/LocalVariable';\nimport ChildScope from './ChildScope';\n\nexport default class BlockScope extends ChildScope {\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tif (isHoisted) {\n\t\t\tconst variable = this.parent.addDeclaration(identifier, context, init, isHoisted);\n\t\t\t// Necessary to make sure the init is deoptimized for conditional declarations.\n\t\t\t// We cannot call deoptimizePath here.\n\t\t\tvariable.markInitializersForDeoptimization();\n\t\t\treturn variable;\n\t\t} else {\n\t\t\treturn super.addDeclaration(identifier, context, init, false);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, StatementBase } from './shared/Node';\n\nexport default class ExpressionStatement extends StatementBase {\n\tdeclare directive?: string;\n\tdeclare expression: ExpressionNode;\n\n\tinitialise(): void {\n\t\tif (\n\t\t\tthis.directive &&\n\t\t\tthis.directive !== 'use strict' &&\n\t\t\tthis.parent.type === NodeType.Program\n\t\t) {\n\t\t\tthis.context.warn(\n\t\t\t\t// This is necessary, because either way (deleting or not) can lead to errors.\n\t\t\t\t{\n\t\t\t\t\tcode: 'MODULE_LEVEL_DIRECTIVE',\n\t\t\t\t\tmessage: `Module level directives cause errors when bundled, '${this.directive}' was ignored.`\n\t\t\t\t},\n\t\t\t\tthis.start\n\t\t\t);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tsuper.render(code, options);\n\t\tif (this.included) this.insertSemicolon(code);\n\t}\n\n\tshouldBeIncluded(context: InclusionContext): boolean {\n\t\tif (this.directive && this.directive !== 'use strict')\n\t\t\treturn this.parent.type !== NodeType.Program;\n\n\t\treturn super.shouldBeIncluded(context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type ChildScope from '../scopes/ChildScope';\nimport type Scope from '../scopes/Scope';\nimport ExpressionStatement from './ExpressionStatement';\nimport * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type IncludeChildren, type Node, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class BlockStatement extends StatementBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare type: NodeType.tBlockStatement;\n\n\tprivate declare deoptimizeBody: boolean;\n\tprivate directlyIncluded = false;\n\n\taddImplicitReturnExpressionToScope(): void {\n\t\tconst lastStatement = this.body[this.body.length - 1];\n\t\tif (!lastStatement || lastStatement.type !== NodeType.ReturnStatement) {\n\t\t\tthis.scope.addReturnExpression(UNKNOWN_EXPRESSION);\n\t\t}\n\t}\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = (this.parent as Node).preventChildBlockScope\n\t\t\t? (parentScope as ChildScope)\n\t\t\t: new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.deoptimizeBody) return true;\n\t\tfor (const node of this.body) {\n\t\t\tif (context.brokenFlow) break;\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!(this.deoptimizeBody && this.directlyIncluded)) {\n\t\t\tthis.included = true;\n\t\t\tthis.directlyIncluded = true;\n\t\t\tif (this.deoptimizeBody) includeChildrenRecursively = true;\n\t\t\tfor (const node of this.body) {\n\t\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tconst firstBodyStatement = this.body[0];\n\t\tthis.deoptimizeBody =\n\t\t\tfirstBodyStatement instanceof ExpressionStatement &&\n\t\t\tfirstBodyStatement.directive === 'use asm';\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start + 1, this.end - 1, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UnknownKey } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class RestElement extends NodeBase implements PatternNode {\n\tdeclare argument: PatternNode;\n\tdeclare type: NodeType.tRestElement;\n\tprivate declarationInit: ExpressionEntity | null = null;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tthis.argument.addExportedVariables(variables, exportNamesByVariable);\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tthis.declarationInit = init;\n\t\treturn this.argument.declare(kind, UNKNOWN_EXPRESSION);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tpath.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tpath.length > 0 ||\n\t\t\tthis.argument.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.argument.markDeclarationReached();\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.declarationInit !== null) {\n\t\t\tthis.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type { NormalizedTreeshakingOptions } from '../../../rollup/types';\nimport { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport {\n\tBROKEN_FLOW_NONE,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport ReturnValueScope from '../../scopes/ReturnValueScope';\nimport { type ObjectPath, PathTracker, UNKNOWN_PATH, UnknownKey } from '../../utils/PathTracker';\nimport BlockStatement from '../BlockStatement';\nimport * as NodeType from '../NodeType';\nimport RestElement from '../RestElement';\nimport type SpreadElement from '../SpreadElement';\nimport { type ExpressionEntity, LiteralValueOrUnknown, UNKNOWN_EXPRESSION } from './Expression';\nimport {\n\ttype ExpressionNode,\n\ttype GenericEsTreeNode,\n\ttype IncludeChildren,\n\tNodeBase\n} from './Node';\nimport { ObjectEntity } from './ObjectEntity';\nimport type { PatternNode } from './Pattern';\n\nexport default abstract class FunctionBase extends NodeBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement | ExpressionNode;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: ReturnValueScope;\n\tprotected objectEntity: ObjectEntity | null = null;\n\tprivate deoptimizedReturn = false;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t\tif (path.length === 1 && path[0] === UnknownKey) {\n\t\t\t// A reassignment of UNKNOWN_PATH is considered equivalent to having lost track\n\t\t\t// which means the return expression needs to be reassigned\n\t\t\tthis.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (path.length > 0) {\n\t\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (path.length > 0) {\n\t\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.async) {\n\t\t\tif (!this.deoptimizedReturn) {\n\t\t\t\tthis.deoptimizedReturn = true;\n\t\t\t\tthis.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tthis.context.requestTreeshakingPass();\n\t\t\t}\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn this.scope.getReturnExpression();\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (path.length > 0 || interaction.type !== INTERACTION_CALLED) {\n\t\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\tif (this.async) {\n\t\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\t\tconst returnExpression = this.scope.getReturnExpression();\n\t\t\tif (\n\t\t\t\treturnExpression.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t['then'],\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\tcontext\n\t\t\t\t) ||\n\t\t\t\t(propertyReadSideEffects &&\n\t\t\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\t\t\treturnExpression.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t\t\t['then'],\n\t\t\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ACCESS,\n\t\t\t\t\t\t\tcontext\n\t\t\t\t\t\t)))\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tfor (const param of this.params) {\n\t\t\tif (param.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tconst { brokenFlow } = context;\n\t\tcontext.brokenFlow = BROKEN_FLOW_NONE;\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tthis.scope.includeCallArguments(context, args);\n\t}\n\n\tinitialise(): void {\n\t\tthis.scope.addParameterVariables(\n\t\t\tthis.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)),\n\t\t\tthis.params[this.params.length - 1] instanceof RestElement\n\t\t);\n\t\tif (this.body instanceof BlockStatement) {\n\t\t\tthis.body.addImplicitReturnExpressionToScope();\n\t\t} else {\n\t\t\tthis.scope.addReturnExpression(this.body);\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.body.type === NodeType.BlockStatement) {\n\t\t\tthis.body = new BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprotected abstract getObjectEntity(): ObjectEntity;\n}\n\nFunctionBase.prototype.preventChildBlockScope = true;\n","import { type HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteraction } from '../NodeInteractions';\nimport ReturnValueScope from '../scopes/ReturnValueScope';\nimport type Scope from '../scopes/Scope';\nimport { type ObjectPath } from '../utils/PathTracker';\nimport BlockStatement from './BlockStatement';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport FunctionBase from './shared/FunctionBase';\nimport { type ExpressionNode, IncludeChildren } from './shared/Node';\nimport { ObjectEntity } from './shared/ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './shared/ObjectPrototype';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ArrowFunctionExpression extends FunctionBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement | ExpressionNode;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: ReturnValueScope;\n\tdeclare type: NodeType.tArrowFunctionExpression;\n\tprotected objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ReturnValueScope(parentScope, this.context);\n\t}\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\tif (interaction.type === INTERACTION_CALLED) {\n\t\t\tconst { ignore, brokenFlow } = context;\n\t\t\tcontext.ignore = {\n\t\t\t\tbreaks: false,\n\t\t\t\tcontinues: false,\n\t\t\t\tlabels: new Set(),\n\t\t\t\treturnYield: true\n\t\t\t};\n\t\t\tif (this.body.hasEffects(context)) return true;\n\t\t\tcontext.ignore = ignore;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tfor (const param of this.params) {\n\t\t\tif (!(param instanceof Identifier)) {\n\t\t\t\tparam.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity([], OBJECT_PROTOTYPE));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type Variable from '../ast/variables/Variable';\nimport type { RenderOptions } from './renderHelpers';\n\nexport function getSystemExportStatement(\n\texportedVariables: readonly Variable[],\n\t{ exportNamesByVariable, snippets: { _, getObject, getPropertyAccess } }: RenderOptions,\n\tmodifier = ''\n): string {\n\tif (\n\t\texportedVariables.length === 1 &&\n\t\texportNamesByVariable.get(exportedVariables[0])!.length === 1\n\t) {\n\t\tconst variable = exportedVariables[0];\n\t\treturn `exports('${exportNamesByVariable.get(variable)}',${_}${variable.getName(\n\t\t\tgetPropertyAccess\n\t\t)}${modifier})`;\n\t} else {\n\t\tconst fields: [key: string, value: string][] = [];\n\t\tfor (const variable of exportedVariables) {\n\t\t\tfor (const exportName of exportNamesByVariable.get(variable)!) {\n\t\t\t\tfields.push([exportName, variable.getName(getPropertyAccess) + modifier]);\n\t\t\t}\n\t\t}\n\t\treturn `exports(${getObject(fields, { lineBreakIndent: null })})`;\n\t}\n}\n\nexport function renderSystemExportExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tcode: MagicString,\n\t{ exportNamesByVariable, snippets: { _ } }: RenderOptions\n): void {\n\tcode.prependRight(\n\t\texpressionStart,\n\t\t`exports('${exportNamesByVariable.get(exportedVariable)}',${_}`\n\t);\n\tcode.appendLeft(expressionEnd, ')');\n}\n\nexport function renderSystemExportFunction(\n\texportedVariables: readonly Variable[],\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions\n): void {\n\tconst { _, getDirectReturnIifeLeft } = options.snippets;\n\tcode.prependRight(\n\t\texpressionStart,\n\t\tgetDirectReturnIifeLeft(\n\t\t\t['v'],\n\t\t\t`${getSystemExportStatement(exportedVariables, options)},${_}v`,\n\t\t\t{ needsArrowReturnParens: true, needsWrappedFunction: needsParens }\n\t\t)\n\t);\n\tcode.appendLeft(expressionEnd, ')');\n}\n\nexport function renderSystemExportSequenceAfterExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions\n): void {\n\tconst { _, getPropertyAccess } = options.snippets;\n\tcode.appendLeft(\n\t\texpressionEnd,\n\t\t`,${_}${getSystemExportStatement([exportedVariable], options)},${_}${exportedVariable.getName(\n\t\t\tgetPropertyAccess\n\t\t)}`\n\t);\n\tif (needsParens) {\n\t\tcode.prependRight(expressionStart, '(');\n\t\tcode.appendLeft(expressionEnd, ')');\n\t}\n}\n\nexport function renderSystemExportSequenceBeforeExpression(\n\texportedVariable: Variable,\n\texpressionStart: number,\n\texpressionEnd: number,\n\tneedsParens: boolean | undefined,\n\tcode: MagicString,\n\toptions: RenderOptions,\n\tmodifier: string\n): void {\n\tconst { _ } = options.snippets;\n\tcode.prependRight(\n\t\texpressionStart,\n\t\t`${getSystemExportStatement([exportedVariable], options, modifier)},${_}`\n\t);\n\tif (needsParens) {\n\t\tcode.prependRight(expressionStart, '(');\n\t\tcode.appendLeft(expressionEnd, ')');\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport * as NodeType from './NodeType';\nimport type Property from './Property';\nimport type RestElement from './RestElement';\nimport type { ExpressionEntity } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ObjectPattern extends NodeBase implements PatternNode {\n\tdeclare properties: readonly (Property | RestElement)[];\n\tdeclare type: NodeType.tObjectPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tfor (const property of this.properties) {\n\t\t\tif (property.type === NodeType.Property) {\n\t\t\t\t(property.value as unknown as PatternNode).addExportedVariables(\n\t\t\t\t\tvariables,\n\t\t\t\t\texportNamesByVariable\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tproperty.argument.addExportedVariables(variables, exportNamesByVariable);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tconst variables: LocalVariable[] = [];\n\t\tfor (const property of this.properties) {\n\t\t\tvariables.push(...property.declare(kind, init));\n\t\t}\n\t\treturn variables;\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0) {\n\t\t\tfor (const property of this.properties) {\n\t\t\t\tproperty.deoptimizePath(path);\n\t\t\t}\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\t// At the moment, this is only triggered for assignment left-hand sides,\n\t\t// where the path is empty\n\t\t_path: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const property of this.properties) {\n\t\t\tif (property.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tfor (const property of this.properties) {\n\t\t\tproperty.markDeclarationReached();\n\t\t}\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport { UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport { ObjectPath } from '../utils/PathTracker';\nimport LocalVariable from './LocalVariable';\n\nexport default class ArgumentsVariable extends LocalVariable {\n\tconstructor(context: AstContext) {\n\t\tsuper('arguments', null, UNKNOWN_EXPRESSION, context);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 1;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteraction, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from '../nodes/shared/Expression';\nimport {\n\tDiscriminatedPathTracker,\n\ttype ObjectPath,\n\tSHARED_RECURSION_TRACKER\n} from '../utils/PathTracker';\nimport LocalVariable from './LocalVariable';\n\ninterface ThisDeoptimizationInteraction {\n\tinteraction: NodeInteractionWithThisArg;\n\tpath: ObjectPath;\n}\n\nexport default class ThisVariable extends LocalVariable {\n\tprivate readonly deoptimizedPaths: ObjectPath[] = [];\n\tprivate readonly entitiesToBeDeoptimized = new Set();\n\tprivate readonly thisDeoptimizationList: ThisDeoptimizationInteraction[] = [];\n\tprivate readonly thisDeoptimizations = new DiscriminatedPathTracker();\n\n\tconstructor(context: AstContext) {\n\t\tsuper('this', null, null, context);\n\t}\n\n\taddEntityToBeDeoptimized(entity: ExpressionEntity): void {\n\t\tfor (const path of this.deoptimizedPaths) {\n\t\t\tentity.deoptimizePath(path);\n\t\t}\n\t\tfor (const { interaction, path } of this.thisDeoptimizationList) {\n\t\t\tentity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER);\n\t\t}\n\t\tthis.entitiesToBeDeoptimized.add(entity);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tpath.length === 0 ||\n\t\t\tthis.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthis.deoptimizedPaths.push(path);\n\t\tfor (const entity of this.entitiesToBeDeoptimized) {\n\t\t\tentity.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath\n\t): void {\n\t\tconst thisDeoptimization: ThisDeoptimizationInteraction = {\n\t\t\tinteraction,\n\t\t\tpath\n\t\t};\n\t\tif (\n\t\t\t!this.thisDeoptimizations.trackEntityAtPathAndGetIfTracked(\n\t\t\t\tpath,\n\t\t\t\tinteraction.type,\n\t\t\t\tinteraction.thisArg\n\t\t\t)\n\t\t) {\n\t\t\tfor (const entity of this.entitiesToBeDeoptimized) {\n\t\t\t\tentity.deoptimizeThisOnInteractionAtPath(interaction, path, SHARED_RECURSION_TRACKER);\n\t\t\t}\n\t\t\tthis.thisDeoptimizationList.push(thisDeoptimization);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tthis.getInit(context).hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\tsuper.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t);\n\t}\n\n\tprivate getInit(context: HasEffectsContext): ExpressionEntity {\n\t\treturn context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type SpreadElement from '../nodes/SpreadElement';\nimport { ExpressionEntity } from '../nodes/shared/Expression';\nimport ArgumentsVariable from '../variables/ArgumentsVariable';\nimport ThisVariable from '../variables/ThisVariable';\nimport type ChildScope from './ChildScope';\nimport ReturnValueScope from './ReturnValueScope';\n\nexport default class FunctionScope extends ReturnValueScope {\n\treadonly argumentsVariable: ArgumentsVariable;\n\treadonly thisVariable: ThisVariable;\n\n\tconstructor(parent: ChildScope, context: AstContext) {\n\t\tsuper(parent, context);\n\t\tthis.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));\n\t\tthis.variables.set('this', (this.thisVariable = new ThisVariable(context)));\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn this;\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tsuper.includeCallArguments(context, args);\n\t\tif (this.argumentsVariable.included) {\n\t\t\tfor (const arg of args) {\n\t\t\t\tif (!arg.included) {\n\t\t\t\t\targ.include(context, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { type HasEffectsContext, type InclusionContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport FunctionScope from '../../scopes/FunctionScope';\nimport { type ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport BlockStatement from '../BlockStatement';\nimport Identifier, { type IdentifierWithVariable } from '../Identifier';\nimport { UNKNOWN_EXPRESSION } from './Expression';\nimport FunctionBase from './FunctionBase';\nimport { type IncludeChildren } from './Node';\nimport { ObjectEntity } from './ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\nimport type { PatternNode } from './Pattern';\n\nexport default class FunctionNode extends FunctionBase {\n\tdeclare async: boolean;\n\tdeclare body: BlockStatement;\n\tdeclare id: IdentifierWithVariable | null;\n\tdeclare params: readonly PatternNode[];\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: FunctionScope;\n\tprotected objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: FunctionScope): void {\n\t\tthis.scope = new FunctionScope(parentScope, this.context);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tsuper.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 0) {\n\t\t\tthis.scope.thisVariable.addEntityToBeDeoptimized(interaction.thisArg);\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn !!this.id?.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (super.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\tif (interaction.type === INTERACTION_CALLED) {\n\t\t\tconst thisInit = context.replacedVariableInits.get(this.scope.thisVariable);\n\t\t\tcontext.replacedVariableInits.set(\n\t\t\t\tthis.scope.thisVariable,\n\t\t\t\tinteraction.withNew\n\t\t\t\t\t? new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE)\n\t\t\t\t\t: UNKNOWN_EXPRESSION\n\t\t\t);\n\t\t\tconst { brokenFlow, ignore } = context;\n\t\t\tcontext.ignore = {\n\t\t\t\tbreaks: false,\n\t\t\t\tcontinues: false,\n\t\t\t\tlabels: new Set(),\n\t\t\t\treturnYield: true\n\t\t\t};\n\t\t\tif (this.body.hasEffects(context)) return true;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\tif (thisInit) {\n\t\t\t\tcontext.replacedVariableInits.set(this.scope.thisVariable, thisInit);\n\t\t\t} else {\n\t\t\t\tcontext.replacedVariableInits.delete(this.scope.thisVariable);\n\t\t\t}\n\t\t\tcontext.ignore = ignore;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tthis.id?.include();\n\t\tconst hasArguments = this.scope.argumentsVariable.included;\n\t\tfor (const param of this.params) {\n\t\t\tif (!(param instanceof Identifier) || hasArguments) {\n\t\t\t\tparam.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tthis.id?.declare('function', this);\n\t}\n\n\tprotected getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tkey: 'prototype',\n\t\t\t\t\tkind: 'init',\n\t\t\t\t\tproperty: new ObjectEntity([], OBJECT_PROTOTYPE)\n\t\t\t\t}\n\t\t\t],\n\t\t\tOBJECT_PROTOTYPE\n\t\t));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER\n} from '../utils/PathTracker';\nimport ExpressionStatement from './ExpressionStatement';\nimport type { LiteralValue } from './Literal';\nimport type * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\ntype Operator =\n\t| '!='\n\t| '!=='\n\t| '%'\n\t| '&'\n\t| '*'\n\t| '**'\n\t| '+'\n\t| '-'\n\t| '/'\n\t| '<'\n\t| '<<'\n\t| '<='\n\t| '=='\n\t| '==='\n\t| '>'\n\t| '>='\n\t| '>>'\n\t| '>>>'\n\t| '^'\n\t| '|'\n\t| 'in'\n\t| 'instanceof';\n\nconst binaryOperators: {\n\t[operator in Operator]?: (left: LiteralValue, right: LiteralValue) => LiteralValueOrUnknown;\n} = {\n\t'!=': (left, right) => left != right,\n\t'!==': (left, right) => left !== right,\n\t'%': (left: any, right: any) => left % right,\n\t'&': (left: any, right: any) => left & right,\n\t'*': (left: any, right: any) => left * right,\n\t// At the moment, \"**\" will be transpiled to Math.pow\n\t'**': (left: any, right: any) => left ** right,\n\t'+': (left: any, right: any) => left + right,\n\t'-': (left: any, right: any) => left - right,\n\t'/': (left: any, right: any) => left / right,\n\t'<': (left, right) => left! < right!,\n\t'<<': (left: any, right: any) => left << right,\n\t'<=': (left, right) => left! <= right!,\n\t'==': (left, right) => left == right,\n\t'===': (left, right) => left === right,\n\t'>': (left, right) => left! > right!,\n\t'>=': (left, right) => left! >= right!,\n\t'>>': (left: any, right: any) => left >> right,\n\t'>>>': (left: any, right: any) => left >>> right,\n\t'^': (left: any, right: any) => left ^ right,\n\t'|': (left: any, right: any) => left | right\n\t// We use the fallback for cases where we return something unknown\n\t// in: () => UnknownValue,\n\t// instanceof: () => UnknownValue,\n};\n\nexport default class BinaryExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare left: ExpressionNode;\n\tdeclare operator: keyof typeof binaryOperators;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tBinaryExpression;\n\n\tdeoptimizeCache(): void {}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length > 0) return UnknownValue;\n\t\tconst leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof leftValue === 'symbol') return UnknownValue;\n\n\t\tconst rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof rightValue === 'symbol') return UnknownValue;\n\n\t\tconst operatorFn = binaryOperators[this.operator];\n\t\tif (!operatorFn) return UnknownValue;\n\n\t\treturn operatorFn(leftValue, rightValue);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\t// support some implicit type coercion runtime errors\n\t\tif (\n\t\t\tthis.operator === '+' &&\n\t\t\tthis.parent instanceof ExpressionStatement &&\n\t\t\tthis.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === ''\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn super.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > 1;\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.left.render(code, options, { renderedSurroundingElement });\n\t\tthis.right.render(code, options);\n\t}\n}\n","import MagicString from 'magic-string';\nimport CallExpression from '../ast/nodes/CallExpression';\nimport NewExpression from '../ast/nodes/NewExpression';\nimport { findFirstOccurrenceOutsideComment, RenderOptions } from './renderHelpers';\n\nexport function renderCallArguments(\n\tcode: MagicString,\n\toptions: RenderOptions,\n\tnode: CallExpression | NewExpression\n): void {\n\tif (node.arguments.length > 0) {\n\t\tif (node.arguments[node.arguments.length - 1].included) {\n\t\t\tfor (const arg of node.arguments) {\n\t\t\t\targ.render(code, options);\n\t\t\t}\n\t\t} else {\n\t\t\tlet lastIncludedIndex = node.arguments.length - 2;\n\t\t\twhile (lastIncludedIndex >= 0 && !node.arguments[lastIncludedIndex].included) {\n\t\t\t\tlastIncludedIndex--;\n\t\t\t}\n\t\t\tif (lastIncludedIndex >= 0) {\n\t\t\t\tfor (let index = 0; index <= lastIncludedIndex; index++) {\n\t\t\t\t\tnode.arguments[index].render(code, options);\n\t\t\t\t}\n\t\t\t\tcode.remove(\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(\n\t\t\t\t\t\tcode.original,\n\t\t\t\t\t\t',',\n\t\t\t\t\t\tnode.arguments[lastIncludedIndex].end\n\t\t\t\t\t),\n\t\t\t\t\tnode.end - 1\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcode.remove(\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '(', node.callee.end) + 1,\n\t\t\t\t\tnode.end - 1\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport {\n\tgetLiteralMembersForValue,\n\tgetMemberReturnExpressionWhenCalled,\n\thasMemberEffectWhenCalled,\n\ttype MemberDescription\n} from '../values';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\n\nexport type LiteralValue = string | boolean | null | number | RegExp | undefined;\n\nexport default class Literal extends NodeBase {\n\tdeclare regex?: {\n\t\tflags: string;\n\t\tpattern: string;\n\t};\n\tdeclare type: NodeType.tLiteral;\n\tdeclare value: T;\n\n\tprivate declare members: { [key: string]: MemberDescription };\n\n\tdeoptimizeThisOnInteractionAtPath(): void {}\n\n\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\tif (\n\t\t\tpath.length > 0 ||\n\t\t\t// unknown literals can also be null but do not start with an \"n\"\n\t\t\t(this.value === null && this.context.code.charCodeAt(this.start) !== 110) ||\n\t\t\ttypeof this.value === 'bigint' ||\n\t\t\t// to support shims for regular expressions\n\t\t\tthis.context.code.charCodeAt(this.start) === 47\n\t\t) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn this.value;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\tif (path.length !== 1) return UNKNOWN_EXPRESSION;\n\t\treturn getMemberReturnExpressionWhenCalled(this.members, path[0]);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tswitch (interaction.type) {\n\t\t\tcase INTERACTION_ACCESSED:\n\t\t\t\treturn path.length > (this.value === null ? 0 : 1);\n\t\t\tcase INTERACTION_ASSIGNED:\n\t\t\t\treturn true;\n\t\t\tcase INTERACTION_CALLED:\n\t\t\t\treturn (\n\t\t\t\t\tpath.length !== 1 ||\n\t\t\t\t\thasMemberEffectWhenCalled(this.members, path[0], interaction, context)\n\t\t\t\t);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.members = getLiteralMembersForValue(this.value);\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.value = esTreeNode.value;\n\t\tthis.regex = esTreeNode.regex;\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString): void {\n\t\tif (typeof this.value === 'string') {\n\t\t\t(code.indentExclusionRanges as [number, number][]).push([this.start + 1, this.end - 1]);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { AstContext } from '../../Module';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport relativeId from '../../utils/relativeId';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tNodeInteraction,\n\tNodeInteractionAccessed,\n\tNodeInteractionAssigned,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype ObjectPathKey,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH,\n\tUnknownKey,\n\tUnknownNonAccessorKey\n} from '../utils/PathTracker';\nimport ExternalVariable from '../variables/ExternalVariable';\nimport type NamespaceVariable from '../variables/NamespaceVariable';\nimport type Variable from '../variables/Variable';\nimport Identifier from './Identifier';\nimport Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport type SpreadElement from './SpreadElement';\nimport type Super from './Super';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\n// To avoid infinite recursions\nconst MAX_PATH_DEPTH = 7;\n\nfunction getResolvablePropertyKey(memberExpression: MemberExpression): string | null {\n\treturn memberExpression.computed\n\t\t? getResolvableComputedPropertyKey(memberExpression.property)\n\t\t: (memberExpression.property as Identifier).name;\n}\n\nfunction getResolvableComputedPropertyKey(propertyKey: ExpressionNode): string | null {\n\tif (propertyKey instanceof Literal) {\n\t\treturn String(propertyKey.value);\n\t}\n\treturn null;\n}\n\ntype PathWithPositions = { key: string; pos: number }[];\n\nfunction getPathIfNotComputed(memberExpression: MemberExpression): PathWithPositions | null {\n\tconst nextPathKey = memberExpression.propertyKey;\n\tconst object = memberExpression.object;\n\tif (typeof nextPathKey === 'string') {\n\t\tif (object instanceof Identifier) {\n\t\t\treturn [\n\t\t\t\t{ key: object.name, pos: object.start },\n\t\t\t\t{ key: nextPathKey, pos: memberExpression.property.start }\n\t\t\t];\n\t\t}\n\t\tif (object instanceof MemberExpression) {\n\t\t\tconst parentPath = getPathIfNotComputed(object);\n\t\t\treturn (\n\t\t\t\tparentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]\n\t\t\t);\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction getStringFromPath(path: PathWithPositions): string {\n\tlet pathString = path[0].key;\n\tfor (let index = 1; index < path.length; index++) {\n\t\tpathString += '.' + path[index].key;\n\t}\n\treturn pathString;\n}\n\nexport default class MemberExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare computed: boolean;\n\tdeclare object: ExpressionNode | Super;\n\tdeclare optional: boolean;\n\tdeclare property: ExpressionNode | PrivateIdentifier;\n\tdeclare propertyKey: ObjectPathKey | null;\n\tdeclare type: NodeType.tMemberExpression;\n\tvariable: Variable | null = null;\n\tprotected declare assignmentInteraction: NodeInteractionAssigned & { thisArg: ExpressionEntity };\n\tprivate declare accessInteraction: NodeInteractionAccessed & { thisArg: ExpressionEntity };\n\tprivate assignmentDeoptimized = false;\n\tprivate bound = false;\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate replacement: string | null = null;\n\n\tbind(): void {\n\t\tthis.bound = true;\n\t\tconst path = getPathIfNotComputed(this);\n\t\tconst baseVariable = path && this.scope.findVariable(path[0].key);\n\t\tif (baseVariable && baseVariable.isNamespace) {\n\t\t\tconst resolvedVariable = resolveNamespaceVariables(\n\t\t\t\tbaseVariable,\n\t\t\t\tpath!.slice(1),\n\t\t\t\tthis.context\n\t\t\t);\n\t\t\tif (!resolvedVariable) {\n\t\t\t\tsuper.bind();\n\t\t\t} else if (typeof resolvedVariable === 'string') {\n\t\t\t\tthis.replacement = resolvedVariable;\n\t\t\t} else {\n\t\t\t\tthis.variable = resolvedVariable;\n\t\t\t\tthis.scope.addNamespaceMemberAccess(getStringFromPath(path!), resolvedVariable);\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.bind();\n\t\t}\n\t}\n\n\tdeoptimizeCache(): void {\n\t\tconst expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;\n\t\tthis.expressionsToBeDeoptimized = [];\n\t\tthis.propertyKey = UnknownKey;\n\t\tthis.object.deoptimizePath(UNKNOWN_PATH);\n\t\tfor (const expression of expressionsToBeDeoptimized) {\n\t\t\texpression.deoptimizeCache();\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (path.length === 0) this.disallowNamespaceReassignment();\n\t\tif (this.variable) {\n\t\t\tthis.variable.deoptimizePath(path);\n\t\t} else if (!this.replacement) {\n\t\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\t\tconst propertyKey = this.getPropertyKey();\n\t\t\t\tthis.object.deoptimizePath([\n\t\t\t\t\tpropertyKey === UnknownKey ? UnknownNonAccessorKey : propertyKey,\n\t\t\t\t\t...path\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (this.variable) {\n\t\t\tthis.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t} else if (!this.replacement) {\n\t\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t\tinteraction,\n\t\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\t\trecursionTracker\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.getLiteralValueAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tpath,\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\tinteraction,\n\t\t\t\trecursionTracker,\n\t\t\t\torigin\n\t\t\t);\n\t\t}\n\t\treturn UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn (\n\t\t\tthis.property.hasEffects(context) ||\n\t\t\tthis.object.hasEffects(context) ||\n\t\t\tthis.hasAccessEffect(context)\n\t\t);\n\t}\n\n\thasEffectsAsAssignmentTarget(context: HasEffectsContext, checkAccess: boolean): boolean {\n\t\tif (checkAccess && !this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization();\n\t\treturn (\n\t\t\tthis.property.hasEffects(context) ||\n\t\t\tthis.object.hasEffects(context) ||\n\t\t\t(checkAccess && this.hasAccessEffect(context)) ||\n\t\t\tthis.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.assignmentInteraction, context)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (this.variable) {\n\t\t\treturn this.variable.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t\tif (this.replacement) {\n\t\t\treturn true;\n\t\t}\n\t\tif (path.length < MAX_PATH_DEPTH) {\n\t\t\treturn this.object.hasEffectsOnInteractionAtPath(\n\t\t\t\t[this.getPropertyKey(), ...path],\n\t\t\t\tinteraction,\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.includeProperties(context, includeChildrenRecursively);\n\t}\n\n\tincludeAsAssignmentTarget(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\tdeoptimizeAccess: boolean\n\t): void {\n\t\tif (!this.assignmentDeoptimized) this.applyAssignmentDeoptimization();\n\t\tif (deoptimizeAccess) {\n\t\t\tthis.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.includeProperties(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tif (this.variable) {\n\t\t\tthis.variable.includeCallArguments(context, args);\n\t\t} else {\n\t\t\tsuper.includeCallArguments(context, args);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.propertyKey = getResolvablePropertyKey(this);\n\t\tthis.accessInteraction = { thisArg: this.object, type: INTERACTION_ACCESSED };\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\trenderedParentType,\n\t\t\tisCalleeOfRenderedParent,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (this.variable || this.replacement) {\n\t\t\tconst {\n\t\t\t\tsnippets: { getPropertyAccess }\n\t\t\t} = options;\n\t\t\tlet replacement = this.variable ? this.variable.getName(getPropertyAccess) : this.replacement;\n\t\t\tif (renderedParentType && isCalleeOfRenderedParent) replacement = '0, ' + replacement;\n\t\t\tcode.overwrite(this.start, this.end, replacement!, {\n\t\t\t\tcontentOnly: true,\n\t\t\t\tstoreName: true\n\t\t\t});\n\t\t} else {\n\t\t\tif (renderedParentType && isCalleeOfRenderedParent) {\n\t\t\t\tcode.appendRight(this.start, '0, ');\n\t\t\t}\n\t\t\tthis.object.render(code, options, { renderedSurroundingElement });\n\t\t\tthis.property.render(code, options);\n\t\t}\n\t}\n\n\tsetAssignedValue(value: ExpressionEntity) {\n\t\tthis.assignmentInteraction = {\n\t\t\targs: [value],\n\t\t\tthisArg: this.object,\n\t\t\ttype: INTERACTION_ASSIGNED\n\t\t};\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\tif (\n\t\t\t// Namespaces are not bound and should not be deoptimized\n\t\t\tthis.bound &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t!(this.variable || this.replacement)\n\t\t) {\n\t\t\tconst propertyKey = this.getPropertyKey();\n\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.accessInteraction,\n\t\t\t\t[propertyKey],\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate applyAssignmentDeoptimization(): void {\n\t\tthis.assignmentDeoptimized = true;\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\tif (\n\t\t\t// Namespaces are not bound and should not be deoptimized\n\t\t\tthis.bound &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t!(this.variable || this.replacement)\n\t\t) {\n\t\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.assignmentInteraction,\n\t\t\t\t[this.getPropertyKey()],\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tprivate disallowNamespaceReassignment() {\n\t\tif (this.object instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.object.name);\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tif (this.variable) {\n\t\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t\t}\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'ILLEGAL_NAMESPACE_REASSIGNMENT',\n\t\t\t\t\t\tmessage: `Illegal reassignment to import '${this.object.name}'`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getPropertyKey(): ObjectPathKey {\n\t\tif (this.propertyKey === null) {\n\t\t\tthis.propertyKey = UnknownKey;\n\t\t\tconst value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\t\treturn (this.propertyKey = typeof value === 'symbol' ? UnknownKey : String(value));\n\t\t}\n\t\treturn this.propertyKey;\n\t}\n\n\tprivate hasAccessEffect(context: HasEffectsContext) {\n\t\tconst { propertyReadSideEffects } = this.context.options\n\t\t\t.treeshake as NormalizedTreeshakingOptions;\n\t\treturn (\n\t\t\t!(this.variable || this.replacement) &&\n\t\t\tpropertyReadSideEffects &&\n\t\t\t(propertyReadSideEffects === 'always' ||\n\t\t\t\tthis.object.hasEffectsOnInteractionAtPath(\n\t\t\t\t\t[this.getPropertyKey()],\n\t\t\t\t\tthis.accessInteraction,\n\t\t\t\t\tcontext\n\t\t\t\t))\n\t\t);\n\t}\n\n\tprivate includeProperties(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren\n\t) {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.variable) {\n\t\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t\t}\n\t\t}\n\t\tthis.object.include(context, includeChildrenRecursively);\n\t\tthis.property.include(context, includeChildrenRecursively);\n\t}\n}\n\nfunction resolveNamespaceVariables(\n\tbaseVariable: Variable,\n\tpath: PathWithPositions,\n\tastContext: AstContext\n): Variable | string | null {\n\tif (path.length === 0) return baseVariable;\n\tif (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable) return null;\n\tconst exportName = path[0].key;\n\tconst variable = (baseVariable as NamespaceVariable).context.traceExport(exportName);\n\tif (!variable) {\n\t\tconst fileName = (baseVariable as NamespaceVariable).context.fileName;\n\t\tastContext.warn(\n\t\t\t{\n\t\t\t\tcode: 'MISSING_EXPORT',\n\t\t\t\texporter: relativeId(fileName),\n\t\t\t\timporter: relativeId(astContext.fileName),\n\t\t\t\tmessage: `'${exportName}' is not exported by '${relativeId(fileName)}'`,\n\t\t\t\tmissing: exportName,\n\t\t\t\turl: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`\n\t\t\t},\n\t\t\tpath[0].pos\n\t\t);\n\t\treturn 'undefined';\n\t}\n\treturn resolveNamespaceVariables(variable, path.slice(1), astContext);\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport { type ObjectPath, type PathTracker, UNKNOWN_PATH } from '../../utils/PathTracker';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './Expression';\nimport { NodeBase } from './Node';\n\nexport default abstract class CallExpressionBase extends NodeBase implements DeoptimizableEntity {\n\tprotected declare interaction: NodeInteractionCalled;\n\tprotected returnExpression: ExpressionEntity | null = null;\n\tprivate readonly deoptimizableDependentExpressions: DeoptimizableEntity[] = [];\n\tprivate readonly expressionsToBeDeoptimized = new Set();\n\n\tdeoptimizeCache(): void {\n\t\tif (this.returnExpression !== UNKNOWN_EXPRESSION) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\tfor (const expression of this.deoptimizableDependentExpressions) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tif (\n\t\t\tpath.length === 0 ||\n\t\t\tthis.context.deoptimizationTracker.trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst returnExpression = this.getReturnExpression();\n\t\tif (returnExpression !== UNKNOWN_EXPRESSION) {\n\t\t\treturnExpression.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\tinteraction.thisArg.deoptimizePath(UNKNOWN_PATH);\n\t\t} else {\n\t\t\trecursionTracker.withTrackedEntityAtPath(\n\t\t\t\tpath,\n\t\t\t\treturnExpression,\n\t\t\t\t() => {\n\t\t\t\t\tthis.expressionsToBeDeoptimized.add(interaction.thisArg);\n\t\t\t\t\treturnExpression.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\t\t\t},\n\t\t\t\tundefined\n\t\t\t);\n\t\t}\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\treturnExpression,\n\t\t\t() => {\n\t\t\t\tthis.deoptimizableDependentExpressions.push(origin);\n\t\t\t\treturn returnExpression.getLiteralValueAtPath(path, recursionTracker, origin);\n\t\t\t},\n\t\t\tUnknownValue\n\t\t);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst returnExpression = this.getReturnExpression(recursionTracker);\n\t\tif (this.returnExpression === UNKNOWN_EXPRESSION) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn recursionTracker.withTrackedEntityAtPath(\n\t\t\tpath,\n\t\t\treturnExpression,\n\t\t\t() => {\n\t\t\t\tthis.deoptimizableDependentExpressions.push(origin);\n\t\t\t\treturn returnExpression.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t);\n\t\t\t},\n\t\t\tUNKNOWN_EXPRESSION\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst { type } = interaction;\n\t\tif (type === INTERACTION_CALLED) {\n\t\t\tif (\n\t\t\t\t(interaction.withNew\n\t\t\t\t\t? context.instantiated\n\t\t\t\t\t: context.called\n\t\t\t\t).trackEntityAtPathAndGetIfTracked(path, interaction.args, this)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (\n\t\t\t(type === INTERACTION_ASSIGNED\n\t\t\t\t? context.assigned\n\t\t\t\t: context.accessed\n\t\t\t).trackEntityAtPathAndGetIfTracked(path, this)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\treturn this.getReturnExpression().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected abstract getReturnExpression(recursionTracker?: PathTracker): ExpressionEntity;\n}\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport type LocalVariable from '../variables/LocalVariable';\nimport ParameterScope from './ParameterScope';\n\nexport default class CatchScope extends ParameterScope {\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tconst existingParameter = this.variables.get(identifier.name) as LocalVariable;\n\t\tif (existingParameter) {\n\t\t\t// While we still create a hoisted declaration, the initializer goes to\n\t\t\t// the parameter. Note that technically, the declaration now belongs to\n\t\t\t// two variables, which is not correct but should not cause issues.\n\t\t\tthis.parent.addDeclaration(identifier, context, UNDEFINED_EXPRESSION, isHoisted);\n\t\t\texistingParameter.addDeclaration(identifier, init);\n\t\t\treturn existingParameter;\n\t\t}\n\t\treturn this.parent.addDeclaration(identifier, context, init, isHoisted);\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport ClassNode from '../nodes/shared/ClassNode';\nimport LocalVariable from '../variables/LocalVariable';\nimport ThisVariable from '../variables/ThisVariable';\nimport ChildScope from './ChildScope';\nimport type Scope from './Scope';\n\nexport default class ClassBodyScope extends ChildScope {\n\tinstanceScope: ChildScope;\n\tthisVariable: LocalVariable;\n\n\tconstructor(parent: Scope, classNode: ClassNode, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.variables.set(\n\t\t\t'this',\n\t\t\t(this.thisVariable = new LocalVariable('this', null, classNode, context))\n\t\t);\n\t\tthis.instanceScope = new ChildScope(this);\n\t\tthis.instanceScope.variables.set('this', new ThisVariable(context));\n\t}\n\n\tfindLexicalBoundary(): ChildScope {\n\t\treturn this;\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_ASSIGNED,\n\tINTERACTION_CALLED,\n\tNO_ARGS,\n\tNODE_INTERACTION_UNKNOWN_CALL,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER\n} from '../../utils/PathTracker';\nimport type PrivateIdentifier from '../PrivateIdentifier';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION\n} from './Expression';\nimport { type ExpressionNode, NodeBase } from './Node';\nimport type { PatternNode } from './Pattern';\n\nexport default class MethodBase extends NodeBase implements DeoptimizableEntity {\n\tdeclare computed: boolean;\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare kind: 'constructor' | 'method' | 'init' | 'get' | 'set';\n\tdeclare value: ExpressionNode | (ExpressionNode & PatternNode);\n\n\tprivate accessedValue: ExpressionEntity | null = null;\n\n\t// As getter properties directly receive their values from fixed function\n\t// expressions, there is no known situation where a getter is deoptimized.\n\tdeoptimizeCache(): void {}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getAccessedValue().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tif (interaction.type === INTERACTION_ACCESSED && this.kind === 'get' && path.length === 0) {\n\t\t\treturn this.value.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t{\n\t\t\t\t\targs: NO_ARGS,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tEMPTY_PATH,\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t\tif (interaction.type === INTERACTION_ASSIGNED && this.kind === 'set' && path.length === 0) {\n\t\t\treturn this.value.deoptimizeThisOnInteractionAtPath(\n\t\t\t\t{\n\t\t\t\t\targs: interaction.args,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tEMPTY_PATH,\n\t\t\t\trecursionTracker\n\t\t\t);\n\t\t}\n\t\tthis.getAccessedValue().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getAccessedValue().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getAccessedValue().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn this.key.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (this.kind === 'get' && interaction.type === INTERACTION_ACCESSED && path.length === 0) {\n\t\t\treturn this.value.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\t{\n\t\t\t\t\targs: NO_ARGS,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\t// setters are only called for empty paths\n\t\tif (this.kind === 'set' && interaction.type === INTERACTION_ASSIGNED) {\n\t\t\treturn this.value.hasEffectsOnInteractionAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\t{\n\t\t\t\t\targs: interaction.args,\n\t\t\t\t\tthisArg: interaction.thisArg,\n\t\t\t\t\ttype: INTERACTION_CALLED,\n\t\t\t\t\twithNew: false\n\t\t\t\t},\n\t\t\t\tcontext\n\t\t\t);\n\t\t}\n\t\treturn this.getAccessedValue().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprotected getAccessedValue(): ExpressionEntity {\n\t\tif (this.accessedValue === null) {\n\t\t\tif (this.kind === 'get') {\n\t\t\t\tthis.accessedValue = UNKNOWN_EXPRESSION;\n\t\t\t\treturn (this.accessedValue = this.value.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_CALL,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t));\n\t\t\t} else {\n\t\t\t\treturn (this.accessedValue = this.value);\n\t\t\t}\n\t\t}\n\t\treturn this.accessedValue;\n\t}\n}\n","import type FunctionExpression from './FunctionExpression';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport MethodBase from './shared/MethodBase';\nimport type { ExpressionNode } from './shared/Node';\n\nexport default class MethodDefinition extends MethodBase {\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare kind: 'constructor' | 'method' | 'get' | 'set';\n\tdeclare static: boolean;\n\tdeclare type: NodeType.tMethodDefinition;\n\tdeclare value: FunctionExpression;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport { ExpressionEntity, type LiteralValueOrUnknown } from './Expression';\n\nexport class ObjectMember extends ExpressionEntity {\n\tconstructor(private readonly object: ExpressionEntity, private readonly key: string) {\n\t\tsuper();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.object.deoptimizePath([this.key, ...path]);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.object.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\t[this.key, ...path],\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.object.getLiteralValueAtPath([this.key, ...path], recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.object.getReturnExpressionWhenCalledAtPath(\n\t\t\t[this.key, ...path],\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.object.hasEffectsOnInteractionAtPath([this.key, ...path], interaction, context);\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../../ExecutionContext';\nimport {\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../../NodeInteractions';\nimport ChildScope from '../../scopes/ChildScope';\nimport type Scope from '../../scopes/Scope';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH,\n\tUnknownKey\n} from '../../utils/PathTracker';\nimport type ClassBody from '../ClassBody';\nimport Identifier from '../Identifier';\nimport type Literal from '../Literal';\nimport MethodDefinition from '../MethodDefinition';\nimport { type ExpressionEntity, type LiteralValueOrUnknown } from './Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './Node';\nimport { ObjectEntity, type ObjectProperty } from './ObjectEntity';\nimport { ObjectMember } from './ObjectMember';\nimport { OBJECT_PROTOTYPE } from './ObjectPrototype';\n\nexport default class ClassNode extends NodeBase implements DeoptimizableEntity {\n\tdeclare body: ClassBody;\n\tdeclare id: Identifier | null;\n\tdeclare superClass: ExpressionNode | null;\n\tprivate declare classConstructor: MethodDefinition | null;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ChildScope(parentScope);\n\t}\n\n\tdeoptimizeCache(): void {\n\t\tthis.getObjectEntity().deoptimizeAllProperties();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context);\n\t\tthis.id?.markDeclarationReached();\n\t\treturn initEffect || super.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 0) {\n\t\t\treturn (\n\t\t\t\t!interaction.withNew ||\n\t\t\t\t(this.classConstructor !== null\n\t\t\t\t\t? this.classConstructor.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t\t\t: this.superClass?.hasEffectsOnInteractionAtPath(path, interaction, context)) ||\n\t\t\t\tfalse\n\t\t\t);\n\t\t} else {\n\t\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tthis.superClass?.include(context, includeChildrenRecursively);\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tif (this.id) {\n\t\t\tthis.id.markDeclarationReached();\n\t\t\tthis.id.include();\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.id?.declare('class', this);\n\t\tfor (const method of this.body.body) {\n\t\t\tif (method instanceof MethodDefinition && method.kind === 'constructor') {\n\t\t\t\tthis.classConstructor = method;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.classConstructor = null;\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const definition of this.body.body) {\n\t\t\tif (\n\t\t\t\t!(\n\t\t\t\t\tdefinition.static ||\n\t\t\t\t\t(definition instanceof MethodDefinition && definition.kind === 'constructor')\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// Calls to methods are not tracked, ensure that the return value is deoptimized\n\t\t\t\tdefinition.deoptimizePath(UNKNOWN_PATH);\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tconst staticProperties: ObjectProperty[] = [];\n\t\tconst dynamicMethods: ObjectProperty[] = [];\n\t\tfor (const definition of this.body.body) {\n\t\t\tconst properties = definition.static ? staticProperties : dynamicMethods;\n\t\t\tconst definitionKind = (definition as MethodDefinition | { kind: undefined }).kind;\n\t\t\t// Note that class fields do not end up on the prototype\n\t\t\tif (properties === dynamicMethods && !definitionKind) continue;\n\t\t\tconst kind = definitionKind === 'set' || definitionKind === 'get' ? definitionKind : 'init';\n\t\t\tlet key: string;\n\t\t\tif (definition.computed) {\n\t\t\t\tconst keyValue = definition.key.getLiteralValueAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t);\n\t\t\t\tif (typeof keyValue === 'symbol') {\n\t\t\t\t\tproperties.push({ key: UnknownKey, kind, property: definition });\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tkey = String(keyValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tkey =\n\t\t\t\t\tdefinition.key instanceof Identifier\n\t\t\t\t\t\t? definition.key.name\n\t\t\t\t\t\t: String((definition.key as Literal).value);\n\t\t\t}\n\t\t\tproperties.push({ key, kind, property: definition });\n\t\t}\n\t\tstaticProperties.unshift({\n\t\t\tkey: 'prototype',\n\t\t\tkind: 'init',\n\t\t\tproperty: new ObjectEntity(\n\t\t\t\tdynamicMethods,\n\t\t\t\tthis.superClass ? new ObjectMember(this.superClass, 'prototype') : OBJECT_PROTOTYPE\n\t\t\t)\n\t\t});\n\t\treturn (this.objectEntity = new ObjectEntity(\n\t\t\tstaticProperties,\n\t\t\tthis.superClass || OBJECT_PROTOTYPE\n\t\t));\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport type ChildScope from '../scopes/ChildScope';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport type * as NodeType from './NodeType';\nimport ClassNode from './shared/ClassNode';\nimport type { GenericEsTreeNode } from './shared/Node';\n\nexport default class ClassDeclaration extends ClassNode {\n\tdeclare id: IdentifierWithVariable | null;\n\tdeclare type: NodeType.tClassDeclaration;\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tif (this.id !== null) {\n\t\t\tthis.id.variable.isId = true;\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.id !== null) {\n\t\t\tthis.id = new Identifier(\n\t\t\t\tesTreeNode.id,\n\t\t\t\tthis,\n\t\t\t\tthis.scope.parent as ChildScope\n\t\t\t) as IdentifierWithVariable;\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tif (format === 'system' && this.id && exportNamesByVariable.has(this.id.variable)) {\n\t\t\tcode.appendLeft(this.end, `${_}${getSystemExportStatement([this.id.variable], options)};`);\n\t\t}\n\t\tsuper.render(code, options);\n\t}\n}\n","import type { DeoptimizableEntity } from '../../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../../ExecutionContext';\nimport { NodeInteraction, NodeInteractionCalled } from '../../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../../utils/PathTracker';\nimport { ExpressionEntity } from './Expression';\n\nexport class MultiExpression extends ExpressionEntity {\n\tincluded = false;\n\n\tconstructor(private expressions: readonly ExpressionEntity[]) {\n\t\tsuper();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tfor (const expression of this.expressions) {\n\t\t\texpression.deoptimizePath(path);\n\t\t}\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn new MultiExpression(\n\t\t\tthis.expressions.map(expression =>\n\t\t\t\texpression.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t)\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (expression.hasEffectsOnInteractionAtPath(path, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type Identifier from './Identifier';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ExportAllDeclaration extends NodeBase {\n\tdeclare exported: Identifier | null;\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal;\n\tdeclare type: NodeType.tExportAllDeclaration;\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tcode.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nExportAllDeclaration.prototype.needsBoundaries = true;\n","import type ChildScope from '../scopes/ChildScope';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport type * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\nimport type { GenericEsTreeNode } from './shared/Node';\n\nexport default class FunctionDeclaration extends FunctionNode {\n\tdeclare type: NodeType.tFunctionDeclaration;\n\n\tinitialise(): void {\n\t\tsuper.initialise();\n\t\tif (this.id !== null) {\n\t\t\tthis.id.variable.isId = true;\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tif (esTreeNode.id !== null) {\n\t\t\tthis.id = new Identifier(\n\t\t\t\tesTreeNode.id,\n\t\t\t\tthis,\n\t\t\t\tthis.scope.parent as ChildScope\n\t\t\t) as IdentifierWithVariable;\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport { treeshakeNode } from '../../utils/treeshakeNode';\nimport { InclusionContext } from '../ExecutionContext';\nimport type ModuleScope from '../scopes/ModuleScope';\nimport type ExportDefaultVariable from '../variables/ExportDefaultVariable';\nimport ClassDeclaration from './ClassDeclaration';\nimport FunctionDeclaration from './FunctionDeclaration';\nimport type Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\n// The header ends at the first non-white-space after \"default\"\nfunction getDeclarationStart(code: string, start: number): number {\n\treturn findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);\n}\n\nfunction getIdInsertPosition(\n\tcode: string,\n\tdeclarationKeyword: string,\n\tendMarker: string,\n\tstart: number\n): number {\n\tconst declarationEnd =\n\t\tfindFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;\n\tcode = code.slice(\n\t\tdeclarationEnd,\n\t\tfindFirstOccurrenceOutsideComment(code, endMarker, declarationEnd)\n\t);\n\tconst generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');\n\tif (generatorStarPos === -1) {\n\t\treturn declarationEnd;\n\t}\n\treturn declarationEnd + generatorStarPos + 1;\n}\n\nexport default class ExportDefaultDeclaration extends NodeBase {\n\tdeclare declaration: FunctionDeclaration | ClassDeclaration | ExpressionNode;\n\tdeclare needsBoundaries: true;\n\tdeclare scope: ModuleScope;\n\tdeclare type: NodeType.tExportDefaultDeclaration;\n\tdeclare variable: ExportDefaultVariable;\n\n\tprivate declare declarationName: string | undefined;\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tsuper.include(context, includeChildrenRecursively);\n\t\tif (includeChildrenRecursively) {\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tconst declaration = this.declaration as FunctionDeclaration | ClassDeclaration;\n\t\tthis.declarationName =\n\t\t\t(declaration.id && declaration.id.name) || (this.declaration as Identifier).name;\n\t\tthis.variable = this.scope.addExportDefaultDeclaration(\n\t\t\tthis.declarationName || this.context.getModuleName(),\n\t\t\tthis,\n\t\t\tthis.context\n\t\t);\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tconst { start, end } = nodeRenderOptions as { end: number; start: number };\n\t\tconst declarationStart = getDeclarationStart(code.original, this.start);\n\n\t\tif (this.declaration instanceof FunctionDeclaration) {\n\t\t\tthis.renderNamedDeclaration(\n\t\t\t\tcode,\n\t\t\t\tdeclarationStart,\n\t\t\t\t'function',\n\t\t\t\t'(',\n\t\t\t\tthis.declaration.id === null,\n\t\t\t\toptions\n\t\t\t);\n\t\t} else if (this.declaration instanceof ClassDeclaration) {\n\t\t\tthis.renderNamedDeclaration(\n\t\t\t\tcode,\n\t\t\t\tdeclarationStart,\n\t\t\t\t'class',\n\t\t\t\t'{',\n\t\t\t\tthis.declaration.id === null,\n\t\t\t\toptions\n\t\t\t);\n\t\t} else if (this.variable.getOriginalVariable() !== this.variable) {\n\t\t\t// Remove altogether to prevent re-declaring the same variable\n\t\t\ttreeshakeNode(this, code, start, end);\n\t\t\treturn;\n\t\t} else if (this.variable.included) {\n\t\t\tthis.renderVariableDeclaration(code, declarationStart, options);\n\t\t} else {\n\t\t\tcode.remove(this.start, declarationStart);\n\t\t\tthis.declaration.render(code, options, {\n\t\t\t\trenderedSurroundingElement: NodeType.ExpressionStatement\n\t\t\t});\n\t\t\tif (code.original[this.end - 1] !== ';') {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tthis.declaration.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate renderNamedDeclaration(\n\t\tcode: MagicString,\n\t\tdeclarationStart: number,\n\t\tdeclarationKeyword: string,\n\t\tendMarker: string,\n\t\tneedsId: boolean,\n\t\toptions: RenderOptions\n\t): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { getPropertyAccess }\n\t\t} = options;\n\t\tconst name = this.variable.getName(getPropertyAccess);\n\t\t// Remove `export default`\n\t\tcode.remove(this.start, declarationStart);\n\n\t\tif (needsId) {\n\t\t\tcode.appendLeft(\n\t\t\t\tgetIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart),\n\t\t\t\t` ${name}`\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\tformat === 'system' &&\n\t\t\tthis.declaration instanceof ClassDeclaration &&\n\t\t\texportNamesByVariable.has(this.variable)\n\t\t) {\n\t\t\tcode.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);\n\t\t}\n\t}\n\n\tprivate renderVariableDeclaration(\n\t\tcode: MagicString,\n\t\tdeclarationStart: number,\n\t\t{ format, exportNamesByVariable, snippets: { cnst, getPropertyAccess } }: RenderOptions\n\t): void {\n\t\tconst hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*\";\"*/\n\t\tconst systemExportNames = format === 'system' && exportNamesByVariable.get(this.variable);\n\n\t\tif (systemExportNames) {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tdeclarationStart,\n\t\t\t\t`${cnst} ${this.variable.getName(getPropertyAccess)} = exports('${systemExportNames[0]}', `\n\t\t\t);\n\t\t\tcode.appendRight(\n\t\t\t\thasTrailingSemicolon ? this.end - 1 : this.end,\n\t\t\t\t')' + (hasTrailingSemicolon ? '' : ';')\n\t\t\t);\n\t\t} else {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tdeclarationStart,\n\t\t\t\t`${cnst} ${this.variable.getName(getPropertyAccess)} = `\n\t\t\t);\n\t\t\tif (!hasTrailingSemicolon) {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t}\n\t}\n}\n\nExportDefaultDeclaration.prototype.needsBoundaries = true;\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type ClassDeclaration from './ClassDeclaration';\nimport type ExportSpecifier from './ExportSpecifier';\nimport type FunctionDeclaration from './FunctionDeclaration';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { type Node, NodeBase } from './shared/Node';\n\nexport default class ExportNamedDeclaration extends NodeBase {\n\tdeclare declaration: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null;\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal | null;\n\tdeclare specifiers: readonly ExportSpecifier[];\n\tdeclare type: NodeType.tExportNamedDeclaration;\n\n\tbind(): void {\n\t\t// Do not bind specifiers\n\t\tthis.declaration?.bind();\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn !!this.declaration?.hasEffects(context);\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addExport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tconst { start, end } = nodeRenderOptions as { end: number; start: number };\n\t\tif (this.declaration === null) {\n\t\t\tcode.remove(start, end);\n\t\t} else {\n\t\t\tcode.remove(this.start, this.declaration.start);\n\t\t\t(this.declaration as Node).render(code, options, { end, start });\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nExportNamedDeclaration.prototype.needsBoundaries = true;\n","import type { AstContext } from '../../Module';\nimport type Identifier from '../nodes/Identifier';\nimport type { ExpressionEntity } from '../nodes/shared/Expression';\nimport type LocalVariable from '../variables/LocalVariable';\nimport BlockScope from './BlockScope';\n\nexport default class TrackingScope extends BlockScope {\n\thoistedDeclarations: Identifier[] = [];\n\n\taddDeclaration(\n\t\tidentifier: Identifier,\n\t\tcontext: AstContext,\n\t\tinit: ExpressionEntity | null,\n\t\tisHoisted: boolean\n\t): LocalVariable {\n\t\tthis.hoistedDeclarations.push(identifier);\n\t\treturn super.addDeclaration(identifier, context, init, isHoisted);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport {\n\tBROKEN_FLOW_NONE,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport TrackingScope from '../scopes/TrackingScope';\nimport { EMPTY_PATH, SHARED_RECURSION_TRACKER } from '../utils/PathTracker';\nimport BlockStatement from './BlockStatement';\nimport type Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype GenericEsTreeNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nconst unset = Symbol('unset');\n\nexport default class IfStatement extends StatementBase implements DeoptimizableEntity {\n\tdeclare alternate: StatementNode | null;\n\tdeclare consequent: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tIfStatement;\n\n\tprivate declare alternateScope?: TrackingScope;\n\tprivate declare consequentScope: TrackingScope;\n\tprivate testValue: LiteralValueOrUnknown | typeof unset = unset;\n\n\tdeoptimizeCache(): void {\n\t\tthis.testValue = UnknownValue;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) {\n\t\t\treturn true;\n\t\t}\n\t\tconst testValue = this.getTestValue();\n\t\tif (typeof testValue === 'symbol') {\n\t\t\tconst { brokenFlow } = context;\n\t\t\tif (this.consequent.hasEffects(context)) return true;\n\t\t\tconst consequentBrokenFlow = context.brokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\tif (this.alternate === null) return false;\n\t\t\tif (this.alternate.hasEffects(context)) return true;\n\t\t\tcontext.brokenFlow =\n\t\t\t\tcontext.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;\n\t\t\treturn false;\n\t\t}\n\t\treturn testValue ? this.consequent.hasEffects(context) : !!this.alternate?.hasEffects(context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tif (includeChildrenRecursively) {\n\t\t\tthis.includeRecursively(includeChildrenRecursively, context);\n\t\t} else {\n\t\t\tconst testValue = this.getTestValue();\n\t\t\tif (typeof testValue === 'symbol') {\n\t\t\t\tthis.includeUnknownTest(context);\n\t\t\t} else {\n\t\t\t\tthis.includeKnownTest(context, testValue);\n\t\t\t}\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.consequentScope = new TrackingScope(this.scope);\n\t\tthis.consequent = new (this.context.getNodeConstructor(esTreeNode.consequent.type))(\n\t\t\tesTreeNode.consequent,\n\t\t\tthis,\n\t\t\tthis.consequentScope\n\t\t);\n\t\tif (esTreeNode.alternate) {\n\t\t\tthis.alternateScope = new TrackingScope(this.scope);\n\t\t\tthis.alternate = new (this.context.getNodeConstructor(esTreeNode.alternate.type))(\n\t\t\t\tesTreeNode.alternate,\n\t\t\t\tthis,\n\t\t\t\tthis.alternateScope\n\t\t\t);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\tsnippets: { getPropertyAccess }\n\t\t} = options;\n\t\t// Note that unknown test values are always included\n\t\tconst testValue = this.getTestValue();\n\t\tconst hoistedDeclarations: Identifier[] = [];\n\t\tconst includesIfElse = this.test.included;\n\t\tconst noTreeshake = !this.context.options.treeshake;\n\t\tif (includesIfElse) {\n\t\t\tthis.test.render(code, options);\n\t\t} else {\n\t\t\tcode.remove(this.start, this.consequent.start);\n\t\t}\n\t\tif (this.consequent.included && (noTreeshake || typeof testValue === 'symbol' || testValue)) {\n\t\t\tthis.consequent.render(code, options);\n\t\t} else {\n\t\t\tcode.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : '');\n\t\t\thoistedDeclarations.push(...this.consequentScope.hoistedDeclarations);\n\t\t}\n\t\tif (this.alternate) {\n\t\t\tif (this.alternate.included && (noTreeshake || typeof testValue === 'symbol' || !testValue)) {\n\t\t\t\tif (includesIfElse) {\n\t\t\t\t\tif (code.original.charCodeAt(this.alternate.start - 1) === 101) {\n\t\t\t\t\t\tcode.prependLeft(this.alternate.start, ' ');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcode.remove(this.consequent.end, this.alternate.start);\n\t\t\t\t}\n\t\t\t\tthis.alternate.render(code, options);\n\t\t\t} else {\n\t\t\t\tif (includesIfElse && this.shouldKeepAlternateBranch()) {\n\t\t\t\t\tcode.overwrite(this.alternate.start, this.end, ';');\n\t\t\t\t} else {\n\t\t\t\t\tcode.remove(this.consequent.end, this.end);\n\t\t\t\t}\n\t\t\t\thoistedDeclarations.push(...this.alternateScope!.hoistedDeclarations);\n\t\t\t}\n\t\t}\n\t\tthis.renderHoistedDeclarations(hoistedDeclarations, code, getPropertyAccess);\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getTestValue(): LiteralValueOrUnknown {\n\t\tif (this.testValue === unset) {\n\t\t\treturn (this.testValue = this.test.getLiteralValueAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.testValue;\n\t}\n\n\tprivate includeKnownTest(context: InclusionContext, testValue: LiteralValueOrUnknown) {\n\t\tif (this.test.shouldBeIncluded(context)) {\n\t\t\tthis.test.include(context, false);\n\t\t}\n\t\tif (testValue && this.consequent.shouldBeIncluded(context)) {\n\t\t\tthis.consequent.include(context, false, { asSingleStatement: true });\n\t\t}\n\t\tif (!testValue && this.alternate?.shouldBeIncluded(context)) {\n\t\t\tthis.alternate.include(context, false, { asSingleStatement: true });\n\t\t}\n\t}\n\n\tprivate includeRecursively(\n\t\tincludeChildrenRecursively: true | 'variables',\n\t\tcontext: InclusionContext\n\t) {\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tthis.consequent.include(context, includeChildrenRecursively);\n\t\tthis.alternate?.include(context, includeChildrenRecursively);\n\t}\n\n\tprivate includeUnknownTest(context: InclusionContext) {\n\t\tthis.test.include(context, false);\n\t\tconst { brokenFlow } = context;\n\t\tlet consequentBrokenFlow = BROKEN_FLOW_NONE;\n\t\tif (this.consequent.shouldBeIncluded(context)) {\n\t\t\tthis.consequent.include(context, false, { asSingleStatement: true });\n\t\t\tconsequentBrokenFlow = context.brokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tif (this.alternate?.shouldBeIncluded(context)) {\n\t\t\tthis.alternate.include(context, false, { asSingleStatement: true });\n\t\t\tcontext.brokenFlow =\n\t\t\t\tcontext.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;\n\t\t}\n\t}\n\n\tprivate renderHoistedDeclarations(\n\t\thoistedDeclarations: readonly Identifier[],\n\t\tcode: MagicString,\n\t\tgetPropertyAccess: (name: string) => string\n\t) {\n\t\tconst hoistedVars = [\n\t\t\t...new Set(\n\t\t\t\thoistedDeclarations.map(identifier => {\n\t\t\t\t\tconst variable = identifier.variable!;\n\t\t\t\t\treturn variable.included ? variable.getName(getPropertyAccess) : '';\n\t\t\t\t})\n\t\t\t)\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(', ');\n\t\tif (hoistedVars) {\n\t\t\tconst parentType = this.parent.type;\n\t\t\tconst needsBraces = parentType !== NodeType.Program && parentType !== NodeType.BlockStatement;\n\t\t\tcode.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);\n\t\t\tif (needsBraces) {\n\t\t\t\tcode.appendLeft(this.end, ` }`);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate shouldKeepAlternateBranch() {\n\t\tlet currentParent = this.parent;\n\t\tdo {\n\t\t\tif (currentParent instanceof IfStatement && currentParent.alternate) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (currentParent instanceof BlockStatement) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcurrentParent = (currentParent as any).parent;\n\t\t} while (currentParent);\n\t\treturn false;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type ImportDefaultSpecifier from './ImportDefaultSpecifier';\nimport type ImportNamespaceSpecifier from './ImportNamespaceSpecifier';\nimport type ImportSpecifier from './ImportSpecifier';\nimport type Literal from './Literal';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportDeclaration extends NodeBase {\n\tdeclare needsBoundaries: true;\n\tdeclare source: Literal;\n\tdeclare specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[];\n\tdeclare type: NodeType.tImportDeclaration;\n\n\t// Do not bind specifiers\n\tbind(): void {}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addImport(this);\n\t}\n\n\trender(code: MagicString, _options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tcode.remove(nodeRenderOptions!.start!, nodeRenderOptions!.end!);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n\nImportDeclaration.prototype.needsBoundaries = true;\n","import { GenerateCodeSnippets } from './generateCodeSnippets';\n\nconst INTEROP_DEFAULT_VARIABLE = '_interopDefault';\nconst INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy';\nconst INTEROP_NAMESPACE_VARIABLE = '_interopNamespace';\nconst INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';\nexport const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';\nexport const MERGE_NAMESPACES_VARIABLE = '_mergeNamespaces';\n\nexport const defaultInteropHelpersByInteropType: { [interopType: string]: string | null } = {\n\tauto: INTEROP_DEFAULT_VARIABLE,\n\tdefault: null,\n\tdefaultOnly: null,\n\tesModule: null,\n\tfalse: null,\n\ttrue: INTEROP_DEFAULT_LEGACY_VARIABLE\n};\n\nexport const isDefaultAProperty = (interopType: string, externalLiveBindings: boolean): boolean =>\n\tinteropType === 'esModule' ||\n\t(externalLiveBindings && (interopType === 'auto' || interopType === 'true'));\n\nexport const namespaceInteropHelpersByInteropType: { [interopType: string]: string | null } = {\n\tauto: INTEROP_NAMESPACE_VARIABLE,\n\tdefault: INTEROP_NAMESPACE_DEFAULT_VARIABLE,\n\tdefaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tesModule: null,\n\tfalse: null,\n\ttrue: INTEROP_NAMESPACE_VARIABLE\n};\n\nexport const canDefaultBeTakenFromNamespace = (\n\tinteropType: string,\n\texternalLiveBindings: boolean\n): boolean =>\n\tisDefaultAProperty(interopType, externalLiveBindings) &&\n\tdefaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE;\n\nexport const getHelpersBlock = (\n\tadditionalHelpers: ReadonlySet | null,\n\taccessedGlobals: ReadonlySet,\n\tindent: string,\n\tsnippets: GenerateCodeSnippets,\n\tliveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean\n): string => {\n\tconst usedHelpers = new Set(additionalHelpers);\n\tfor (const variable of HELPER_NAMES) {\n\t\tif (accessedGlobals.has(variable)) {\n\t\t\tusedHelpers.add(variable);\n\t\t}\n\t}\n\treturn HELPER_NAMES.map(variable =>\n\t\tusedHelpers.has(variable)\n\t\t\t? HELPER_GENERATORS[variable](\n\t\t\t\t\tindent,\n\t\t\t\t\tsnippets,\n\t\t\t\t\tliveBindings,\n\t\t\t\t\tfreeze,\n\t\t\t\t\tnamespaceToStringTag,\n\t\t\t\t\tusedHelpers\n\t\t\t )\n\t\t\t: ''\n\t).join('');\n};\n\nconst HELPER_GENERATORS: {\n\t[variable: string]: (\n\t\tindent: string,\n\t\tsnippets: GenerateCodeSnippets,\n\t\tliveBindings: boolean,\n\t\tfreeze: boolean,\n\t\tnamespaceToStringTag: boolean,\n\t\tusedHelpers: ReadonlySet\n\t) => string;\n} = {\n\t[INTEROP_DEFAULT_LEGACY_VARIABLE](_t, snippets, liveBindings) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_DEFAULT_LEGACY_VARIABLE\n\t\t});\n\t\treturn (\n\t\t\t`${left}e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` +\n\t\t\t`${\n\t\t\t\tliveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)\n\t\t\t}${right}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_DEFAULT_VARIABLE](_t, snippets, liveBindings) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_DEFAULT_VARIABLE\n\t\t});\n\t\treturn (\n\t\t\t`${left}e${_}&&${_}e.__esModule${_}?${_}` +\n\t\t\t`${\n\t\t\t\tliveBindings ? getDefaultLiveBinding(snippets) : getDefaultStatic(snippets)\n\t\t\t}${right}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE](\n\t\t_t,\n\t\tsnippets,\n\t\t_liveBindings: boolean,\n\t\tfreeze: boolean,\n\t\tnamespaceToStringTag: boolean\n\t) {\n\t\tconst { getDirectReturnFunction, getObject, n } = snippets;\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE\n\t\t});\n\t\treturn `${left}${getFrozen(\n\t\t\tfreeze,\n\t\t\tgetWithToStringTag(\n\t\t\t\tnamespaceToStringTag,\n\t\t\t\tgetObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t['__proto__', 'null'],\n\t\t\t\t\t\t['default', 'e']\n\t\t\t\t\t],\n\t\t\t\t\t{ lineBreakIndent: null }\n\t\t\t\t),\n\t\t\t\tsnippets\n\t\t\t)\n\t\t)}${right}${n}${n}`;\n\t},\n\t[INTEROP_NAMESPACE_DEFAULT_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) {\n\t\tconst { _, n } = snippets;\n\t\treturn (\n\t\t\t`function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` +\n\t\t\tcreateNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) +\n\t\t\t`}${n}${n}`\n\t\t);\n\t},\n\t[INTEROP_NAMESPACE_VARIABLE](\n\t\tt,\n\t\tsnippets,\n\t\tliveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\tusedHelpers\n\t) {\n\t\tconst { _, getDirectReturnFunction, n } = snippets;\n\t\tif (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)) {\n\t\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: INTEROP_NAMESPACE_VARIABLE\n\t\t\t});\n\t\t\treturn `${left}e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${right}${n}${n}`;\n\t\t}\n\t\treturn (\n\t\t\t`function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` +\n\t\t\t`${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` +\n\t\t\tcreateNamespaceObject(t, t, snippets, liveBindings, freeze, namespaceToStringTag) +\n\t\t\t`}${n}${n}`\n\t\t);\n\t},\n\t[MERGE_NAMESPACES_VARIABLE](t, snippets, liveBindings, freeze, namespaceToStringTag) {\n\t\tconst { _, cnst, n } = snippets;\n\t\tconst useForEach = cnst === 'var' && liveBindings;\n\t\treturn (\n\t\t\t`function ${MERGE_NAMESPACES_VARIABLE}(n, m)${_}{${n}` +\n\t\t\t`${t}${loopOverNamespaces(\n\t\t\t\t`{${n}` +\n\t\t\t\t\t`${t}${t}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!(k in n))${_}{${n}` +\n\t\t\t\t\t(liveBindings\n\t\t\t\t\t\t? useForEach\n\t\t\t\t\t\t\t? copyOwnPropertyLiveBinding\n\t\t\t\t\t\t\t: copyPropertyLiveBinding\n\t\t\t\t\t\t: copyPropertyStatic)(t, t + t + t + t, snippets) +\n\t\t\t\t\t`${t}${t}${t}}${n}` +\n\t\t\t\t\t`${t}${t}}`,\n\t\t\t\tuseForEach,\n\t\t\t\tt,\n\t\t\t\tsnippets\n\t\t\t)}${n}` +\n\t\t\t`${t}return ${getFrozen(\n\t\t\t\tfreeze,\n\t\t\t\tgetWithToStringTag(namespaceToStringTag, 'n', snippets)\n\t\t\t)};${n}` +\n\t\t\t`}${n}${n}`\n\t\t);\n\t}\n};\n\nconst getDefaultLiveBinding = ({ _, getObject }: GenerateCodeSnippets) =>\n\t`e${_}:${_}${getObject([['default', 'e']], { lineBreakIndent: null })}`;\n\nconst getDefaultStatic = ({ _, getPropertyAccess }: GenerateCodeSnippets) =>\n\t`e${getPropertyAccess('default')}${_}:${_}e`;\n\nconst createNamespaceObject = (\n\tt: string,\n\ti: string,\n\tsnippets: GenerateCodeSnippets,\n\tliveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean\n) => {\n\tconst { _, cnst, getObject, getPropertyAccess, n, s } = snippets;\n\tconst copyProperty =\n\t\t`{${n}` +\n\t\t(liveBindings ? copyNonDefaultOwnPropertyLiveBinding : copyPropertyStatic)(\n\t\t\tt,\n\t\t\ti + t + t,\n\t\t\tsnippets\n\t\t) +\n\t\t`${i}${t}}`;\n\treturn (\n\t\t`${i}${cnst} n${_}=${_}Object.create(null${\n\t\t\tnamespaceToStringTag\n\t\t\t\t? `,${_}{${_}[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}${_}}`\n\t\t\t\t: ''\n\t\t});${n}` +\n\t\t`${i}if${_}(e)${_}{${n}` +\n\t\t`${i}${t}${loopOverKeys(copyProperty, !liveBindings, snippets)}${n}` +\n\t\t`${i}}${n}` +\n\t\t`${i}n${getPropertyAccess('default')}${_}=${_}e;${n}` +\n\t\t`${i}return ${getFrozen(freeze, 'n')}${s}${n}`\n\t);\n};\n\nconst loopOverKeys = (\n\tbody: string,\n\tallowVarLoopVariable: boolean,\n\t{ _, cnst, getFunctionIntro, s }: GenerateCodeSnippets\n) =>\n\tcnst !== 'var' || allowVarLoopVariable\n\t\t? `for${_}(${cnst} k in e)${_}${body}`\n\t\t: `Object.keys(e).forEach(${getFunctionIntro(['k'], {\n\t\t\t\tisAsync: false,\n\t\t\t\tname: null\n\t\t })}${body})${s}`;\n\nconst loopOverNamespaces = (\n\tbody: string,\n\tuseForEach: boolean,\n\tt: string,\n\t{ _, cnst, getDirectReturnFunction, getFunctionIntro, n }: GenerateCodeSnippets\n) => {\n\tif (useForEach) {\n\t\tconst [left, right] = getDirectReturnFunction(['e'], {\n\t\t\tfunctionReturn: false,\n\t\t\tlineBreakIndent: { base: t, t },\n\t\t\tname: null\n\t\t});\n\t\treturn (\n\t\t\t`m.forEach(${left}` +\n\t\t\t`e${_}&&${_}typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e)${_}&&${_}Object.keys(e).forEach(${getFunctionIntro(\n\t\t\t\t['k'],\n\t\t\t\t{\n\t\t\t\t\tisAsync: false,\n\t\t\t\t\tname: null\n\t\t\t\t}\n\t\t\t)}${body})${right});`\n\t\t);\n\t}\n\treturn (\n\t\t`for${_}(var i${_}=${_}0;${_}i${_}<${_}m.length;${_}i++)${_}{${n}` +\n\t\t`${t}${t}${cnst} e${_}=${_}m[i];${n}` +\n\t\t`${t}${t}if${_}(typeof e${_}!==${_}'string'${_}&&${_}!Array.isArray(e))${_}{${_}for${_}(${cnst} k in e)${_}${body}${_}}${n}${t}}`\n\t);\n};\n\nconst copyNonDefaultOwnPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\tsnippets: GenerateCodeSnippets\n) => {\n\tconst { _, n } = snippets;\n\treturn (\n\t\t`${i}if${_}(k${_}!==${_}'default')${_}{${n}` +\n\t\tcopyOwnPropertyLiveBinding(t, i + t, snippets) +\n\t\t`${i}}${n}`\n\t);\n};\n\nconst copyOwnPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\t{ _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tconst [left, right] = getDirectReturnFunction([], {\n\t\tfunctionReturn: true,\n\t\tlineBreakIndent: null,\n\t\tname: null\n\t});\n\treturn (\n\t\t`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +\n\t\t`${i}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +\n\t\t`${i}${t}enumerable:${_}true,${n}` +\n\t\t`${i}${t}get:${_}${left}e[k]${right}${n}` +\n\t\t`${i}});${n}`\n\t);\n};\n\nconst copyPropertyLiveBinding = (\n\tt: string,\n\ti: string,\n\t{ _, cnst, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tconst [left, right] = getDirectReturnFunction([], {\n\t\tfunctionReturn: true,\n\t\tlineBreakIndent: null,\n\t\tname: null\n\t});\n\treturn (\n\t\t`${i}${cnst} d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +\n\t\t`${i}if${_}(d)${_}{${n}` +\n\t\t`${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +\n\t\t`${i}${t}${t}enumerable:${_}true,${n}` +\n\t\t`${i}${t}${t}get:${_}${left}e[k]${right}${n}` +\n\t\t`${i}${t}});${n}` +\n\t\t`${i}}${n}`\n\t);\n};\n\nconst copyPropertyStatic = (_t: string, i: string, { _, n }: GenerateCodeSnippets) =>\n\t`${i}n[k]${_}=${_}e[k];${n}`;\n\nconst getFrozen = (freeze: boolean, fragment: string) =>\n\tfreeze ? `Object.freeze(${fragment})` : fragment;\n\nconst getWithToStringTag = (\n\tnamespaceToStringTag: boolean,\n\tfragment: string,\n\t{ _, getObject }: GenerateCodeSnippets\n) =>\n\tnamespaceToStringTag\n\t\t? `Object.defineProperty(${fragment},${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\tgetObject\n\t\t )})`\n\t\t: fragment;\n\nexport const HELPER_NAMES = Object.keys(HELPER_GENERATORS);\n\nexport function getToStringTagValue(getObject: GenerateCodeSnippets['getObject']) {\n\treturn getObject([['value', \"'Module'\"]], {\n\t\tlineBreakIndent: null\n\t});\n}\n","import type MagicString from 'magic-string';\nimport ExternalModule from '../../ExternalModule';\nimport type Module from '../../Module';\nimport type { GetInterop, NormalizedOutputOptions } from '../../rollup/types';\nimport type { PluginDriver } from '../../utils/PluginDriver';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\nimport { findFirstOccurrenceOutsideComment, type RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport type ChildScope from '../scopes/ChildScope';\nimport type NamespaceVariable from '../variables/NamespaceVariable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\ninterface DynamicImportMechanism {\n\tleft: string;\n\tright: string;\n}\n\nexport default class ImportExpression extends NodeBase {\n\tinlineNamespace: NamespaceVariable | null = null;\n\tdeclare source: ExpressionNode;\n\tdeclare type: NodeType.tImportExpression;\n\n\tprivate mechanism: DynamicImportMechanism | null = null;\n\tprivate resolution: Module | ExternalModule | string | null = null;\n\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeDynamicImport(this);\n\t\t\tthis.scope.addAccessedDynamicImport(this);\n\t\t}\n\t\tthis.source.include(context, includeChildrenRecursively);\n\t}\n\n\tinitialise(): void {\n\t\tthis.context.addDynamicImport(this);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.inlineNamespace) {\n\t\t\tconst {\n\t\t\t\tsnippets: { getDirectReturnFunction, getPropertyAccess }\n\t\t\t} = options;\n\t\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tthis.end,\n\t\t\t\t`Promise.resolve().then(${left}${this.inlineNamespace.getName(getPropertyAccess)}${right})`,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.mechanism) {\n\t\t\tcode.overwrite(\n\t\t\t\tthis.start,\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1,\n\t\t\t\tthis.mechanism.left,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\tcode.overwrite(this.end - 1, this.end, this.mechanism.right, { contentOnly: true });\n\t\t}\n\t\tthis.source.render(code, options);\n\t}\n\n\trenderFinalResolution(\n\t\tcode: MagicString,\n\t\tresolution: string,\n\t\tnamespaceExportName: string | false | undefined,\n\t\t{ getDirectReturnFunction }: GenerateCodeSnippets\n\t): void {\n\t\tcode.overwrite(this.source.start, this.source.end, resolution);\n\t\tif (namespaceExportName) {\n\t\t\tconst [left, right] = getDirectReturnFunction(['n'], {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\tcode.prependLeft(this.end, `.then(${left}n.${namespaceExportName}${right})`);\n\t\t}\n\t}\n\n\tsetExternalResolution(\n\t\texportMode: 'none' | 'named' | 'default' | 'external',\n\t\tresolution: Module | ExternalModule | string | null,\n\t\toptions: NormalizedOutputOptions,\n\t\tsnippets: GenerateCodeSnippets,\n\t\tpluginDriver: PluginDriver,\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst { format } = options;\n\t\tthis.inlineNamespace = null;\n\t\tthis.resolution = resolution;\n\t\tconst accessedGlobals = [...(accessedImportGlobals[format] || [])];\n\t\tlet helper: string | null;\n\t\t({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(\n\t\t\tresolution,\n\t\t\texportMode,\n\t\t\toptions,\n\t\t\tsnippets,\n\t\t\tpluginDriver\n\t\t));\n\t\tif (helper) {\n\t\t\taccessedGlobals.push(helper);\n\t\t}\n\t\tif (accessedGlobals.length > 0) {\n\t\t\tthis.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tsetInternalResolution(inlineNamespace: NamespaceVariable): void {\n\t\tthis.inlineNamespace = inlineNamespace;\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getDynamicImportMechanismAndHelper(\n\t\tresolution: Module | ExternalModule | string | null,\n\t\texportMode: 'none' | 'named' | 'default' | 'external',\n\t\t{\n\t\t\tcompact,\n\t\t\tdynamicImportFunction,\n\t\t\tformat,\n\t\t\tgeneratedCode: { arrowFunctions },\n\t\t\tinterop\n\t\t}: NormalizedOutputOptions,\n\t\t{ _, getDirectReturnFunction, getDirectReturnIifeLeft }: GenerateCodeSnippets,\n\t\tpluginDriver: PluginDriver\n\t): { helper: string | null; mechanism: DynamicImportMechanism | null } {\n\t\tconst mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [\n\t\t\t{\n\t\t\t\tcustomResolution: typeof this.resolution === 'string' ? this.resolution : null,\n\t\t\t\tformat,\n\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\ttargetModuleId:\n\t\t\t\t\tthis.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null\n\t\t\t}\n\t\t]);\n\t\tif (mechanism) {\n\t\t\treturn { helper: null, mechanism };\n\t\t}\n\t\tconst hasDynamicTarget = !this.resolution || typeof this.resolution === 'string';\n\t\tswitch (format) {\n\t\t\tcase 'cjs': {\n\t\t\t\tconst helper = getInteropHelper(resolution, exportMode, interop);\n\t\t\t\tlet left = `require(`;\n\t\t\t\tlet right = `)`;\n\t\t\t\tif (helper) {\n\t\t\t\t\tleft = `/*#__PURE__*/${helper}(${left}`;\n\t\t\t\t\tright += ')';\n\t\t\t\t}\n\t\t\t\tconst [functionLeft, functionRight] = getDirectReturnFunction([], {\n\t\t\t\t\tfunctionReturn: true,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tleft = `Promise.resolve().then(${functionLeft}${left}`;\n\t\t\t\tright += `${functionRight})`;\n\t\t\t\tif (!arrowFunctions && hasDynamicTarget) {\n\t\t\t\t\tleft = getDirectReturnIifeLeft(['t'], `${left}t${right}`, {\n\t\t\t\t\t\tneedsArrowReturnParens: false,\n\t\t\t\t\t\tneedsWrappedFunction: true\n\t\t\t\t\t});\n\t\t\t\t\tright = ')';\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\thelper,\n\t\t\t\t\tmechanism: { left, right }\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase 'amd': {\n\t\t\t\tconst resolve = compact ? 'c' : 'resolve';\n\t\t\t\tconst reject = compact ? 'e' : 'reject';\n\t\t\t\tconst helper = getInteropHelper(resolution, exportMode, interop);\n\t\t\t\tconst [resolveLeft, resolveRight] = getDirectReturnFunction(['m'], {\n\t\t\t\t\tfunctionReturn: false,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tconst resolveNamespace = helper\n\t\t\t\t\t? `${resolveLeft}${resolve}(/*#__PURE__*/${helper}(m))${resolveRight}`\n\t\t\t\t\t: resolve;\n\t\t\t\tconst [handlerLeft, handlerRight] = getDirectReturnFunction([resolve, reject], {\n\t\t\t\t\tfunctionReturn: false,\n\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\tname: null\n\t\t\t\t});\n\t\t\t\tlet left = `new Promise(${handlerLeft}require([`;\n\t\t\t\tlet right = `],${_}${resolveNamespace},${_}${reject})${handlerRight})`;\n\t\t\t\tif (!arrowFunctions && hasDynamicTarget) {\n\t\t\t\t\tleft = getDirectReturnIifeLeft(['t'], `${left}t${right}`, {\n\t\t\t\t\t\tneedsArrowReturnParens: false,\n\t\t\t\t\t\tneedsWrappedFunction: true\n\t\t\t\t\t});\n\t\t\t\t\tright = ')';\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\thelper,\n\t\t\t\t\tmechanism: { left, right }\n\t\t\t\t};\n\t\t\t}\n\t\t\tcase 'system':\n\t\t\t\treturn {\n\t\t\t\t\thelper: null,\n\t\t\t\t\tmechanism: {\n\t\t\t\t\t\tleft: 'module.import(',\n\t\t\t\t\t\tright: ')'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\tcase 'es':\n\t\t\t\tif (dynamicImportFunction) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\thelper: null,\n\t\t\t\t\t\tmechanism: {\n\t\t\t\t\t\t\tleft: `${dynamicImportFunction}(`,\n\t\t\t\t\t\t\tright: ')'\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t}\n\t\treturn { helper: null, mechanism: null };\n\t}\n}\n\nfunction getInteropHelper(\n\tresolution: Module | ExternalModule | string | null,\n\texportMode: 'none' | 'named' | 'default' | 'external',\n\tinterop: GetInterop\n): string | null {\n\treturn exportMode === 'external'\n\t\t? namespaceInteropHelpersByInteropType[\n\t\t\t\tString(interop(resolution instanceof ExternalModule ? resolution.id : null))\n\t\t ]\n\t\t: exportMode === 'default'\n\t\t? INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE\n\t\t: null;\n}\n\nconst accessedImportGlobals: Record = {\n\tamd: ['require'],\n\tcjs: ['require'],\n\tsystem: ['module']\n};\n","import type MagicString from 'magic-string';\nimport type { InternalModuleFormat } from '../../rollup/types';\nimport type { PluginDriver } from '../../utils/PluginDriver';\nimport { warnDeprecation } from '../../utils/error';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport { dirname, normalize, relative } from '../../utils/path';\nimport { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions';\nimport type ChildScope from '../scopes/ChildScope';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport type Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nconst ASSET_PREFIX = 'ROLLUP_ASSET_URL_';\nconst CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_';\nconst FILE_PREFIX = 'ROLLUP_FILE_URL_';\n\nexport default class MetaProperty extends NodeBase {\n\tdeclare meta: Identifier;\n\tdeclare property: Identifier;\n\tdeclare type: NodeType.tMetaProperty;\n\n\tprivate declare metaProperty?: string | null;\n\n\taddAccessedGlobals(\n\t\tformat: InternalModuleFormat,\n\t\taccessedGlobalsByScope: Map>\n\t): void {\n\t\tconst metaProperty = this.metaProperty;\n\t\tconst accessedGlobals = (\n\t\t\tmetaProperty &&\n\t\t\t(metaProperty.startsWith(FILE_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(ASSET_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(CHUNK_PREFIX))\n\t\t\t\t? accessedFileUrlGlobals\n\t\t\t\t: accessedMetaUrlGlobals\n\t\t)[format];\n\t\tif (accessedGlobals.length > 0) {\n\t\t\tthis.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);\n\t\t}\n\t}\n\n\tgetReferencedFileName(outputPluginDriver: PluginDriver): string | null {\n\t\tconst metaProperty = this.metaProperty as string | null;\n\t\tif (metaProperty && metaProperty.startsWith(FILE_PREFIX)) {\n\t\t\treturn outputPluginDriver.getFileName(metaProperty.substring(FILE_PREFIX.length));\n\t\t}\n\t\treturn null;\n\t}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 1 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tif (this.meta.name === 'import') {\n\t\t\t\tthis.context.addImportMeta(this);\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tthis.metaProperty =\n\t\t\t\t\tparent instanceof MemberExpression && typeof parent.propertyKey === 'string'\n\t\t\t\t\t\t? parent.propertyKey\n\t\t\t\t\t\t: null;\n\t\t\t}\n\t\t}\n\t}\n\n\trenderFinalMechanism(\n\t\tcode: MagicString,\n\t\tchunkId: string,\n\t\tformat: InternalModuleFormat,\n\t\tsnippets: GenerateCodeSnippets,\n\t\toutputPluginDriver: PluginDriver\n\t): void {\n\t\tconst parent = this.parent;\n\t\tconst metaProperty = this.metaProperty as string | null;\n\n\t\tif (\n\t\t\tmetaProperty &&\n\t\t\t(metaProperty.startsWith(FILE_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(ASSET_PREFIX) ||\n\t\t\t\tmetaProperty.startsWith(CHUNK_PREFIX))\n\t\t) {\n\t\t\tlet referenceId: string | null = null;\n\t\t\tlet assetReferenceId: string | null = null;\n\t\t\tlet chunkReferenceId: string | null = null;\n\t\t\tlet fileName: string;\n\t\t\tif (metaProperty.startsWith(FILE_PREFIX)) {\n\t\t\t\treferenceId = metaProperty.substring(FILE_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(referenceId);\n\t\t\t} else if (metaProperty.startsWith(ASSET_PREFIX)) {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t`Using the \"${ASSET_PREFIX}\" prefix to reference files is deprecated. Use the \"${FILE_PREFIX}\" prefix instead.`,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.context.options\n\t\t\t\t);\n\t\t\t\tassetReferenceId = metaProperty.substring(ASSET_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(assetReferenceId);\n\t\t\t} else {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t`Using the \"${CHUNK_PREFIX}\" prefix to reference files is deprecated. Use the \"${FILE_PREFIX}\" prefix instead.`,\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.context.options\n\t\t\t\t);\n\t\t\t\tchunkReferenceId = metaProperty.substring(CHUNK_PREFIX.length);\n\t\t\t\tfileName = outputPluginDriver.getFileName(chunkReferenceId);\n\t\t\t}\n\t\t\tconst relativePath = normalize(relative(dirname(chunkId), fileName));\n\t\t\tlet replacement;\n\t\t\tif (assetReferenceId !== null) {\n\t\t\t\treplacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [\n\t\t\t\t\t{\n\t\t\t\t\t\tassetFileName: fileName,\n\t\t\t\t\t\tchunkId,\n\t\t\t\t\t\tformat,\n\t\t\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\t\t\trelativeAssetPath: relativePath\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif (!replacement) {\n\t\t\t\treplacement =\n\t\t\t\t\toutputPluginDriver.hookFirstSync('resolveFileUrl', [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tassetReferenceId,\n\t\t\t\t\t\t\tchunkId,\n\t\t\t\t\t\t\tchunkReferenceId,\n\t\t\t\t\t\t\tfileName,\n\t\t\t\t\t\t\tformat,\n\t\t\t\t\t\t\tmoduleId: this.context.module.id,\n\t\t\t\t\t\t\treferenceId: referenceId || assetReferenceId || chunkReferenceId!,\n\t\t\t\t\t\t\trelativePath\n\t\t\t\t\t\t}\n\t\t\t\t\t]) || relativeUrlMechanisms[format](relativePath);\n\t\t\t}\n\n\t\t\tcode.overwrite(\n\t\t\t\t(parent as MemberExpression).start,\n\t\t\t\t(parent as MemberExpression).end,\n\t\t\t\treplacement,\n\t\t\t\t{ contentOnly: true }\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst replacement =\n\t\t\toutputPluginDriver.hookFirstSync('resolveImportMeta', [\n\t\t\t\tmetaProperty,\n\t\t\t\t{\n\t\t\t\t\tchunkId,\n\t\t\t\t\tformat,\n\t\t\t\t\tmoduleId: this.context.module.id\n\t\t\t\t}\n\t\t\t]) || importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });\n\t\tif (typeof replacement === 'string') {\n\t\t\tif (parent instanceof MemberExpression) {\n\t\t\t\tcode.overwrite(parent.start, parent.end, replacement, { contentOnly: true });\n\t\t\t} else {\n\t\t\t\tcode.overwrite(this.start, this.end, replacement, { contentOnly: true });\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst accessedMetaUrlGlobals = {\n\tamd: ['document', 'module', 'URL'],\n\tcjs: ['document', 'require', 'URL'],\n\tes: [],\n\tiife: ['document', 'URL'],\n\tsystem: ['module'],\n\tumd: ['document', 'require', 'URL']\n};\n\nconst accessedFileUrlGlobals = {\n\tamd: ['document', 'require', 'URL'],\n\tcjs: ['document', 'require', 'URL'],\n\tes: [],\n\tiife: ['document', 'URL'],\n\tsystem: ['module', 'URL'],\n\tumd: ['document', 'require', 'URL']\n};\n\nconst getResolveUrl = (path: string, URL = 'URL') => `new ${URL}(${path}).href`;\n\nconst getRelativeUrlFromDocument = (relativePath: string, umd = false) =>\n\tgetResolveUrl(\n\t\t`'${relativePath}', ${\n\t\t\tumd ? `typeof document === 'undefined' ? location.href : ` : ''\n\t\t}document.currentScript && document.currentScript.src || document.baseURI`\n\t);\n\nconst getGenericImportMetaMechanism =\n\t(getUrl: (chunkId: string) => string) =>\n\t(prop: string | null, { chunkId }: { chunkId: string }) => {\n\t\tconst urlMechanism = getUrl(chunkId);\n\t\treturn prop === null\n\t\t\t? `({ url: ${urlMechanism} })`\n\t\t\t: prop === 'url'\n\t\t\t? urlMechanism\n\t\t\t: 'undefined';\n\t};\n\nconst getUrlFromDocument = (chunkId: string, umd = false) =>\n\t`${\n\t\tumd ? `typeof document === 'undefined' ? location.href : ` : ''\n\t}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;\n\nconst relativeUrlMechanisms: Record string> = {\n\tamd: relativePath => {\n\t\tif (relativePath[0] !== '.') relativePath = './' + relativePath;\n\t\treturn getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);\n\t},\n\tcjs: relativePath =>\n\t\t`(typeof document === 'undefined' ? ${getResolveUrl(\n\t\t\t`'file:' + __dirname + '/${relativePath}'`,\n\t\t\t`(require('u' + 'rl').URL)`\n\t\t)} : ${getRelativeUrlFromDocument(relativePath)})`,\n\tes: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`),\n\tiife: relativePath => getRelativeUrlFromDocument(relativePath),\n\tsystem: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),\n\tumd: relativePath =>\n\t\t`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(\n\t\t\t`'file:' + __dirname + '/${relativePath}'`,\n\t\t\t`(require('u' + 'rl').URL)`\n\t\t)} : ${getRelativeUrlFromDocument(relativePath, true)})`\n};\n\nconst importMetaMechanisms: Record<\n\tstring,\n\t(prop: string | null, options: { chunkId: string; snippets: GenerateCodeSnippets }) => string\n> = {\n\tamd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)),\n\tcjs: getGenericImportMetaMechanism(\n\t\tchunkId =>\n\t\t\t`(typeof document === 'undefined' ? ${getResolveUrl(\n\t\t\t\t`'file:' + __filename`,\n\t\t\t\t`(require('u' + 'rl').URL)`\n\t\t\t)} : ${getUrlFromDocument(chunkId)})`\n\t),\n\tiife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)),\n\tsystem: (prop, { snippets: { getPropertyAccess } }) =>\n\t\tprop === null ? `module.meta` : `module.meta${getPropertyAccess(prop)}`,\n\tumd: getGenericImportMetaMechanism(\n\t\tchunkId =>\n\t\t\t`(typeof document === 'undefined' && typeof location === 'undefined' ? ${getResolveUrl(\n\t\t\t\t`'file:' + __filename`,\n\t\t\t\t`(require('u' + 'rl').URL)`\n\t\t\t)} : ${getUrlFromDocument(chunkId, true)})`\n\t)\n};\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, NodeBase, type StatementNode } from './shared/Node';\n\nexport default class Program extends NodeBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare sourceType: 'module';\n\tdeclare type: NodeType.tProgram;\n\n\tprivate hasCachedEffect = false;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\t// We are caching here to later more efficiently identify side-effect-free modules\n\t\tif (this.hasCachedEffect) return true;\n\t\tfor (const node of this.body) {\n\t\t\tif (node.hasEffects(context)) {\n\t\t\t\treturn (this.hasCachedEffect = true);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tfor (const node of this.body) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context)) {\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start, this.end, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\ttype NodeRenderOptions,\n\ttype RenderOptions,\n\trenderStatementList\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tNodeBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class SwitchCase extends NodeBase {\n\tdeclare consequent: readonly StatementNode[];\n\tdeclare needsBoundaries: true;\n\tdeclare test: ExpressionNode | null;\n\tdeclare type: NodeType.tSwitchCase;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test?.hasEffects(context)) return true;\n\t\tfor (const node of this.consequent) {\n\t\t\tif (context.brokenFlow) break;\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test?.include(context, includeChildrenRecursively);\n\t\tfor (const node of this.consequent) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {\n\t\tif (this.consequent.length) {\n\t\t\tthis.test && this.test.render(code, options);\n\t\t\tconst testEnd = this.test\n\t\t\t\t? this.test.end\n\t\t\t\t: findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;\n\t\t\tconst consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1;\n\t\t\trenderStatementList(this.consequent, code, consequentStart, nodeRenderOptions!.end!, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n\nSwitchCase.prototype.needsBoundaries = true;\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { HasEffectsContext } from '../ExecutionContext';\nimport { INTERACTION_ACCESSED, INTERACTION_CALLED, NodeInteraction } from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport {\n\tgetMemberReturnExpressionWhenCalled,\n\thasMemberEffectWhenCalled,\n\tliteralStringMembers\n} from '../values';\nimport type * as NodeType from './NodeType';\nimport type TemplateElement from './TemplateElement';\nimport {\n\tExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class TemplateLiteral extends NodeBase {\n\tdeclare expressions: ExpressionNode[];\n\tdeclare quasis: TemplateElement[];\n\tdeclare type: NodeType.tTemplateLiteral;\n\n\tdeoptimizeThisOnInteractionAtPath(): void {}\n\n\tgetLiteralValueAtPath(path: ObjectPath): LiteralValueOrUnknown {\n\t\tif (path.length > 0 || this.quasis.length !== 1) {\n\t\t\treturn UnknownValue;\n\t\t}\n\t\treturn this.quasis[0].value.cooked;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(path: ObjectPath): ExpressionEntity {\n\t\tif (path.length !== 1) {\n\t\t\treturn UNKNOWN_EXPRESSION;\n\t\t}\n\t\treturn getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (interaction.type === INTERACTION_ACCESSED) {\n\t\t\treturn path.length > 1;\n\t\t}\n\t\tif (interaction.type === INTERACTION_CALLED && path.length === 1) {\n\t\t\treturn hasMemberEffectWhenCalled(literalStringMembers, path[0], interaction, context);\n\t\t}\n\t\treturn true;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\t(code.indentExclusionRanges as [number, number][]).push([this.start, this.end]);\n\t\tsuper.render(code, options);\n\t}\n}\n","import type { LiteralValueOrUnknown } from '../nodes/shared/Expression';\nimport Variable from './Variable';\n\nexport default class UndefinedVariable extends Variable {\n\tconstructor() {\n\t\tsuper('undefined');\n\t}\n\n\tgetLiteralValueAtPath(): LiteralValueOrUnknown {\n\t\treturn undefined;\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport ClassDeclaration from '../nodes/ClassDeclaration';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport FunctionDeclaration from '../nodes/FunctionDeclaration';\nimport Identifier, { type IdentifierWithVariable } from '../nodes/Identifier';\nimport LocalVariable from './LocalVariable';\nimport UndefinedVariable from './UndefinedVariable';\nimport type Variable from './Variable';\n\nexport default class ExportDefaultVariable extends LocalVariable {\n\thasId = false;\n\n\tprivate originalId: IdentifierWithVariable | null = null;\n\tprivate originalVariable: Variable | null = null;\n\n\tconstructor(\n\t\tname: string,\n\t\texportDefaultDeclaration: ExportDefaultDeclaration,\n\t\tcontext: AstContext\n\t) {\n\t\tsuper(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context);\n\t\tconst declaration = exportDefaultDeclaration.declaration;\n\t\tif (\n\t\t\t(declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) &&\n\t\t\tdeclaration.id\n\t\t) {\n\t\t\tthis.hasId = true;\n\t\t\tthis.originalId = declaration.id;\n\t\t} else if (declaration instanceof Identifier) {\n\t\t\tthis.originalId = declaration as IdentifierWithVariable;\n\t\t}\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tif (!this.hasId) {\n\t\t\tthis.name = identifier.name;\n\t\t}\n\t}\n\n\tgetAssignedVariableName(): string | null {\n\t\treturn (this.originalId && this.originalId.name) || null;\n\t}\n\n\tgetBaseVariableName(): string {\n\t\tconst original = this.getOriginalVariable();\n\t\tif (original === this) {\n\t\t\treturn super.getBaseVariableName();\n\t\t} else {\n\t\t\treturn original.getBaseVariableName();\n\t\t}\n\t}\n\n\tgetDirectOriginalVariable(): Variable | null {\n\t\treturn this.originalId &&\n\t\t\t(this.hasId ||\n\t\t\t\t!(\n\t\t\t\t\tthis.originalId.isPossibleTDZ() ||\n\t\t\t\t\tthis.originalId.variable.isReassigned ||\n\t\t\t\t\tthis.originalId.variable instanceof UndefinedVariable ||\n\t\t\t\t\t// this avoids a circular dependency\n\t\t\t\t\t'syntheticNamespace' in this.originalId.variable\n\t\t\t\t))\n\t\t\t? this.originalId.variable\n\t\t\t: null;\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\tconst original = this.getOriginalVariable();\n\t\tif (original === this) {\n\t\t\treturn super.getName(getPropertyAccess);\n\t\t} else {\n\t\t\treturn original.getName(getPropertyAccess);\n\t\t}\n\t}\n\n\tgetOriginalVariable(): Variable {\n\t\tif (this.originalVariable) return this.originalVariable;\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tlet original: Variable | null = this;\n\t\tlet currentVariable: Variable;\n\t\tconst checkedVariables = new Set();\n\t\tdo {\n\t\t\tcheckedVariables.add(original);\n\t\t\tcurrentVariable = original;\n\t\t\toriginal = (currentVariable as ExportDefaultVariable).getDirectOriginalVariable();\n\t\t} while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));\n\t\treturn (this.originalVariable = original || currentVariable);\n\t}\n}\n","import type { AstContext } from '../../Module';\nimport type { InternalModuleFormat } from '../../rollup/types';\nimport type ExportDefaultDeclaration from '../nodes/ExportDefaultDeclaration';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport ExportDefaultVariable from '../variables/ExportDefaultVariable';\nimport GlobalVariable from '../variables/GlobalVariable';\nimport LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport ChildScope from './ChildScope';\nimport type GlobalScope from './GlobalScope';\n\nexport default class ModuleScope extends ChildScope {\n\tcontext: AstContext;\n\tdeclare parent: GlobalScope;\n\n\tconstructor(parent: GlobalScope, context: AstContext) {\n\t\tsuper(parent);\n\t\tthis.context = context;\n\t\tthis.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context));\n\t}\n\n\taddExportDefaultDeclaration(\n\t\tname: string,\n\t\texportDefaultDeclaration: ExportDefaultDeclaration,\n\t\tcontext: AstContext\n\t): ExportDefaultVariable {\n\t\tconst variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);\n\t\tthis.variables.set('default', variable);\n\t\treturn variable;\n\t}\n\n\taddNamespaceMemberAccess(): void {}\n\n\tdeconflict(\n\t\tformat: InternalModuleFormat,\n\t\texportNamesByVariable: ReadonlyMap,\n\t\taccessedGlobalsByScope: ReadonlyMap>\n\t): void {\n\t\t// all module level variables are already deconflicted when deconflicting the chunk\n\t\tfor (const scope of this.children)\n\t\t\tscope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t}\n\n\tfindLexicalBoundary(): this {\n\t\treturn this;\n\t}\n\n\tfindVariable(name: string): Variable {\n\t\tconst knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);\n\t\tif (knownVariable) {\n\t\t\treturn knownVariable;\n\t\t}\n\t\tconst variable = this.context.traceVariable(name) || this.parent.findVariable(name);\n\t\tif (variable instanceof GlobalVariable) {\n\t\t\tthis.accessedOutsideVariables.set(name, variable);\n\t\t}\n\t\treturn variable;\n\t}\n}\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\tNodeInteraction\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, type PathTracker } from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport type { LiteralValue } from './Literal';\nimport type * as NodeType from './NodeType';\nimport { type LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nconst unaryOperators: {\n\t[operator: string]: (value: LiteralValue) => LiteralValueOrUnknown;\n} = {\n\t'!': value => !value,\n\t'+': value => +(value as NonNullable),\n\t'-': value => -(value as NonNullable),\n\tdelete: () => UnknownValue,\n\ttypeof: value => typeof value,\n\tvoid: () => undefined,\n\t'~': value => ~(value as NonNullable)\n};\n\nexport default class UnaryExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~';\n\tdeclare prefix: boolean;\n\tdeclare type: NodeType.tUnaryExpression;\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tif (path.length > 0) return UnknownValue;\n\t\tconst argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);\n\t\tif (typeof argumentValue === 'symbol') return UnknownValue;\n\n\t\treturn unaryOperators[this.operator](argumentValue);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (this.operator === 'typeof' && this.argument instanceof Identifier) return false;\n\t\treturn (\n\t\t\tthis.argument.hasEffects(context) ||\n\t\t\t(this.operator === 'delete' &&\n\t\t\t\tthis.argument.hasEffectsOnInteractionAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tNODE_INTERACTION_UNKNOWN_ASSIGNMENT,\n\t\t\t\t\tcontext\n\t\t\t\t))\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn type !== INTERACTION_ACCESSED || path.length > (this.operator === 'void' ? 0 : 1);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.operator === 'delete') {\n\t\t\tthis.argument.deoptimizePath(EMPTY_PATH);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type Variable from '../ast/variables/Variable';\n\nexport function isReassignedExportsMember(\n\tvariable: Variable,\n\texportNamesByVariable: ReadonlyMap\n): boolean {\n\treturn (\n\t\tvariable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned\n\t);\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport { isReassignedExportsMember } from '../../utils/reassignedExportsMember';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\tgetCommaSeparatedNodesWithBoundaries,\n\ttype NodeRenderOptions,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport {\n\tgetSystemExportStatement,\n\trenderSystemExportExpression\n} from '../../utils/systemJsRendering';\nimport type { InclusionContext } from '../ExecutionContext';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport Identifier, { type IdentifierWithVariable } from './Identifier';\nimport * as NodeType from './NodeType';\nimport type VariableDeclarator from './VariableDeclarator';\nimport { InclusionOptions } from './shared/Expression';\nimport { type IncludeChildren, NodeBase } from './shared/Node';\n\nfunction areAllDeclarationsIncludedAndNotExported(\n\tdeclarations: readonly VariableDeclarator[],\n\texportNamesByVariable: ReadonlyMap\n): boolean {\n\tfor (const declarator of declarations) {\n\t\tif (!declarator.id.included) return false;\n\t\tif (declarator.id.type === NodeType.Identifier) {\n\t\t\tif (exportNamesByVariable.has(declarator.id.variable!)) return false;\n\t\t} else {\n\t\t\tconst exportedVariables: Variable[] = [];\n\t\t\tdeclarator.id.addExportedVariables(exportedVariables, exportNamesByVariable);\n\t\t\tif (exportedVariables.length > 0) return false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport default class VariableDeclaration extends NodeBase {\n\tdeclare declarations: readonly VariableDeclarator[];\n\tdeclare kind: 'var' | 'let' | 'const';\n\tdeclare type: NodeType.tVariableDeclaration;\n\n\tdeoptimizePath(): void {\n\t\tfor (const declarator of this.declarations) {\n\t\t\tdeclarator.deoptimizePath(EMPTY_PATH);\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(): boolean {\n\t\treturn false;\n\t}\n\n\tinclude(\n\t\tcontext: InclusionContext,\n\t\tincludeChildrenRecursively: IncludeChildren,\n\t\t{ asSingleStatement }: InclusionOptions = BLANK\n\t): void {\n\t\tthis.included = true;\n\t\tfor (const declarator of this.declarations) {\n\t\t\tif (includeChildrenRecursively || declarator.shouldBeIncluded(context))\n\t\t\t\tdeclarator.include(context, includeChildrenRecursively);\n\t\t\tif (asSingleStatement) {\n\t\t\t\tdeclarator.id.include(context, includeChildrenRecursively);\n\t\t\t}\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tfor (const declarator of this.declarations) {\n\t\t\tdeclarator.declareDeclarator(this.kind);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\tnodeRenderOptions: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (\n\t\t\tareAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)\n\t\t) {\n\t\t\tfor (const declarator of this.declarations) {\n\t\t\t\tdeclarator.render(code, options);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!nodeRenderOptions.isNoStatement &&\n\t\t\t\tcode.original.charCodeAt(this.end - 1) !== 59 /*\";\"*/\n\t\t\t) {\n\t\t\t\tcode.appendLeft(this.end, ';');\n\t\t\t}\n\t\t} else {\n\t\t\tthis.renderReplacedDeclarations(code, options);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate renderDeclarationEnd(\n\t\tcode: MagicString,\n\t\tseparatorString: string,\n\t\tlastSeparatorPos: number | null,\n\t\tactualContentEnd: number,\n\t\trenderedContentEnd: number,\n\t\tsystemPatternExports: readonly Variable[],\n\t\toptions: RenderOptions\n\t): void {\n\t\tif (code.original.charCodeAt(this.end - 1) === 59 /*\";\"*/) {\n\t\t\tcode.remove(this.end - 1, this.end);\n\t\t}\n\t\tseparatorString += ';';\n\t\tif (lastSeparatorPos !== null) {\n\t\t\tif (\n\t\t\t\tcode.original.charCodeAt(actualContentEnd - 1) === 10 /*\"\\n\"*/ &&\n\t\t\t\t(code.original.charCodeAt(this.end) === 10 /*\"\\n\"*/ ||\n\t\t\t\t\tcode.original.charCodeAt(this.end) === 13) /*\"\\r\"*/\n\t\t\t) {\n\t\t\t\tactualContentEnd--;\n\t\t\t\tif (code.original.charCodeAt(actualContentEnd) === 13 /*\"\\r\"*/) {\n\t\t\t\t\tactualContentEnd--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (actualContentEnd === lastSeparatorPos + 1) {\n\t\t\t\tcode.overwrite(lastSeparatorPos, renderedContentEnd, separatorString);\n\t\t\t} else {\n\t\t\t\tcode.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);\n\t\t\t\tcode.remove(actualContentEnd, renderedContentEnd);\n\t\t\t}\n\t\t} else {\n\t\t\tcode.appendLeft(renderedContentEnd, separatorString);\n\t\t}\n\t\tif (systemPatternExports.length > 0) {\n\t\t\tcode.appendLeft(\n\t\t\t\trenderedContentEnd,\n\t\t\t\t` ${getSystemExportStatement(systemPatternExports, options)};`\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate renderReplacedDeclarations(code: MagicString, options: RenderOptions): void {\n\t\tconst separatedNodes = getCommaSeparatedNodesWithBoundaries(\n\t\t\tthis.declarations,\n\t\t\tcode,\n\t\t\tthis.start + this.kind.length,\n\t\t\tthis.end - (code.original.charCodeAt(this.end - 1) === 59 /*\";\"*/ ? 1 : 0)\n\t\t);\n\t\tlet actualContentEnd: number | undefined, renderedContentEnd: number;\n\t\trenderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);\n\t\tlet lastSeparatorPos = renderedContentEnd - 1;\n\t\tcode.remove(this.start, lastSeparatorPos);\n\t\tlet isInDeclaration = false;\n\t\tlet hasRenderedContent = false;\n\t\tlet separatorString = '',\n\t\t\tleadingString,\n\t\t\tnextSeparatorString;\n\t\tconst aggregatedSystemExports: Variable[] = [];\n\t\tconst singleSystemExport = gatherSystemExportsAndGetSingleExport(\n\t\t\tseparatedNodes,\n\t\t\toptions,\n\t\t\taggregatedSystemExports\n\t\t);\n\t\tfor (const { node, start, separator, contentEnd, end } of separatedNodes) {\n\t\t\tif (!node.included) {\n\t\t\t\tcode.remove(start, end);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tnode.render(code, options);\n\t\t\tleadingString = '';\n\t\t\tnextSeparatorString = '';\n\t\t\tif (\n\t\t\t\t!node.id.included ||\n\t\t\t\t(node.id instanceof Identifier &&\n\t\t\t\t\tisReassignedExportsMember(\n\t\t\t\t\t\t(node.id as IdentifierWithVariable).variable,\n\t\t\t\t\t\toptions.exportNamesByVariable\n\t\t\t\t\t))\n\t\t\t) {\n\t\t\t\tif (hasRenderedContent) {\n\t\t\t\t\tseparatorString += ';';\n\t\t\t\t}\n\t\t\t\tisInDeclaration = false;\n\t\t\t} else {\n\t\t\t\tif (singleSystemExport && singleSystemExport === node.id.variable) {\n\t\t\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end);\n\t\t\t\t\trenderSystemExportExpression(\n\t\t\t\t\t\tsingleSystemExport,\n\t\t\t\t\t\tfindNonWhiteSpace(code.original, operatorPos + 1),\n\t\t\t\t\t\tseparator === null ? contentEnd : separator,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (isInDeclaration) {\n\t\t\t\t\tseparatorString += ',';\n\t\t\t\t} else {\n\t\t\t\t\tif (hasRenderedContent) {\n\t\t\t\t\t\tseparatorString += ';';\n\t\t\t\t\t}\n\t\t\t\t\tleadingString += `${this.kind} `;\n\t\t\t\t\tisInDeclaration = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (renderedContentEnd === lastSeparatorPos + 1) {\n\t\t\t\tcode.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString);\n\t\t\t} else {\n\t\t\t\tcode.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);\n\t\t\t\tcode.appendLeft(renderedContentEnd, leadingString);\n\t\t\t}\n\t\t\tactualContentEnd = contentEnd;\n\t\t\trenderedContentEnd = end;\n\t\t\thasRenderedContent = true;\n\t\t\tlastSeparatorPos = separator!;\n\t\t\tseparatorString = nextSeparatorString;\n\t\t}\n\t\tthis.renderDeclarationEnd(\n\t\t\tcode,\n\t\t\tseparatorString,\n\t\t\tlastSeparatorPos,\n\t\t\tactualContentEnd!,\n\t\t\trenderedContentEnd,\n\t\t\taggregatedSystemExports,\n\t\t\toptions\n\t\t);\n\t}\n}\n\nfunction gatherSystemExportsAndGetSingleExport(\n\tseparatedNodes: readonly {\n\t\tnode: VariableDeclarator;\n\t}[],\n\toptions: RenderOptions,\n\taggregatedSystemExports: Variable[]\n): Variable | null {\n\tlet singleSystemExport: Variable | null = null;\n\tif (options.format === 'system') {\n\t\tfor (const { node } of separatedNodes) {\n\t\t\tif (\n\t\t\t\tnode.id instanceof Identifier &&\n\t\t\t\tnode.init &&\n\t\t\t\taggregatedSystemExports.length === 0 &&\n\t\t\t\toptions.exportNamesByVariable.get(node.id.variable!)?.length === 1\n\t\t\t) {\n\t\t\t\tsingleSystemExport = node.id.variable!;\n\t\t\t\taggregatedSystemExports.push(singleSystemExport);\n\t\t\t} else {\n\t\t\t\tnode.id.addExportedVariables(aggregatedSystemExports, options.exportNamesByVariable);\n\t\t\t}\n\t\t}\n\t\tif (aggregatedSystemExports.length > 1) {\n\t\t\tsingleSystemExport = null;\n\t\t} else if (singleSystemExport) {\n\t\t\taggregatedSystemExports.length = 0;\n\t\t}\n\t}\n\treturn singleSystemExport;\n}\n","import ArrayExpression from './ArrayExpression';\nimport ArrayPattern from './ArrayPattern';\nimport ArrowFunctionExpression from './ArrowFunctionExpression';\nimport AssignmentExpression from './AssignmentExpression';\nimport AssignmentPattern from './AssignmentPattern';\nimport AwaitExpression from './AwaitExpression';\nimport BinaryExpression from './BinaryExpression';\nimport BlockStatement from './BlockStatement';\nimport BreakStatement from './BreakStatement';\nimport CallExpression from './CallExpression';\nimport CatchClause from './CatchClause';\nimport ChainExpression from './ChainExpression';\nimport ClassBody from './ClassBody';\nimport ClassDeclaration from './ClassDeclaration';\nimport ClassExpression from './ClassExpression';\nimport ConditionalExpression from './ConditionalExpression';\nimport ContinueStatement from './ContinueStatement';\nimport DoWhileStatement from './DoWhileStatement';\nimport EmptyStatement from './EmptyStatement';\nimport ExportAllDeclaration from './ExportAllDeclaration';\nimport ExportDefaultDeclaration from './ExportDefaultDeclaration';\nimport ExportNamedDeclaration from './ExportNamedDeclaration';\nimport ExportSpecifier from './ExportSpecifier';\nimport ExpressionStatement from './ExpressionStatement';\nimport ForInStatement from './ForInStatement';\nimport ForOfStatement from './ForOfStatement';\nimport ForStatement from './ForStatement';\nimport FunctionDeclaration from './FunctionDeclaration';\nimport FunctionExpression from './FunctionExpression';\nimport Identifier from './Identifier';\nimport IfStatement from './IfStatement';\nimport ImportDeclaration from './ImportDeclaration';\nimport ImportDefaultSpecifier from './ImportDefaultSpecifier';\nimport ImportExpression from './ImportExpression';\nimport ImportNamespaceSpecifier from './ImportNamespaceSpecifier';\nimport ImportSpecifier from './ImportSpecifier';\nimport LabeledStatement from './LabeledStatement';\nimport Literal from './Literal';\nimport LogicalExpression from './LogicalExpression';\nimport MemberExpression from './MemberExpression';\nimport MetaProperty from './MetaProperty';\nimport MethodDefinition from './MethodDefinition';\nimport NewExpression from './NewExpression';\nimport ObjectExpression from './ObjectExpression';\nimport ObjectPattern from './ObjectPattern';\nimport PrivateIdentifier from './PrivateIdentifier';\nimport Program from './Program';\nimport Property from './Property';\nimport PropertyDefinition from './PropertyDefinition';\nimport RestElement from './RestElement';\nimport ReturnStatement from './ReturnStatement';\nimport SequenceExpression from './SequenceExpression';\nimport SpreadElement from './SpreadElement';\nimport StaticBlock from './StaticBlock';\nimport Super from './Super';\nimport SwitchCase from './SwitchCase';\nimport SwitchStatement from './SwitchStatement';\nimport TaggedTemplateExpression from './TaggedTemplateExpression';\nimport TemplateElement from './TemplateElement';\nimport TemplateLiteral from './TemplateLiteral';\nimport ThisExpression from './ThisExpression';\nimport ThrowStatement from './ThrowStatement';\nimport TryStatement from './TryStatement';\nimport UnaryExpression from './UnaryExpression';\nimport UnknownNode from './UnknownNode';\nimport UpdateExpression from './UpdateExpression';\nimport VariableDeclaration from './VariableDeclaration';\nimport VariableDeclarator from './VariableDeclarator';\nimport WhileStatement from './WhileStatement';\nimport YieldExpression from './YieldExpression';\nimport { NodeBase } from './shared/Node';\n\nexport const nodeConstructors: {\n\t[name: string]: typeof NodeBase;\n} = {\n\tArrayExpression,\n\tArrayPattern,\n\tArrowFunctionExpression,\n\tAssignmentExpression,\n\tAssignmentPattern,\n\tAwaitExpression,\n\tBinaryExpression,\n\tBlockStatement,\n\tBreakStatement,\n\tCallExpression,\n\tCatchClause,\n\tChainExpression,\n\tClassBody,\n\tClassDeclaration,\n\tClassExpression,\n\tConditionalExpression,\n\tContinueStatement,\n\tDoWhileStatement,\n\tEmptyStatement,\n\tExportAllDeclaration,\n\tExportDefaultDeclaration,\n\tExportNamedDeclaration,\n\tExportSpecifier,\n\tExpressionStatement,\n\tForInStatement,\n\tForOfStatement,\n\tForStatement,\n\tFunctionDeclaration,\n\tFunctionExpression,\n\tIdentifier,\n\tIfStatement,\n\tImportDeclaration,\n\tImportDefaultSpecifier,\n\tImportExpression,\n\tImportNamespaceSpecifier,\n\tImportSpecifier,\n\tLabeledStatement,\n\tLiteral,\n\tLogicalExpression,\n\tMemberExpression,\n\tMetaProperty,\n\tMethodDefinition,\n\tNewExpression,\n\tObjectExpression,\n\tObjectPattern,\n\tPrivateIdentifier,\n\tProgram,\n\tProperty,\n\tPropertyDefinition,\n\tRestElement,\n\tReturnStatement,\n\tSequenceExpression,\n\tSpreadElement,\n\tStaticBlock,\n\tSuper,\n\tSwitchCase,\n\tSwitchStatement,\n\tTaggedTemplateExpression,\n\tTemplateElement,\n\tTemplateLiteral,\n\tThisExpression,\n\tThrowStatement,\n\tTryStatement,\n\tUnaryExpression,\n\tUnknownNode,\n\tUpdateExpression,\n\tVariableDeclaration,\n\tVariableDeclarator,\n\tWhileStatement,\n\tYieldExpression\n};\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionCalled, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction } from '../NodeInteractions';\nimport {\n\ttype ObjectPath,\n\ttype PathTracker,\n\tUNKNOWN_PATH,\n\tUnknownInteger\n} from '../utils/PathTracker';\nimport { UNDEFINED_EXPRESSION, UNKNOWN_LITERAL_NUMBER } from '../values';\nimport type * as NodeType from './NodeType';\nimport SpreadElement from './SpreadElement';\nimport { ARRAY_PROTOTYPE } from './shared/ArrayPrototype';\nimport type { ExpressionEntity, LiteralValueOrUnknown } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\nimport { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity';\n\nexport default class ArrayExpression extends NodeBase {\n\tdeclare elements: readonly (ExpressionNode | SpreadElement | null)[];\n\tdeclare type: NodeType.tArrayExpression;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tlet hasSpread = false;\n\t\tfor (let index = 0; index < this.elements.length; index++) {\n\t\t\tconst element = this.elements[index];\n\t\t\tif (element) {\n\t\t\t\tif (hasSpread || element instanceof SpreadElement) {\n\t\t\t\t\thasSpread = true;\n\t\t\t\t\telement.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tconst properties: ObjectProperty[] = [\n\t\t\t{ key: 'length', kind: 'init', property: UNKNOWN_LITERAL_NUMBER }\n\t\t];\n\t\tlet hasSpread = false;\n\t\tfor (let index = 0; index < this.elements.length; index++) {\n\t\t\tconst element = this.elements[index];\n\t\t\tif (hasSpread || element instanceof SpreadElement) {\n\t\t\t\tif (element) {\n\t\t\t\t\thasSpread = true;\n\t\t\t\t\tproperties.unshift({ key: UnknownInteger, kind: 'init', property: element });\n\t\t\t\t}\n\t\t\t} else if (!element) {\n\t\t\t\tproperties.push({ key: String(index), kind: 'init', property: UNDEFINED_EXPRESSION });\n\t\t\t} else {\n\t\t\t\tproperties.push({ key: String(index), kind: 'init', property: element });\n\t\t\t}\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(properties, ARRAY_PROTOTYPE));\n\t}\n}\n","import type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ArrayPattern extends NodeBase implements PatternNode {\n\tdeclare elements: (PatternNode | null)[];\n\tdeclare type: NodeType.tArrayPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.addExportedVariables(variables, exportNamesByVariable);\n\t\t}\n\t}\n\n\tdeclare(kind: string): LocalVariable[] {\n\t\tconst variables: LocalVariable[] = [];\n\t\tfor (const element of this.elements) {\n\t\t\tif (element !== null) {\n\t\t\t\tvariables.push(...element.declare(kind, UNKNOWN_EXPRESSION));\n\t\t\t}\n\t\t}\n\t\treturn variables;\n\t}\n\n\t// Patterns can only be deoptimized at the empty path at the moment\n\tdeoptimizePath(): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.deoptimizePath(EMPTY_PATH);\n\t\t}\n\t}\n\n\t// Patterns are only checked at the emtpy path at the moment\n\thasEffectsOnInteractionAtPath(\n\t\t_path: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tfor (const element of this.elements) {\n\t\t\tif (element?.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tfor (const element of this.elements) {\n\t\t\telement?.markDeclarationReached();\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport {\n\trenderSystemExportExpression,\n\trenderSystemExportFunction,\n\trenderSystemExportSequenceAfterExpression\n} from '../../utils/systemJsRendering';\nimport {\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport { NodeInteraction } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport ObjectPattern from './ObjectPattern';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class AssignmentExpression extends NodeBase {\n\tdeclare left: ExpressionNode | PatternNode;\n\tdeclare operator:\n\t\t| '='\n\t\t| '+='\n\t\t| '-='\n\t\t| '*='\n\t\t| '/='\n\t\t| '%='\n\t\t| '<<='\n\t\t| '>>='\n\t\t| '>>>='\n\t\t| '|='\n\t\t| '^='\n\t\t| '&='\n\t\t| '**=';\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tAssignmentExpression;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst { deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\t// MemberExpressions do not access the property before assignments if the\n\t\t// operator is '='.\n\t\treturn (\n\t\t\tright.hasEffects(context) || left.hasEffectsAsAssignmentTarget(context, this.operator !== '=')\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.right.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { deoptimized, left, right, operator } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tif (\n\t\t\tincludeChildrenRecursively ||\n\t\t\toperator !== '=' ||\n\t\t\tleft.included ||\n\t\t\tleft.hasEffectsAsAssignmentTarget(createHasEffectsContext(), false)\n\t\t) {\n\t\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively, operator !== '=');\n\t\t}\n\t\tright.include(context, includeChildrenRecursively);\n\t}\n\n\tinitialise(): void {\n\t\tthis.left.setAssignedValue(this.right);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ preventASI, renderedParentType, renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tconst { left, right, start, end, parent } = this;\n\t\tif (left.included) {\n\t\t\tleft.render(code, options);\n\t\t\tright.render(code, options);\n\t\t} else {\n\t\t\tconst inclusionStart = findNonWhiteSpace(\n\t\t\t\tcode.original,\n\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, '=', left.end) + 1\n\t\t\t);\n\t\t\tcode.remove(start, inclusionStart);\n\t\t\tif (preventASI) {\n\t\t\t\tremoveLineBreaks(code, inclusionStart, right.start);\n\t\t\t}\n\t\t\tright.render(code, options, {\n\t\t\t\trenderedParentType: renderedParentType || parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || parent.type\n\t\t\t});\n\t\t}\n\t\tif (options.format === 'system') {\n\t\t\tif (left instanceof Identifier) {\n\t\t\t\tconst variable = left.variable!;\n\t\t\t\tconst exportNames = options.exportNamesByVariable.get(variable);\n\t\t\t\tif (exportNames) {\n\t\t\t\t\tif (exportNames.length === 1) {\n\t\t\t\t\t\trenderSystemExportExpression(variable, start, end, code, options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderSystemExportSequenceAfterExpression(\n\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\tend,\n\t\t\t\t\t\t\tparent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst systemPatternExports: Variable[] = [];\n\t\t\t\tleft.addExportedVariables(systemPatternExports, options.exportNamesByVariable);\n\t\t\t\tif (systemPatternExports.length > 0) {\n\t\t\t\t\trenderSystemExportFunction(\n\t\t\t\t\t\tsystemPatternExports,\n\t\t\t\t\t\tstart,\n\t\t\t\t\t\tend,\n\t\t\t\t\t\trenderedSurroundingElement === NodeType.ExpressionStatement,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tleft.included &&\n\t\t\tleft instanceof ObjectPattern &&\n\t\t\t(renderedSurroundingElement === NodeType.ExpressionStatement ||\n\t\t\t\trenderedSurroundingElement === NodeType.ArrowFunctionExpression)\n\t\t) {\n\t\t\tcode.appendRight(start, '(');\n\t\t\tcode.prependLeft(end, ')');\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.right.deoptimizePath(UNKNOWN_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { NodeInteractionAssigned } from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport type { ExpressionEntity } from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class AssignmentPattern extends NodeBase implements PatternNode {\n\tdeclare left: PatternNode;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tAssignmentPattern;\n\n\taddExportedVariables(\n\t\tvariables: readonly Variable[],\n\t\texportNamesByVariable: ReadonlyMap\n\t): void {\n\t\tthis.left.addExportedVariables(variables, exportNamesByVariable);\n\t}\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\treturn this.left.declare(kind, init);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tpath.length === 0 && this.left.deoptimizePath(path);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionAssigned,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn (\n\t\t\tpath.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\tthis.left.markDeclarationReached();\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ isShorthandProperty }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.left.render(code, options, { isShorthandProperty });\n\t\tthis.right.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.right.deoptimizePath(UNKNOWN_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport ArrowFunctionExpression from './ArrowFunctionExpression';\nimport type * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\nimport { type ExpressionNode, type IncludeChildren, type Node, NodeBase } from './shared/Node';\n\nexport default class AwaitExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tAwaitExpression;\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tcheckTopLevelAwait: if (!this.context.usesTopLevelAwait) {\n\t\t\t\tlet parent = this.parent;\n\t\t\t\tdo {\n\t\t\t\t\tif (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)\n\t\t\t\t\t\tbreak checkTopLevelAwait;\n\t\t\t\t} while ((parent = (parent as Node).parent as Node));\n\t\t\t\tthis.context.usesTopLevelAwait = true;\n\t\t\t}\n\t\t}\n\t\tthis.argument.include(context, includeChildrenRecursively);\n\t}\n}\n","import {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class BreakStatement extends StatementBase {\n\tdeclare label: Identifier | null;\n\tdeclare type: NodeType.tBreakStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.label) {\n\t\t\tif (!context.ignore.labels.has(this.label.name)) return true;\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\t} else {\n\t\t\tif (!context.ignore.breaks) return true;\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tthis.included = true;\n\t\tif (this.label) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t}\n\t\tcontext.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { BLANK } from '../../utils/blank';\nimport { renderCallArguments } from '../../utils/renderCallArguments';\nimport { type NodeRenderOptions, type RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type SpreadElement from './SpreadElement';\nimport type Super from './Super';\nimport CallExpressionBase from './shared/CallExpressionBase';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, INCLUDE_PARAMETERS, type IncludeChildren } from './shared/Node';\n\nexport default class CallExpression extends CallExpressionBase implements DeoptimizableEntity {\n\tdeclare arguments: (ExpressionNode | SpreadElement)[];\n\tdeclare callee: ExpressionNode | Super;\n\tdeclare optional: boolean;\n\tdeclare type: NodeType.tCallExpression;\n\n\tbind(): void {\n\t\tsuper.bind();\n\t\tif (this.callee instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.callee.name);\n\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'CANNOT_CALL_NAMESPACE',\n\t\t\t\t\t\tmessage: `Cannot call a namespace ('${this.callee.name}')`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (this.callee.name === 'eval') {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'EVAL',\n\t\t\t\t\t\tmessage: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,\n\t\t\t\t\t\turl: 'https://rollupjs.org/guide/en/#avoiding-eval'\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.interaction = {\n\t\t\targs: this.arguments,\n\t\t\tthisArg:\n\t\t\t\tthis.callee instanceof MemberExpression && !this.callee.variable\n\t\t\t\t\t? this.callee.object\n\t\t\t\t\t: null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: false\n\t\t};\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.arguments) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).annotations &&\n\t\t\t\tthis.annotations\n\t\t\t)\n\t\t\t\treturn false;\n\t\t\treturn (\n\t\t\t\tthis.callee.hasEffects(context) ||\n\t\t\t\tthis.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t\tif (\n\t\t\t\tincludeChildrenRecursively === INCLUDE_PARAMETERS &&\n\t\t\t\tthis.callee instanceof Identifier &&\n\t\t\t\tthis.callee.variable\n\t\t\t) {\n\t\t\t\tthis.callee.variable.markCalledFromTryStatement();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.callee.include(context, false);\n\t\t}\n\t\tthis.callee.includeCallArguments(context, this.arguments);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tthis.callee.render(code, options, {\n\t\t\tisCalleeOfRenderedParent: true,\n\t\t\trenderedSurroundingElement\n\t\t});\n\t\trenderCallArguments(code, options, this);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.interaction.thisArg) {\n\t\t\tthis.callee.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.interaction as NodeInteractionWithThisArg,\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t}\n\t\tfor (const argument of this.arguments) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprotected getReturnExpression(\n\t\trecursionTracker: PathTracker = SHARED_RECURSION_TRACKER\n\t): ExpressionEntity {\n\t\tif (this.returnExpression === null) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\treturn (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tthis.interaction,\n\t\t\t\trecursionTracker,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.returnExpression;\n\t}\n}\n","import CatchScope from '../scopes/CatchScope';\nimport type Scope from '../scopes/Scope';\nimport type BlockStatement from './BlockStatement';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class CatchClause extends NodeBase {\n\tdeclare body: BlockStatement;\n\tdeclare param: PatternNode | null;\n\tdeclare preventChildBlockScope: true;\n\tdeclare scope: CatchScope;\n\tdeclare type: NodeType.tCatchClause;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new CatchScope(parentScope, this.context);\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\t// Parameters need to be declared first as the logic is that initializers\n\t\t// of hoisted body variables are associated with parameters of the same\n\t\t// name instead of the variable\n\t\tconst { param } = esTreeNode;\n\t\tif (param) {\n\t\t\t(this.param as GenericEsTreeNode) = new (this.context.getNodeConstructor(param.type))(\n\t\t\t\tparam,\n\t\t\t\tthis,\n\t\t\t\tthis.scope\n\t\t\t);\n\t\t\tthis.param!.declare('parameter', UNKNOWN_EXPRESSION);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n}\n","import type CallExpression from './CallExpression';\nimport type MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ChainExpression extends NodeBase {\n\tdeclare expression: CallExpression | MemberExpression;\n\tdeclare type: NodeType.tChainExpression;\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport ClassBodyScope from '../scopes/ClassBodyScope';\nimport type Scope from '../scopes/Scope';\nimport type MethodDefinition from './MethodDefinition';\nimport type * as NodeType from './NodeType';\nimport type PropertyDefinition from './PropertyDefinition';\nimport type ClassNode from './shared/ClassNode';\nimport { type GenericEsTreeNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class ClassBody extends NodeBase {\n\tdeclare body: (MethodDefinition | PropertyDefinition)[];\n\tdeclare scope: ClassBodyScope;\n\tdeclare type: NodeType.tClassBody;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new ClassBodyScope(parentScope, this.parent as ClassNode, this.context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.context.includeVariableInModule(this.scope.thisVariable);\n\t\tfor (const definition of this.body) {\n\t\t\tdefinition.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tconst body: NodeBase[] = (this.body = []);\n\t\tfor (const definition of esTreeNode.body) {\n\t\t\tbody.push(\n\t\t\t\tnew (this.context.getNodeConstructor(definition.type))(\n\t\t\t\t\tdefinition,\n\t\t\t\t\tthis,\n\t\t\t\t\tdefinition.static ? this.scope : this.scope.instanceScope\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport * as NodeType from './NodeType';\nimport ClassNode from './shared/ClassNode';\n\nexport default class ClassExpression extends ClassNode {\n\tdeclare type: NodeType.tClassExpression;\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (renderedSurroundingElement === NodeType.ExpressionStatement) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n}\n","import MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\tNodeRenderOptions,\n\tremoveLineBreaks,\n\tRenderOptions\n} from '../../utils/renderHelpers';\nimport { removeAnnotations } from '../../utils/treeshakeNode';\nimport { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tNodeInteraction,\n\tNodeInteractionCalled,\n\tNodeInteractionWithThisArg\n} from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\tObjectPath,\n\tPathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport SpreadElement from './SpreadElement';\nimport { ExpressionEntity, LiteralValueOrUnknown, UnknownValue } from './shared/Expression';\nimport { MultiExpression } from './shared/MultiExpression';\nimport { ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class ConditionalExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare alternate: ExpressionNode;\n\tdeclare consequent: ExpressionNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tConditionalExpression;\n\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate isBranchResolutionAnalysed = false;\n\tprivate usedBranch: ExpressionNode | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tif (this.usedBranch !== null) {\n\t\t\tconst unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent;\n\t\t\tthis.usedBranch = null;\n\t\t\tunusedBranch.deoptimizePath(UNKNOWN_PATH);\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.consequent.deoptimizePath(path);\n\t\t\tthis.alternate.deoptimizePath(path);\n\t\t} else {\n\t\t\tusedBranch.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.consequent.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tthis.alternate.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) return UnknownValue;\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch)\n\t\t\treturn new MultiExpression([\n\t\t\t\tthis.consequent.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t),\n\t\t\t\tthis.alternate.getReturnExpressionWhenCalledAtPath(\n\t\t\t\t\tpath,\n\t\t\t\t\tinteraction,\n\t\t\t\t\trecursionTracker,\n\t\t\t\t\torigin\n\t\t\t\t)\n\t\t\t]);\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn this.consequent.hasEffects(context) || this.alternate.hasEffects(context);\n\t\t}\n\t\treturn usedBranch.hasEffects(context);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn (\n\t\t\t\tthis.consequent.hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\t\tthis.alternate.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t);\n\t\t}\n\t\treturn usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (includeChildrenRecursively || this.test.shouldBeIncluded(context) || usedBranch === null) {\n\t\t\tthis.test.include(context, includeChildrenRecursively);\n\t\t\tthis.consequent.include(context, includeChildrenRecursively);\n\t\t\tthis.alternate.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tusedBranch.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\tincludeCallArguments(\n\t\tcontext: InclusionContext,\n\t\targs: readonly (ExpressionEntity | SpreadElement)[]\n\t): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.consequent.includeCallArguments(context, args);\n\t\t\tthis.alternate.includeCallArguments(context, args);\n\t\t} else {\n\t\t\tusedBranch.includeCallArguments(context, args);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\tisCalleeOfRenderedParent,\n\t\t\tpreventASI,\n\t\t\trenderedParentType,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!this.test.included) {\n\t\t\tconst colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);\n\t\t\tconst inclusionStart = findNonWhiteSpace(\n\t\t\t\tcode.original,\n\t\t\t\t(this.consequent.included\n\t\t\t\t\t? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)\n\t\t\t\t\t: colonPos) + 1\n\t\t\t);\n\t\t\tif (preventASI) {\n\t\t\t\tremoveLineBreaks(code, inclusionStart, usedBranch!.start);\n\t\t\t}\n\t\t\tcode.remove(this.start, inclusionStart);\n\t\t\tif (this.consequent.included) {\n\t\t\t\tcode.remove(colonPos, this.end);\n\t\t\t}\n\t\t\tremoveAnnotations(this, code);\n\t\t\tusedBranch!.render(code, options, {\n\t\t\t\tisCalleeOfRenderedParent,\n\t\t\t\tpreventASI: true,\n\t\t\t\trenderedParentType: renderedParentType || this.parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || this.parent.type\n\t\t\t});\n\t\t} else {\n\t\t\tthis.test.render(code, options, { renderedSurroundingElement });\n\t\t\tthis.consequent.render(code, options);\n\t\t\tthis.alternate.render(code, options);\n\t\t}\n\t}\n\n\tprivate getUsedBranch() {\n\t\tif (this.isBranchResolutionAnalysed) {\n\t\t\treturn this.usedBranch;\n\t\t}\n\t\tthis.isBranchResolutionAnalysed = true;\n\t\tconst testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\treturn typeof testValue === 'symbol'\n\t\t\t? null\n\t\t\t: (this.usedBranch = testValue ? this.consequent : this.alternate);\n\t}\n}\n","import {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class ContinueStatement extends StatementBase {\n\tdeclare label: Identifier | null;\n\tdeclare type: NodeType.tContinueStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.label) {\n\t\t\tif (!context.ignore.labels.has(this.label.name)) return true;\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\t} else {\n\t\t\tif (!context.ignore.continues) return true;\n\t\t\tcontext.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tthis.included = true;\n\t\tif (this.label) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.add(this.label.name);\n\t\t}\n\t\tcontext.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;\n\t}\n}\n","import type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class DoWhileStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tDoWhileStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { StatementBase } from './shared/Node';\n\nexport default class EmptyStatement extends StatementBase {\n\tdeclare type: NodeType.tEmptyStatement;\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ExportSpecifier extends NodeBase {\n\tdeclare exported: Identifier;\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tExportSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ForInStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare left: VariableDeclaration | PatternNode | MemberExpression;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tForInStatement;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst { deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tif (left.hasEffectsAsAssignmentTarget(context, false) || right.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { body, deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false);\n\t\tright.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tbody.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tinitialise() {\n\t\tthis.left.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.left.render(code, options, NO_SEMICOLON);\n\t\tthis.right.render(code, options, NO_SEMICOLON);\n\t\t// handle no space between \"in\" and the right side\n\t\tif (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) {\n\t\t\tcode.prependLeft(this.right.start, ' ');\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport { EMPTY_PATH } from '../utils/PathTracker';\nimport MemberExpression from './MemberExpression';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class ForOfStatement extends StatementBase {\n\tdeclare await: boolean;\n\tdeclare body: StatementNode;\n\tdeclare left: VariableDeclaration | PatternNode | MemberExpression;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tForOfStatement;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t// Placeholder until proper Symbol.Iterator support\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst { body, deoptimized, left, right } = this;\n\t\tif (!deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tleft.includeAsAssignmentTarget(context, includeChildrenRecursively || true, false);\n\t\tright.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tbody.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\tinitialise() {\n\t\tthis.left.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.left.render(code, options, NO_SEMICOLON);\n\t\tthis.right.render(code, options, NO_SEMICOLON);\n\t\t// handle no space between \"of\" and the right side\n\t\tif (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) {\n\t\t\tcode.prependLeft(this.right.start, ' ');\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.left.deoptimizePath(EMPTY_PATH);\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { NO_SEMICOLON, type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport type VariableDeclaration from './VariableDeclaration';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class ForStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare init: VariableDeclaration | ExpressionNode | null;\n\tdeclare test: ExpressionNode | null;\n\tdeclare type: NodeType.tForStatement;\n\tdeclare update: ExpressionNode | null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (\n\t\t\tthis.init?.hasEffects(context) ||\n\t\t\tthis.test?.hasEffects(context) ||\n\t\t\tthis.update?.hasEffects(context)\n\t\t)\n\t\t\treturn true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.init?.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tthis.test?.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.update?.include(context, includeChildrenRecursively);\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.init?.render(code, options, NO_SEMICOLON);\n\t\tthis.test?.render(code, options, NO_SEMICOLON);\n\t\tthis.update?.render(code, options, NO_SEMICOLON);\n\t\tthis.body.render(code, options);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport * as NodeType from './NodeType';\nimport FunctionNode from './shared/FunctionNode';\n\nexport default class FunctionExpression extends FunctionNode {\n\tdeclare type: NodeType.tFunctionExpression;\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (renderedSurroundingElement === NodeType.ExpressionStatement) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportDefaultSpecifier extends NodeBase {\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportDefaultSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportNamespaceSpecifier extends NodeBase {\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportNamespaceSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ImportSpecifier extends NodeBase {\n\tdeclare imported: Identifier;\n\tdeclare local: Identifier;\n\tdeclare type: NodeType.tImportSpecifier;\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type Identifier from './Identifier';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class LabeledStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare label: Identifier;\n\tdeclare type: NodeType.tLabeledStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst brokenFlow = context.brokenFlow;\n\t\tcontext.ignore.labels.add(this.label.name);\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.labels.delete(this.label.name);\n\t\tif (context.includedLabels.has(this.label.name)) {\n\t\t\tcontext.includedLabels.delete(this.label.name);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst brokenFlow = context.brokenFlow;\n\t\tthis.body.include(context, includeChildrenRecursively);\n\t\tif (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {\n\t\t\tthis.label.include();\n\t\t\tcontext.includedLabels.delete(this.label.name);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.label.included) {\n\t\t\tthis.label.render(code, options);\n\t\t} else {\n\t\t\tcode.remove(\n\t\t\t\tthis.start,\n\t\t\t\tfindNonWhiteSpace(\n\t\t\t\t\tcode.original,\n\t\t\t\t\tfindFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tthis.body.render(code, options);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { removeAnnotations } from '../../utils/treeshakeNode';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUnknownValue\n} from './shared/Expression';\nimport { MultiExpression } from './shared/MultiExpression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport type LogicalOperator = '||' | '&&' | '??';\n\nexport default class LogicalExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare left: ExpressionNode;\n\tdeclare operator: LogicalOperator;\n\tdeclare right: ExpressionNode;\n\tdeclare type: NodeType.tLogicalExpression;\n\n\t// We collect deoptimization information if usedBranch !== null\n\tprivate expressionsToBeDeoptimized: DeoptimizableEntity[] = [];\n\tprivate isBranchResolutionAnalysed = false;\n\tprivate usedBranch: ExpressionNode | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tif (this.usedBranch) {\n\t\t\tconst unusedBranch = this.usedBranch === this.left ? this.right : this.left;\n\t\t\tthis.usedBranch = null;\n\t\t\tunusedBranch.deoptimizePath(UNKNOWN_PATH);\n\t\t\tfor (const expression of this.expressionsToBeDeoptimized) {\n\t\t\t\texpression.deoptimizeCache();\n\t\t\t}\n\t\t\t// Request another pass because we need to ensure \"include\" runs again if\n\t\t\t// it is rendered\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\tthis.left.deoptimizePath(path);\n\t\t\tthis.right.deoptimizePath(path);\n\t\t} else {\n\t\t\tusedBranch.deoptimizePath(path);\n\t\t}\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.left.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t\tthis.right.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) return UnknownValue;\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch)\n\t\t\treturn new MultiExpression([\n\t\t\t\tthis.left.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin),\n\t\t\t\tthis.right.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t]);\n\t\tthis.expressionsToBeDeoptimized.push(origin);\n\t\treturn usedBranch.getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.left.hasEffects(context)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (this.getUsedBranch() !== this.left) {\n\t\t\treturn this.right.hasEffects(context);\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (!usedBranch) {\n\t\t\treturn (\n\t\t\t\tthis.left.hasEffectsOnInteractionAtPath(path, interaction, context) ||\n\t\t\t\tthis.right.hasEffectsOnInteractionAtPath(path, interaction, context)\n\t\t\t);\n\t\t}\n\t\treturn usedBranch.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst usedBranch = this.getUsedBranch();\n\t\tif (\n\t\t\tincludeChildrenRecursively ||\n\t\t\t(usedBranch === this.right && this.left.shouldBeIncluded(context)) ||\n\t\t\t!usedBranch\n\t\t) {\n\t\t\tthis.left.include(context, includeChildrenRecursively);\n\t\t\tthis.right.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tusedBranch.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{\n\t\t\tisCalleeOfRenderedParent,\n\t\t\tpreventASI,\n\t\t\trenderedParentType,\n\t\t\trenderedSurroundingElement\n\t\t}: NodeRenderOptions = BLANK\n\t): void {\n\t\tif (!this.left.included || !this.right.included) {\n\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(\n\t\t\t\tcode.original,\n\t\t\t\tthis.operator,\n\t\t\t\tthis.left.end\n\t\t\t);\n\t\t\tif (this.right.included) {\n\t\t\t\tconst removePos = findNonWhiteSpace(code.original, operatorPos + 2);\n\t\t\t\tcode.remove(this.start, removePos);\n\t\t\t\tif (preventASI) {\n\t\t\t\t\tremoveLineBreaks(code, removePos, this.right.start);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcode.remove(operatorPos, this.end);\n\t\t\t}\n\t\t\tremoveAnnotations(this, code);\n\t\t\tthis.getUsedBranch()!.render(code, options, {\n\t\t\t\tisCalleeOfRenderedParent,\n\t\t\t\tpreventASI,\n\t\t\t\trenderedParentType: renderedParentType || this.parent.type,\n\t\t\t\trenderedSurroundingElement: renderedSurroundingElement || this.parent.type\n\t\t\t});\n\t\t} else {\n\t\t\tthis.left.render(code, options, {\n\t\t\t\tpreventASI,\n\t\t\t\trenderedSurroundingElement\n\t\t\t});\n\t\t\tthis.right.render(code, options);\n\t\t}\n\t}\n\n\tprivate getUsedBranch() {\n\t\tif (!this.isBranchResolutionAnalysed) {\n\t\t\tthis.isBranchResolutionAnalysed = true;\n\t\t\tconst leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);\n\t\t\tif (typeof leftValue === 'symbol') {\n\t\t\t\treturn null;\n\t\t\t} else {\n\t\t\t\tthis.usedBranch =\n\t\t\t\t\t(this.operator === '||' && leftValue) ||\n\t\t\t\t\t(this.operator === '&&' && !leftValue) ||\n\t\t\t\t\t(this.operator === '??' && leftValue != null)\n\t\t\t\t\t\t? this.left\n\t\t\t\t\t\t: this.right;\n\t\t\t}\n\t\t}\n\t\treturn this.usedBranch;\n\t}\n}\n","import MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport { renderCallArguments } from '../../utils/renderCallArguments';\nimport { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tINTERACTION_CALLED,\n\tNodeInteraction,\n\tNodeInteractionCalled\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath, UNKNOWN_PATH } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class NewExpression extends NodeBase {\n\tdeclare arguments: ExpressionNode[];\n\tdeclare callee: ExpressionNode;\n\tdeclare type: NodeType.tNewExpression;\n\tprivate declare interaction: NodeInteractionCalled;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.arguments) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t(this.context.options.treeshake as NormalizedTreeshakingOptions).annotations &&\n\t\t\t\tthis.annotations\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tthis.callee.hasEffects(context) ||\n\t\t\t\tthis.callee.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 0 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.callee.include(context, false);\n\t\t}\n\t\tthis.callee.includeCallArguments(context, this.arguments);\n\t}\n\n\tinitialise(): void {\n\t\tthis.interaction = {\n\t\t\targs: this.arguments,\n\t\t\tthisArg: null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: true\n\t\t};\n\t}\n\n\trender(code: MagicString, options: RenderOptions) {\n\t\tthis.callee.render(code, options);\n\t\trenderCallArguments(code, options, this);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tfor (const argument of this.arguments) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\ttype ObjectPath,\n\ttype PathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUnknownKey\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport Literal from './Literal';\nimport * as NodeType from './NodeType';\nimport Property from './Property';\nimport SpreadElement from './SpreadElement';\nimport { type ExpressionEntity, type LiteralValueOrUnknown } from './shared/Expression';\nimport { NodeBase } from './shared/Node';\nimport { ObjectEntity, type ObjectProperty } from './shared/ObjectEntity';\nimport { OBJECT_PROTOTYPE } from './shared/ObjectPrototype';\n\nexport default class ObjectExpression extends NodeBase implements DeoptimizableEntity {\n\tdeclare properties: readonly (Property | SpreadElement)[];\n\tdeclare type: NodeType.tObjectExpression;\n\tprivate objectEntity: ObjectEntity | null = null;\n\n\tdeoptimizeCache(): void {\n\t\tthis.getObjectEntity().deoptimizeAllProperties();\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.getObjectEntity().deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.getObjectEntity().deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.getObjectEntity().getReturnExpressionWhenCalledAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.getObjectEntity().hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedSurroundingElement }: NodeRenderOptions = BLANK\n\t): void {\n\t\tsuper.render(code, options);\n\t\tif (\n\t\t\trenderedSurroundingElement === NodeType.ExpressionStatement ||\n\t\t\trenderedSurroundingElement === NodeType.ArrowFunctionExpression\n\t\t) {\n\t\t\tcode.appendRight(this.start, '(');\n\t\t\tcode.prependLeft(this.end, ')');\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n\n\tprivate getObjectEntity(): ObjectEntity {\n\t\tif (this.objectEntity !== null) {\n\t\t\treturn this.objectEntity;\n\t\t}\n\t\tlet prototype: ExpressionEntity | null = OBJECT_PROTOTYPE;\n\t\tconst properties: ObjectProperty[] = [];\n\t\tfor (const property of this.properties) {\n\t\t\tif (property instanceof SpreadElement) {\n\t\t\t\tproperties.push({ key: UnknownKey, kind: 'init', property });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlet key: string;\n\t\t\tif (property.computed) {\n\t\t\t\tconst keyValue = property.key.getLiteralValueAtPath(\n\t\t\t\t\tEMPTY_PATH,\n\t\t\t\t\tSHARED_RECURSION_TRACKER,\n\t\t\t\t\tthis\n\t\t\t\t);\n\t\t\t\tif (typeof keyValue === 'symbol') {\n\t\t\t\t\tproperties.push({ key: UnknownKey, kind: property.kind, property });\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tkey = String(keyValue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tkey =\n\t\t\t\t\tproperty.key instanceof Identifier\n\t\t\t\t\t\t? property.key.name\n\t\t\t\t\t\t: String((property.key as Literal).value);\n\t\t\t\tif (key === '__proto__' && property.kind === 'init') {\n\t\t\t\t\tprototype =\n\t\t\t\t\t\tproperty.value instanceof Literal && property.value.value === null\n\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t: property.value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tproperties.push({ key, kind: property.kind, property });\n\t\t}\n\t\treturn (this.objectEntity = new ObjectEntity(properties, prototype));\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class PrivateIdentifier extends NodeBase {\n\tdeclare name: string;\n\tdeclare type: NodeType.tPrivateIdentifier;\n}\n","import type MagicString from 'magic-string';\nimport type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { UnknownKey } from '../utils/PathTracker';\nimport type LocalVariable from '../variables/LocalVariable';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport MethodBase from './shared/MethodBase';\nimport type { ExpressionNode } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class Property extends MethodBase implements PatternNode {\n\tdeclare key: ExpressionNode;\n\tdeclare kind: 'init' | 'get' | 'set';\n\tdeclare method: boolean;\n\tdeclare shorthand: boolean;\n\tdeclare type: NodeType.tProperty;\n\tprivate declarationInit: ExpressionEntity | null = null;\n\n\tdeclare(kind: string, init: ExpressionEntity): LocalVariable[] {\n\t\tthis.declarationInit = init;\n\t\treturn (this.value as PatternNode).declare(kind, UNKNOWN_EXPRESSION);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tconst propertyReadSideEffects = (this.context.options.treeshake as NormalizedTreeshakingOptions)\n\t\t\t.propertyReadSideEffects;\n\t\treturn (\n\t\t\t(this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always') ||\n\t\t\tthis.key.hasEffects(context) ||\n\t\t\tthis.value.hasEffects(context)\n\t\t);\n\t}\n\n\tmarkDeclarationReached(): void {\n\t\t(this.value as PatternNode).markDeclarationReached();\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (!this.shorthand) {\n\t\t\tthis.key.render(code, options);\n\t\t}\n\t\tthis.value.render(code, options, { isShorthandProperty: this.shorthand });\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.declarationInit !== null) {\n\t\t\tthis.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);\n\t\t\tthis.context.requestTreeshakingPass();\n\t\t}\n\t}\n}\n","import type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction, NodeInteractionCalled } from '../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport type * as NodeType from './NodeType';\nimport type PrivateIdentifier from './PrivateIdentifier';\nimport {\n\ttype ExpressionEntity,\n\ttype LiteralValueOrUnknown,\n\tUNKNOWN_EXPRESSION,\n\tUnknownValue\n} from './shared/Expression';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class PropertyDefinition extends NodeBase {\n\tdeclare computed: boolean;\n\tdeclare key: ExpressionNode | PrivateIdentifier;\n\tdeclare static: boolean;\n\tdeclare type: NodeType.tPropertyDefinition;\n\tdeclare value: ExpressionNode | null;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.value?.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.value?.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.value\n\t\t\t? this.value.getLiteralValueAtPath(path, recursionTracker, origin)\n\t\t\t: UnknownValue;\n\t}\n\n\tgetReturnExpressionWhenCalledAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteractionCalled,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): ExpressionEntity {\n\t\treturn this.value\n\t\t\t? this.value.getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin)\n\t\t\t: UNKNOWN_EXPRESSION;\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn this.key.hasEffects(context) || (this.static && !!this.value?.hasEffects(context));\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport {\n\tBROKEN_FLOW_ERROR_RETURN_LABEL,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class ReturnStatement extends StatementBase {\n\tdeclare argument: ExpressionNode | null;\n\tdeclare type: NodeType.tReturnStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!context.ignore.returnYield || this.argument?.hasEffects(context)) return true;\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.argument?.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t}\n\n\tinitialise(): void {\n\t\tthis.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.argument) {\n\t\t\tthis.argument.render(code, options, { preventASI: true });\n\t\t\tif (this.argument.start === this.start + 6 /* 'return'.length */) {\n\t\t\t\tcode.prependLeft(this.start + 6, ' ');\n\t\t\t}\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport {\n\tgetCommaSeparatedNodesWithBoundaries,\n\ttype NodeRenderOptions,\n\tremoveLineBreaks,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport { treeshakeNode } from '../../utils/treeshakeNode';\nimport type { DeoptimizableEntity } from '../DeoptimizableEntity';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { NodeInteraction } from '../NodeInteractions';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport ExpressionStatement from './ExpressionStatement';\nimport type * as NodeType from './NodeType';\nimport type { LiteralValueOrUnknown } from './shared/Expression';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class SequenceExpression extends NodeBase {\n\tdeclare expressions: ExpressionNode[];\n\tdeclare type: NodeType.tSequenceExpression;\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.expressions[this.expressions.length - 1].deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\tthis.expressions[this.expressions.length - 1].deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\tgetLiteralValueAtPath(\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker,\n\t\torigin: DeoptimizableEntity\n\t): LiteralValueOrUnknown {\n\t\treturn this.expressions[this.expressions.length - 1].getLiteralValueAtPath(\n\t\t\tpath,\n\t\t\trecursionTracker,\n\t\t\torigin\n\t\t);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (expression.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\treturn this.expressions[this.expressions.length - 1].hasEffectsOnInteractionAtPath(\n\t\t\tpath,\n\t\t\tinteraction,\n\t\t\tcontext\n\t\t);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tconst lastExpression = this.expressions[this.expressions.length - 1];\n\t\tfor (const expression of this.expressions) {\n\t\t\tif (\n\t\t\t\tincludeChildrenRecursively ||\n\t\t\t\t(expression === lastExpression && !(this.parent instanceof ExpressionStatement)) ||\n\t\t\t\texpression.shouldBeIncluded(context)\n\t\t\t)\n\t\t\t\texpression.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(\n\t\tcode: MagicString,\n\t\toptions: RenderOptions,\n\t\t{ renderedParentType, isCalleeOfRenderedParent, preventASI }: NodeRenderOptions = BLANK\n\t): void {\n\t\tlet includedNodes = 0;\n\t\tlet lastSeparatorPos: number | null = null;\n\t\tconst lastNode = this.expressions[this.expressions.length - 1];\n\t\tfor (const { node, separator, start, end } of getCommaSeparatedNodesWithBoundaries(\n\t\t\tthis.expressions,\n\t\t\tcode,\n\t\t\tthis.start,\n\t\t\tthis.end\n\t\t)) {\n\t\t\tif (!node.included) {\n\t\t\t\ttreeshakeNode(node, code, start, end);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tincludedNodes++;\n\t\t\tlastSeparatorPos = separator;\n\t\t\tif (includedNodes === 1 && preventASI) {\n\t\t\t\tremoveLineBreaks(code, start, node.start);\n\t\t\t}\n\t\t\tif (includedNodes === 1) {\n\t\t\t\tconst parentType = renderedParentType || this.parent.type;\n\t\t\t\tnode.render(code, options, {\n\t\t\t\t\tisCalleeOfRenderedParent: isCalleeOfRenderedParent && node === lastNode,\n\t\t\t\t\trenderedParentType: parentType,\n\t\t\t\t\trenderedSurroundingElement: parentType\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tnode.render(code, options);\n\t\t\t}\n\t\t}\n\t\tif (lastSeparatorPos) {\n\t\t\tcode.remove(lastSeparatorPos, this.end);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport { type IncludeChildren, StatementBase, type StatementNode } from './shared/Node';\n\nexport default class StaticBlock extends StatementBase {\n\tdeclare body: readonly StatementNode[];\n\tdeclare type: NodeType.tStaticBlock;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tfor (const node of this.body) {\n\t\t\tif (node.hasEffects(context)) return true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tfor (const node of this.body) {\n\t\t\tif (includeChildrenRecursively || node.shouldBeIncluded(context))\n\t\t\t\tnode.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.body.length) {\n\t\t\trenderStatementList(this.body, code, this.start + 1, this.end - 1, options);\n\t\t} else {\n\t\t\tsuper.render(code, options);\n\t\t}\n\t}\n}\n","import { NodeInteractionWithThisArg } from '../NodeInteractions';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { PathTracker } from '../utils/PathTracker';\nimport Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class Super extends NodeBase {\n\tdeclare type: NodeType.tSuper;\n\tdeclare variable: Variable;\n\n\tbind(): void {\n\t\tthis.variable = this.scope.findVariable('this');\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.variable.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t) {\n\t\tthis.variable.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions, renderStatementList } from '../../utils/renderHelpers';\nimport {\n\tBROKEN_FLOW_BREAK_CONTINUE,\n\tcreateHasEffectsContext,\n\ttype HasEffectsContext,\n\ttype InclusionContext\n} from '../ExecutionContext';\nimport BlockScope from '../scopes/BlockScope';\nimport type Scope from '../scopes/Scope';\nimport type * as NodeType from './NodeType';\nimport type SwitchCase from './SwitchCase';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class SwitchStatement extends StatementBase {\n\tdeclare cases: readonly SwitchCase[];\n\tdeclare discriminant: ExpressionNode;\n\tdeclare type: NodeType.tSwitchStatement;\n\n\tprivate declare defaultCase: number | null;\n\n\tcreateScope(parentScope: Scope): void {\n\t\tthis.scope = new BlockScope(parentScope);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.discriminant.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks }\n\t\t} = context;\n\t\tlet minBrokenFlow = Infinity;\n\t\tcontext.ignore.breaks = true;\n\t\tfor (const switchCase of this.cases) {\n\t\t\tif (switchCase.hasEffects(context)) return true;\n\t\t\tminBrokenFlow = context.brokenFlow < minBrokenFlow ? context.brokenFlow : minBrokenFlow;\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tif (this.defaultCase !== null && !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {\n\t\t\tcontext.brokenFlow = minBrokenFlow;\n\t\t}\n\t\tcontext.ignore.breaks = breaks;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.discriminant.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tlet minBrokenFlow = Infinity;\n\t\tlet isCaseIncluded =\n\t\t\tincludeChildrenRecursively ||\n\t\t\t(this.defaultCase !== null && this.defaultCase < this.cases.length - 1);\n\t\tfor (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) {\n\t\t\tconst switchCase = this.cases[caseIndex];\n\t\t\tif (switchCase.included) {\n\t\t\t\tisCaseIncluded = true;\n\t\t\t}\n\t\t\tif (!isCaseIncluded) {\n\t\t\t\tconst hasEffectsContext = createHasEffectsContext();\n\t\t\t\thasEffectsContext.ignore.breaks = true;\n\t\t\t\tisCaseIncluded = switchCase.hasEffects(hasEffectsContext);\n\t\t\t}\n\t\t\tif (isCaseIncluded) {\n\t\t\t\tswitchCase.include(context, includeChildrenRecursively);\n\t\t\t\tminBrokenFlow = minBrokenFlow < context.brokenFlow ? minBrokenFlow : context.brokenFlow;\n\t\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t\t} else {\n\t\t\t\tminBrokenFlow = brokenFlow;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tisCaseIncluded &&\n\t\t\tthis.defaultCase !== null &&\n\t\t\t!(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)\n\t\t) {\n\t\t\tcontext.brokenFlow = minBrokenFlow;\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tfor (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) {\n\t\t\tif (this.cases[caseIndex].test === null) {\n\t\t\t\tthis.defaultCase = caseIndex;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.defaultCase = null;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.discriminant.render(code, options);\n\t\tif (this.cases.length > 0) {\n\t\t\trenderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options);\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { type RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport { InclusionContext } from '../ExecutionContext';\nimport { INTERACTION_CALLED, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport {\n\tEMPTY_PATH,\n\tPathTracker,\n\tSHARED_RECURSION_TRACKER,\n\tUNKNOWN_PATH\n} from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport MemberExpression from './MemberExpression';\nimport * as NodeType from './NodeType';\nimport type TemplateLiteral from './TemplateLiteral';\nimport CallExpressionBase from './shared/CallExpressionBase';\nimport { ExpressionEntity, UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, IncludeChildren } from './shared/Node';\n\nexport default class TaggedTemplateExpression extends CallExpressionBase {\n\tdeclare quasi: TemplateLiteral;\n\tdeclare tag: ExpressionNode;\n\tdeclare type: NodeType.tTaggedTemplateExpression;\n\n\tbind(): void {\n\t\tsuper.bind();\n\t\tif (this.tag.type === NodeType.Identifier) {\n\t\t\tconst name = (this.tag as Identifier).name;\n\t\t\tconst variable = this.scope.findVariable(name);\n\n\t\t\tif (variable.isNamespace) {\n\t\t\t\tthis.context.warn(\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: 'CANNOT_CALL_NAMESPACE',\n\t\t\t\t\t\tmessage: `Cannot call a namespace ('${name}')`\n\t\t\t\t\t},\n\t\t\t\t\tthis.start\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\ttry {\n\t\t\tfor (const argument of this.quasi.expressions) {\n\t\t\t\tif (argument.hasEffects(context)) return true;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tthis.tag.hasEffects(context) ||\n\t\t\t\tthis.tag.hasEffectsOnInteractionAtPath(EMPTY_PATH, this.interaction, context)\n\t\t\t);\n\t\t} finally {\n\t\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\t}\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tif (includeChildrenRecursively) {\n\t\t\tsuper.include(context, includeChildrenRecursively);\n\t\t} else {\n\t\t\tthis.included = true;\n\t\t\tthis.tag.include(context, includeChildrenRecursively);\n\t\t\tthis.quasi.include(context, includeChildrenRecursively);\n\t\t}\n\t\tthis.tag.includeCallArguments(context, this.interaction.args);\n\t\tconst returnExpression = this.getReturnExpression();\n\t\tif (!returnExpression.included) {\n\t\t\treturnExpression.include(context, false);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.interaction = {\n\t\t\targs: [UNKNOWN_EXPRESSION, ...this.quasi.expressions],\n\t\t\tthisArg: this.tag instanceof MemberExpression && !this.tag.variable ? this.tag.object : null,\n\t\t\ttype: INTERACTION_CALLED,\n\t\t\twithNew: false\n\t\t};\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.tag.render(code, options, { isCalleeOfRenderedParent: true });\n\t\tthis.quasi.render(code, options);\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tif (this.interaction.thisArg) {\n\t\t\tthis.tag.deoptimizeThisOnInteractionAtPath(\n\t\t\t\tthis.interaction as NodeInteractionWithThisArg,\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tSHARED_RECURSION_TRACKER\n\t\t\t);\n\t\t}\n\t\tfor (const argument of this.quasi.expressions) {\n\t\t\t// This will make sure all properties of parameters behave as \"unknown\"\n\t\t\targument.deoptimizePath(UNKNOWN_PATH);\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n\n\tprotected getReturnExpression(\n\t\trecursionTracker: PathTracker = SHARED_RECURSION_TRACKER\n\t): ExpressionEntity {\n\t\tif (this.returnExpression === null) {\n\t\t\tthis.returnExpression = UNKNOWN_EXPRESSION;\n\t\t\treturn (this.returnExpression = this.tag.getReturnExpressionWhenCalledAtPath(\n\t\t\t\tEMPTY_PATH,\n\t\t\t\tthis.interaction,\n\t\t\t\trecursionTracker,\n\t\t\t\tthis\n\t\t\t));\n\t\t}\n\t\treturn this.returnExpression;\n\t}\n}\n","import type * as NodeType from './NodeType';\nimport { type GenericEsTreeNode, NodeBase } from './shared/Node';\n\nexport default class TemplateElement extends NodeBase {\n\tdeclare tail: boolean;\n\tdeclare type: NodeType.tTemplateElement;\n\tdeclare value: {\n\t\tcooked: string | null;\n\t\traw: string;\n\t};\n\n\t// Do not try to bind value\n\tbind(): void {}\n\n\thasEffects(): boolean {\n\t\treturn false;\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t}\n\n\tparseNode(esTreeNode: GenericEsTreeNode): void {\n\t\tthis.value = esTreeNode.value;\n\t\tsuper.parseNode(esTreeNode);\n\t}\n\n\trender(): void {}\n}\n","import type MagicString from 'magic-string';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type { NodeInteraction, NodeInteractionWithThisArg } from '../NodeInteractions';\nimport { INTERACTION_ACCESSED } from '../NodeInteractions';\nimport ModuleScope from '../scopes/ModuleScope';\nimport type { ObjectPath, PathTracker } from '../utils/PathTracker';\nimport type Variable from '../variables/Variable';\nimport type * as NodeType from './NodeType';\nimport { NodeBase } from './shared/Node';\n\nexport default class ThisExpression extends NodeBase {\n\tdeclare type: NodeType.tThisExpression;\n\tdeclare variable: Variable;\n\tprivate declare alias: string | null;\n\n\tbind(): void {\n\t\tthis.variable = this.scope.findVariable('this');\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.variable.deoptimizePath(path);\n\t}\n\n\tdeoptimizeThisOnInteractionAtPath(\n\t\tinteraction: NodeInteractionWithThisArg,\n\t\tpath: ObjectPath,\n\t\trecursionTracker: PathTracker\n\t): void {\n\t\t// We rewrite the parameter so that a ThisVariable can detect self-mutations\n\t\tthis.variable.deoptimizeThisOnInteractionAtPath(\n\t\t\tinteraction.thisArg === this ? { ...interaction, thisArg: this.variable } : interaction,\n\t\t\tpath,\n\t\t\trecursionTracker\n\t\t);\n\t}\n\n\thasEffectsOnInteractionAtPath(\n\t\tpath: ObjectPath,\n\t\tinteraction: NodeInteraction,\n\t\tcontext: HasEffectsContext\n\t): boolean {\n\t\tif (path.length === 0) {\n\t\t\treturn interaction.type !== INTERACTION_ACCESSED;\n\t\t}\n\t\treturn this.variable.hasEffectsOnInteractionAtPath(path, interaction, context);\n\t}\n\n\tinclude(): void {\n\t\tif (!this.included) {\n\t\t\tthis.included = true;\n\t\t\tthis.context.includeVariableInModule(this.variable);\n\t\t}\n\t}\n\n\tinitialise(): void {\n\t\tthis.alias =\n\t\t\tthis.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null;\n\t\tif (this.alias === 'undefined') {\n\t\t\tthis.context.warn(\n\t\t\t\t{\n\t\t\t\t\tcode: 'THIS_IS_UNDEFINED',\n\t\t\t\t\tmessage: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,\n\t\t\t\t\turl: `https://rollupjs.org/guide/en/#error-this-is-undefined`\n\t\t\t\t},\n\t\t\t\tthis.start\n\t\t\t);\n\t\t}\n\t}\n\n\trender(code: MagicString): void {\n\t\tif (this.alias !== null) {\n\t\t\tcode.overwrite(this.start, this.end, this.alias, {\n\t\t\t\tcontentOnly: false,\n\t\t\t\tstoreName: true\n\t\t\t});\n\t\t}\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { BROKEN_FLOW_ERROR_RETURN_LABEL, type InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class ThrowStatement extends StatementBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare type: NodeType.tThrowStatement;\n\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.argument.include(context, includeChildrenRecursively);\n\t\tcontext.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tthis.argument.render(code, options, { preventASI: true });\n\t\tif (this.argument.start === this.start + 5 /* 'throw'.length */) {\n\t\t\tcode.prependLeft(this.start + 5, ' ');\n\t\t}\n\t}\n}\n","import type { NormalizedTreeshakingOptions } from '../../rollup/types';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type BlockStatement from './BlockStatement';\nimport type CatchClause from './CatchClause';\nimport type * as NodeType from './NodeType';\nimport { INCLUDE_PARAMETERS, type IncludeChildren, StatementBase } from './shared/Node';\n\nexport default class TryStatement extends StatementBase {\n\tdeclare block: BlockStatement;\n\tdeclare finalizer: BlockStatement | null;\n\tdeclare handler: CatchClause | null;\n\tdeclare type: NodeType.tTryStatement;\n\n\tprivate directlyIncluded = false;\n\tprivate includedLabelsAfterBlock: string[] | null = null;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\treturn (\n\t\t\t((this.context.options.treeshake as NormalizedTreeshakingOptions).tryCatchDeoptimization\n\t\t\t\t? this.block.body.length > 0\n\t\t\t\t: this.block.hasEffects(context)) || !!this.finalizer?.hasEffects(context)\n\t\t);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tconst tryCatchDeoptimization = (this.context.options.treeshake as NormalizedTreeshakingOptions)\n\t\t\t?.tryCatchDeoptimization;\n\t\tconst { brokenFlow } = context;\n\t\tif (!this.directlyIncluded || !tryCatchDeoptimization) {\n\t\t\tthis.included = true;\n\t\t\tthis.directlyIncluded = true;\n\t\t\tthis.block.include(\n\t\t\t\tcontext,\n\t\t\t\ttryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively\n\t\t\t);\n\t\t\tif (context.includedLabels.size > 0) {\n\t\t\t\tthis.includedLabelsAfterBlock = [...context.includedLabels];\n\t\t\t}\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t} else if (this.includedLabelsAfterBlock) {\n\t\t\tfor (const label of this.includedLabelsAfterBlock) {\n\t\t\t\tcontext.includedLabels.add(label);\n\t\t\t}\n\t\t}\n\t\tif (this.handler !== null) {\n\t\t\tthis.handler.include(context, includeChildrenRecursively);\n\t\t\tcontext.brokenFlow = brokenFlow;\n\t\t}\n\t\tthis.finalizer?.include(context, includeChildrenRecursively);\n\t}\n}\n","import type { InclusionContext } from '../ExecutionContext';\nimport { NodeBase } from './shared/Node';\n\nexport default class UnknownNode extends NodeBase {\n\thasEffects(): boolean {\n\t\treturn true;\n\t}\n\n\tinclude(context: InclusionContext): void {\n\t\tsuper.include(context, true);\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport {\n\trenderSystemExportExpression,\n\trenderSystemExportSequenceAfterExpression,\n\trenderSystemExportSequenceBeforeExpression\n} from '../../utils/systemJsRendering';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport {\n\tINTERACTION_ACCESSED,\n\tNodeInteraction,\n\tNodeInteractionAssigned\n} from '../NodeInteractions';\nimport { EMPTY_PATH, type ObjectPath } from '../utils/PathTracker';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { UNKNOWN_EXPRESSION } from './shared/Expression';\nimport { type ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';\n\nexport default class UpdateExpression extends NodeBase {\n\tdeclare argument: ExpressionNode;\n\tdeclare operator: '++' | '--';\n\tdeclare prefix: boolean;\n\tdeclare type: NodeType.tUpdateExpression;\n\tprivate declare interaction: NodeInteractionAssigned;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn this.argument.hasEffectsAsAssignmentTarget(context, true);\n\t}\n\n\thasEffectsOnInteractionAtPath(path: ObjectPath, { type }: NodeInteraction): boolean {\n\t\treturn path.length > 1 || type !== INTERACTION_ACCESSED;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren) {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\tthis.included = true;\n\t\tthis.argument.includeAsAssignmentTarget(context, includeChildrenRecursively, true);\n\t}\n\n\tinitialise() {\n\t\tthis.argument.setAssignedValue(UNKNOWN_EXPRESSION);\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tthis.argument.render(code, options);\n\t\tif (format === 'system') {\n\t\t\tconst variable = this.argument.variable!;\n\t\t\tconst exportNames = exportNamesByVariable.get(variable);\n\t\t\tif (exportNames) {\n\t\t\t\tif (this.prefix) {\n\t\t\t\t\tif (exportNames.length === 1) {\n\t\t\t\t\t\trenderSystemExportExpression(variable, this.start, this.end, code, options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderSystemExportSequenceAfterExpression(\n\t\t\t\t\t\t\tvariable,\n\t\t\t\t\t\t\tthis.start,\n\t\t\t\t\t\t\tthis.end,\n\t\t\t\t\t\t\tthis.parent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\toptions\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst operator = this.operator[0];\n\t\t\t\t\trenderSystemExportSequenceBeforeExpression(\n\t\t\t\t\t\tvariable,\n\t\t\t\t\t\tthis.start,\n\t\t\t\t\t\tthis.end,\n\t\t\t\t\t\tthis.parent.type !== NodeType.ExpressionStatement,\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t\t`${_}${operator}${_}1`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations(): void {\n\t\tthis.deoptimized = true;\n\t\tthis.argument.deoptimizePath(EMPTY_PATH);\n\t\tif (this.argument instanceof Identifier) {\n\t\t\tconst variable = this.scope.findVariable(this.argument.name);\n\t\t\tvariable.isReassigned = true;\n\t\t}\n\t\tthis.context.requestTreeshakingPass();\n\t}\n}\n","import type MagicString from 'magic-string';\nimport { BLANK } from '../../utils/blank';\nimport { isReassignedExportsMember } from '../../utils/reassignedExportsMember';\nimport {\n\tfindFirstOccurrenceOutsideComment,\n\tfindNonWhiteSpace,\n\ttype RenderOptions\n} from '../../utils/renderHelpers';\nimport type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type { ObjectPath } from '../utils/PathTracker';\nimport { UNDEFINED_EXPRESSION } from '../values';\nimport Identifier from './Identifier';\nimport * as NodeType from './NodeType';\nimport { type ExpressionNode, type IncludeChildren, NodeBase } from './shared/Node';\nimport type { PatternNode } from './shared/Pattern';\n\nexport default class VariableDeclarator extends NodeBase {\n\tdeclare id: PatternNode;\n\tdeclare init: ExpressionNode | null;\n\tdeclare type: NodeType.tVariableDeclarator;\n\n\tdeclareDeclarator(kind: string): void {\n\t\tthis.id.declare(kind, this.init || UNDEFINED_EXPRESSION);\n\t}\n\n\tdeoptimizePath(path: ObjectPath): void {\n\t\tthis.id.deoptimizePath(path);\n\t}\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tconst initEffect = this.init?.hasEffects(context);\n\t\tthis.id.markDeclarationReached();\n\t\treturn initEffect || this.id.hasEffects(context);\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.init?.include(context, includeChildrenRecursively);\n\t\tthis.id.markDeclarationReached();\n\t\tif (includeChildrenRecursively || this.id.shouldBeIncluded(context)) {\n\t\t\tthis.id.include(context, includeChildrenRecursively);\n\t\t}\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tsnippets: { _ }\n\t\t} = options;\n\t\tconst renderId = this.id.included;\n\t\tif (renderId) {\n\t\t\tthis.id.render(code, options);\n\t\t} else {\n\t\t\tconst operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);\n\t\t\tcode.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));\n\t\t}\n\t\tif (this.init) {\n\t\t\tthis.init.render(\n\t\t\t\tcode,\n\t\t\t\toptions,\n\t\t\t\trenderId ? BLANK : { renderedSurroundingElement: NodeType.ExpressionStatement }\n\t\t\t);\n\t\t} else if (\n\t\t\tthis.id instanceof Identifier &&\n\t\t\tisReassignedExportsMember(this.id.variable!, exportNamesByVariable)\n\t\t) {\n\t\t\tcode.appendLeft(this.end, `${_}=${_}void 0`);\n\t\t}\n\t}\n\n\tprotected applyDeoptimizations() {}\n}\n","import type { HasEffectsContext, InclusionContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport {\n\ttype ExpressionNode,\n\ttype IncludeChildren,\n\tStatementBase,\n\ttype StatementNode\n} from './shared/Node';\n\nexport default class WhileStatement extends StatementBase {\n\tdeclare body: StatementNode;\n\tdeclare test: ExpressionNode;\n\tdeclare type: NodeType.tWhileStatement;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (this.test.hasEffects(context)) return true;\n\t\tconst {\n\t\t\tbrokenFlow,\n\t\t\tignore: { breaks, continues }\n\t\t} = context;\n\t\tcontext.ignore.breaks = true;\n\t\tcontext.ignore.continues = true;\n\t\tif (this.body.hasEffects(context)) return true;\n\t\tcontext.ignore.breaks = breaks;\n\t\tcontext.ignore.continues = continues;\n\t\tcontext.brokenFlow = brokenFlow;\n\t\treturn false;\n\t}\n\n\tinclude(context: InclusionContext, includeChildrenRecursively: IncludeChildren): void {\n\t\tthis.included = true;\n\t\tthis.test.include(context, includeChildrenRecursively);\n\t\tconst { brokenFlow } = context;\n\t\tthis.body.include(context, includeChildrenRecursively, { asSingleStatement: true });\n\t\tcontext.brokenFlow = brokenFlow;\n\t}\n}\n","import type MagicString from 'magic-string';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport type { HasEffectsContext } from '../ExecutionContext';\nimport type * as NodeType from './NodeType';\nimport { type ExpressionNode, NodeBase } from './shared/Node';\n\nexport default class YieldExpression extends NodeBase {\n\tdeclare argument: ExpressionNode | null;\n\tdeclare delegate: boolean;\n\tdeclare type: NodeType.tYieldExpression;\n\n\thasEffects(context: HasEffectsContext): boolean {\n\t\tif (!this.deoptimized) this.applyDeoptimizations();\n\t\treturn !(context.ignore.returnYield && !this.argument?.hasEffects(context));\n\t}\n\n\trender(code: MagicString, options: RenderOptions): void {\n\t\tif (this.argument) {\n\t\t\tthis.argument.render(code, options, { preventASI: true });\n\t\t\tif (this.argument.start === this.start + 5 /* 'yield'.length */) {\n\t\t\t\tcode.prependLeft(this.start + 5, ' ');\n\t\t\t}\n\t\t}\n\t}\n}\n","export const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';\n","import type Module from '../../Module';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from '../../utils/variableNames';\nimport Variable from './Variable';\n\nexport default class ExportShimVariable extends Variable {\n\tmodule: Module;\n\n\tconstructor(module: Module) {\n\t\tsuper(MISSING_EXPORT_SHIM_VARIABLE);\n\t\tthis.module = module;\n\t}\n\n\tinclude(): void {\n\t\tsuper.include();\n\t\tthis.module.needsExportShim = true;\n\t}\n}\n","import type Module from '../../Module';\nimport type { AstContext } from '../../Module';\nimport { getToStringTagValue, MERGE_NAMESPACES_VARIABLE } from '../../utils/interopHelpers';\nimport type { RenderOptions } from '../../utils/renderHelpers';\nimport { getSystemExportStatement } from '../../utils/systemJsRendering';\nimport type Identifier from '../nodes/Identifier';\nimport type ChildScope from '../scopes/ChildScope';\nimport Variable from './Variable';\n\nexport default class NamespaceVariable extends Variable {\n\tcontext: AstContext;\n\tdeclare isNamespace: true;\n\tmodule: Module;\n\n\tprivate memberVariables: { [name: string]: Variable } | null = null;\n\tprivate mergedNamespaces: readonly Variable[] = [];\n\tprivate referencedEarly = false;\n\tprivate references: Identifier[] = [];\n\n\tconstructor(context: AstContext) {\n\t\tsuper(context.getModuleName());\n\t\tthis.context = context;\n\t\tthis.module = context.module;\n\t}\n\n\taddReference(identifier: Identifier): void {\n\t\tthis.references.push(identifier);\n\t\tthis.name = identifier.name;\n\t}\n\n\tgetMemberVariables(): { [name: string]: Variable } {\n\t\tif (this.memberVariables) {\n\t\t\treturn this.memberVariables;\n\t\t}\n\t\tconst memberVariables: { [name: string]: Variable } = Object.create(null);\n\t\tfor (const name of this.context.getExports().concat(this.context.getReexports())) {\n\t\t\tif (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {\n\t\t\t\tconst exportedVariable = this.context.traceExport(name);\n\t\t\t\tif (exportedVariable) {\n\t\t\t\t\tmemberVariables[name] = exportedVariable;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (this.memberVariables = memberVariables);\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t\tthis.context.includeAllExports();\n\t}\n\n\tprepare(accessedGlobalsByScope: Map>): void {\n\t\tif (this.mergedNamespaces.length > 0) {\n\t\t\tthis.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope);\n\t\t}\n\t}\n\n\trenderBlock(options: RenderOptions): string {\n\t\tconst {\n\t\t\texportNamesByVariable,\n\t\t\tformat,\n\t\t\tfreeze,\n\t\t\tindent: t,\n\t\t\tnamespaceToStringTag,\n\t\t\tsnippets: { _, cnst, getObject, getPropertyAccess, n, s }\n\t\t} = options;\n\t\tconst memberVariables = this.getMemberVariables();\n\t\tconst members: [key: string | null, value: string][] = Object.entries(memberVariables).map(\n\t\t\t([name, original]) => {\n\t\t\t\tif (this.referencedEarly || original.isReassigned) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t`get ${name}${_}()${_}{${_}return ${original.getName(getPropertyAccess)}${s}${_}}`\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\treturn [name, original.getName(getPropertyAccess)];\n\t\t\t}\n\t\t);\n\t\tmembers.unshift([null, `__proto__:${_}null`]);\n\n\t\tlet output = getObject(members, { lineBreakIndent: { base: '', t } });\n\t\tif (this.mergedNamespaces.length > 0) {\n\t\t\tconst assignmentArgs = this.mergedNamespaces.map(variable =>\n\t\t\t\tvariable.getName(getPropertyAccess)\n\t\t\t);\n\t\t\toutput = `/*#__PURE__*/${MERGE_NAMESPACES_VARIABLE}(${output},${_}[${assignmentArgs.join(\n\t\t\t\t`,${_}`\n\t\t\t)}])`;\n\t\t} else {\n\t\t\t// The helper to merge namespaces will also take care of freezing and toStringTag\n\t\t\tif (namespaceToStringTag) {\n\t\t\t\toutput = `/*#__PURE__*/Object.defineProperty(${output},${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\t\tgetObject\n\t\t\t\t)})`;\n\t\t\t}\n\t\t\tif (freeze) {\n\t\t\t\toutput = `/*#__PURE__*/Object.freeze(${output})`;\n\t\t\t}\n\t\t}\n\n\t\tconst name = this.getName(getPropertyAccess);\n\t\toutput = `${cnst} ${name}${_}=${_}${output};`;\n\n\t\tif (format === 'system' && exportNamesByVariable.has(this)) {\n\t\t\toutput += `${n}${getSystemExportStatement([this], options)};`;\n\t\t}\n\n\t\treturn output;\n\t}\n\n\trenderFirst(): boolean {\n\t\treturn this.referencedEarly;\n\t}\n\n\tsetMergedNamespaces(mergedNamespaces: readonly Variable[]): void {\n\t\tthis.mergedNamespaces = mergedNamespaces;\n\t\tconst moduleExecIndex = this.context.getModuleExecIndex();\n\t\tfor (const identifier of this.references) {\n\t\t\tif (identifier.context.getModuleExecIndex() <= moduleExecIndex) {\n\t\t\t\tthis.referencedEarly = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nNamespaceVariable.prototype.isNamespace = true;\n","import type Module from '../../Module';\nimport type { AstContext } from '../../Module';\nimport ExportDefaultVariable from './ExportDefaultVariable';\nimport Variable from './Variable';\n\nexport default class SyntheticNamedExportVariable extends Variable {\n\tcontext: AstContext;\n\tmodule: Module;\n\tsyntheticNamespace: Variable;\n\n\tprivate baseVariable: Variable | null = null;\n\n\tconstructor(context: AstContext, name: string, syntheticNamespace: Variable) {\n\t\tsuper(name);\n\t\tthis.context = context;\n\t\tthis.module = context.module;\n\t\tthis.syntheticNamespace = syntheticNamespace;\n\t}\n\n\tgetBaseVariable(): Variable {\n\t\tif (this.baseVariable) return this.baseVariable;\n\t\tlet baseVariable = this.syntheticNamespace;\n\t\twhile (\n\t\t\tbaseVariable instanceof ExportDefaultVariable ||\n\t\t\tbaseVariable instanceof SyntheticNamedExportVariable\n\t\t) {\n\t\t\tif (baseVariable instanceof ExportDefaultVariable) {\n\t\t\t\tconst original = baseVariable.getOriginalVariable();\n\t\t\t\tif (original === baseVariable) break;\n\t\t\t\tbaseVariable = original;\n\t\t\t}\n\t\t\tif (baseVariable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tbaseVariable = baseVariable.syntheticNamespace;\n\t\t\t}\n\t\t}\n\t\treturn (this.baseVariable = baseVariable);\n\t}\n\n\tgetBaseVariableName(): string {\n\t\treturn this.syntheticNamespace.getBaseVariableName();\n\t}\n\n\tgetName(getPropertyAccess: (name: string) => string): string {\n\t\treturn `${this.syntheticNamespace.getName(getPropertyAccess)}${getPropertyAccess(this.name)}`;\n\t}\n\n\tinclude(): void {\n\t\tthis.included = true;\n\t\tthis.context.includeVariableInModule(this.syntheticNamespace);\n\t}\n\n\tsetRenderNames(baseName: string | null, name: string | null): void {\n\t\tsuper.setRenderNames(baseName, name);\n\t}\n}\n","export enum BuildPhase {\n\tLOAD_AND_PARSE = 0,\n\tANALYSE,\n\tGENERATE\n}\n","export function getId(m: { id: string | null }): string {\n\treturn m.id!;\n}\n","const global =\n\ttypeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : {};\n\nexport default 'performance' in global\n\t? performance\n\t: {\n\t\t\tnow(): 0 {\n\t\t\t\treturn 0;\n\t\t\t}\n\t };\n","interface MemoryUsage {\n\theapUsed: 0;\n}\n\nexport default {\n\tmemoryUsage(): MemoryUsage {\n\t\treturn {\n\t\t\theapUsed: 0\n\t\t};\n\t}\n};\n","import type { InputOptions, Plugin, SerializedTimings } from '../rollup/types';\nimport performance from './performance';\nimport process from './process';\n\ninterface Timer {\n\tmemory: number;\n\tstartMemory: number;\n\tstartTime: number;\n\ttime: number;\n\ttotalMemory: number;\n}\n\nconst NOOP = (): void => {};\n\nlet timers = new Map();\n\nfunction getPersistedLabel(label: string, level: number): string {\n\tswitch (level) {\n\t\tcase 1:\n\t\t\treturn `# ${label}`;\n\t\tcase 2:\n\t\t\treturn `## ${label}`;\n\t\tcase 3:\n\t\t\treturn label;\n\t\tdefault:\n\t\t\treturn `${' '.repeat(level - 4)}- ${label}`;\n\t}\n}\n\nfunction timeStartImpl(label: string, level = 3): void {\n\tlabel = getPersistedLabel(label, level);\n\n\tconst startMemory = process.memoryUsage().heapUsed;\n\tconst startTime = performance.now();\n\n\tconst timer = timers.get(label);\n\n\tif (timer === undefined) {\n\t\ttimers.set(label, {\n\t\t\tmemory: 0,\n\t\t\tstartMemory,\n\t\t\tstartTime,\n\t\t\ttime: 0,\n\t\t\ttotalMemory: 0\n\t\t});\n\t} else {\n\t\ttimer.startMemory = startMemory;\n\t\ttimer.startTime = startTime;\n\t}\n}\n\nfunction timeEndImpl(label: string, level = 3): void {\n\tlabel = getPersistedLabel(label, level);\n\n\tconst timer = timers.get(label);\n\n\tif (timer !== undefined) {\n\t\tconst currentMemory = process.memoryUsage().heapUsed;\n\t\ttimer.memory += currentMemory - timer.startMemory;\n\t\ttimer.time += performance.now() - timer.startTime;\n\t\ttimer.totalMemory = Math.max(timer.totalMemory, currentMemory);\n\t}\n}\n\nexport function getTimings(): SerializedTimings {\n\tconst newTimings: SerializedTimings = {};\n\n\tfor (const [label, { memory, time, totalMemory }] of timers) {\n\t\tnewTimings[label] = [time, memory, totalMemory];\n\t}\n\treturn newTimings;\n}\n\nexport let timeStart: (label: string, level?: number) => void = NOOP;\nexport let timeEnd: (label: string, level?: number) => void = NOOP;\n\nconst TIMED_PLUGIN_HOOKS = ['load', 'resolveDynamicImport', 'resolveId', 'transform'] as const;\n\nfunction getPluginWithTimers(plugin: any, index: number): Plugin {\n\tfor (const hook of TIMED_PLUGIN_HOOKS) {\n\t\tif (hook in plugin) {\n\t\t\tlet timerLabel = `plugin ${index}`;\n\t\t\tif (plugin.name) {\n\t\t\t\ttimerLabel += ` (${plugin.name})`;\n\t\t\t}\n\t\t\ttimerLabel += ` - ${hook}`;\n\n\t\t\tconst func = plugin[hook];\n\n\t\t\tplugin[hook] = function (...args: readonly unknown[]) {\n\t\t\t\ttimeStart(timerLabel, 4);\n\t\t\t\tconst result = func.apply(this, args);\n\t\t\t\ttimeEnd(timerLabel, 4);\n\t\t\t\tif (result && typeof result.then === 'function') {\n\t\t\t\t\ttimeStart(`${timerLabel} (async)`, 4);\n\t\t\t\t\treturn result.then((hookResult: unknown) => {\n\t\t\t\t\t\ttimeEnd(`${timerLabel} (async)`, 4);\n\t\t\t\t\t\treturn hookResult;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t}\n\treturn plugin;\n}\n\nexport function initialiseTimers(inputOptions: InputOptions): void {\n\tif (inputOptions.perf) {\n\t\ttimers = new Map();\n\t\ttimeStart = timeStartImpl;\n\t\ttimeEnd = timeEndImpl;\n\t\tinputOptions.plugins = inputOptions.plugins!.map(getPluginWithTimers);\n\t} else {\n\t\ttimeStart = NOOP;\n\t\ttimeEnd = NOOP;\n\t}\n}\n","import ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\n\nexport function markModuleAndImpureDependenciesAsExecuted(baseModule: Module): void {\n\tbaseModule.isExecuted = true;\n\tconst modules = [baseModule];\n\tconst visitedModules = new Set();\n\tfor (const module of modules) {\n\t\tfor (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) {\n\t\t\tif (\n\t\t\t\t!(dependency instanceof ExternalModule) &&\n\t\t\t\t!dependency.isExecuted &&\n\t\t\t\t(dependency.info.moduleSideEffects || module.implicitlyLoadedBefore.has(dependency)) &&\n\t\t\t\t!visitedModules.has(dependency.id)\n\t\t\t) {\n\t\t\t\tdependency.isExecuted = true;\n\t\t\t\tvisitedModules.add(dependency.id);\n\t\t\t\tmodules.push(dependency);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { extractAssignedNames } from '@rollup/pluginutils';\nimport * as acorn from 'acorn';\nimport { locate } from 'locate-character';\nimport MagicString from 'magic-string';\nimport ExternalModule from './ExternalModule';\nimport type Graph from './Graph';\nimport { createHasEffectsContext, createInclusionContext } from './ast/ExecutionContext';\nimport { nodeConstructors } from './ast/nodes';\nimport ExportAllDeclaration from './ast/nodes/ExportAllDeclaration';\nimport ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration';\nimport type ExportNamedDeclaration from './ast/nodes/ExportNamedDeclaration';\nimport type Identifier from './ast/nodes/Identifier';\nimport type ImportDeclaration from './ast/nodes/ImportDeclaration';\nimport type ImportExpression from './ast/nodes/ImportExpression';\nimport Literal from './ast/nodes/Literal';\nimport type MetaProperty from './ast/nodes/MetaProperty';\nimport * as NodeType from './ast/nodes/NodeType';\nimport Program from './ast/nodes/Program';\nimport TemplateLiteral from './ast/nodes/TemplateLiteral';\nimport VariableDeclaration from './ast/nodes/VariableDeclaration';\nimport type { ExpressionNode, NodeBase } from './ast/nodes/shared/Node';\nimport ModuleScope from './ast/scopes/ModuleScope';\nimport { type PathTracker, UNKNOWN_PATH } from './ast/utils/PathTracker';\nimport ExportDefaultVariable from './ast/variables/ExportDefaultVariable';\nimport ExportShimVariable from './ast/variables/ExportShimVariable';\nimport ExternalVariable from './ast/variables/ExternalVariable';\nimport NamespaceVariable from './ast/variables/NamespaceVariable';\nimport SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable';\nimport type Variable from './ast/variables/Variable';\nimport type {\n\tCustomPluginOptions,\n\tDecodedSourceMapOrMissing,\n\tEmittedFile,\n\tExistingDecodedSourceMap,\n\tModuleInfo,\n\tModuleJSON,\n\tModuleOptions,\n\tNormalizedInputOptions,\n\tPartialNull,\n\tPreserveEntrySignaturesOption,\n\tResolvedId,\n\tResolvedIdMap,\n\tRollupError,\n\tRollupLogProps,\n\tRollupWarning,\n\tTransformModuleJSON\n} from './rollup/types';\nimport { EMPTY_OBJECT } from './utils/blank';\nimport { BuildPhase } from './utils/buildPhase';\nimport {\n\taugmentCodeLocation,\n\terrAmbiguousExternalNamespaces,\n\terrCircularReexport,\n\terrMissingExport,\n\terrNamespaceConflict,\n\terror,\n\terrSyntheticNamedExportsNeedNamespaceExport,\n\twarnDeprecation\n} from './utils/error';\nimport { getId } from './utils/getId';\nimport { getOrCreate } from './utils/getOrCreate';\nimport { getOriginalLocation } from './utils/getOriginalLocation';\nimport { makeLegal } from './utils/identifierHelpers';\nimport { basename, extname } from './utils/path';\nimport relativeId from './utils/relativeId';\nimport type { RenderOptions } from './utils/renderHelpers';\nimport { timeEnd, timeStart } from './utils/timers';\nimport { markModuleAndImpureDependenciesAsExecuted } from './utils/traverseStaticDependencies';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames';\n\ninterface ImportDescription {\n\tmodule: Module | ExternalModule;\n\tname: string;\n\tsource: string;\n\tstart: number;\n}\n\ninterface ExportDescription {\n\tidentifier: string | null;\n\tlocalName: string;\n}\n\ninterface ReexportDescription {\n\tlocalName: string;\n\tmodule: Module | ExternalModule;\n\tsource: string;\n\tstart: number;\n}\n\nexport interface AstContext {\n\taddDynamicImport: (node: ImportExpression) => void;\n\taddExport: (\n\t\tnode: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration\n\t) => void;\n\taddImport: (node: ImportDeclaration) => void;\n\taddImportMeta: (node: MetaProperty) => void;\n\tcode: string;\n\tdeoptimizationTracker: PathTracker;\n\terror: (props: RollupError, pos: number) => never;\n\tfileName: string;\n\tgetExports: () => string[];\n\tgetModuleExecIndex: () => number;\n\tgetModuleName: () => string;\n\tgetNodeConstructor: (name: string) => typeof NodeBase;\n\tgetReexports: () => string[];\n\timportDescriptions: Map;\n\tincludeAllExports: () => void;\n\tincludeDynamicImport: (node: ImportExpression) => void;\n\tincludeVariableInModule: (variable: Variable) => void;\n\tmagicString: MagicString;\n\tmodule: Module; // not to be used for tree-shaking\n\tmoduleContext: string;\n\toptions: NormalizedInputOptions;\n\trequestTreeshakingPass: () => void;\n\ttraceExport: (name: string) => Variable | null;\n\ttraceVariable: (name: string) => Variable | null;\n\tusesTopLevelAwait: boolean;\n\twarn: (warning: RollupWarning, pos: number) => void;\n}\n\nexport interface DynamicImport {\n\targument: string | ExpressionNode;\n\tid: string | null;\n\tnode: ImportExpression;\n\tresolution: Module | ExternalModule | string | null;\n}\n\nconst MISSING_EXPORT_SHIM_DESCRIPTION: ExportDescription = {\n\tidentifier: null,\n\tlocalName: MISSING_EXPORT_SHIM_VARIABLE\n};\n\nfunction getVariableForExportNameRecursive(\n\ttarget: Module | ExternalModule,\n\tname: string,\n\timporterForSideEffects: Module | undefined,\n\tisExportAllSearch: boolean | undefined,\n\tsearchedNamesAndModules = new Map>()\n): [variable: Variable | null, indirectExternal?: boolean] {\n\tconst searchedModules = searchedNamesAndModules.get(name);\n\tif (searchedModules) {\n\t\tif (searchedModules.has(target)) {\n\t\t\treturn isExportAllSearch ? [null] : error(errCircularReexport(name, target.id));\n\t\t}\n\t\tsearchedModules.add(target);\n\t} else {\n\t\tsearchedNamesAndModules.set(name, new Set([target]));\n\t}\n\treturn target.getVariableForExportName(name, {\n\t\timporterForSideEffects,\n\t\tisExportAllSearch,\n\t\tsearchedNamesAndModules\n\t});\n}\n\nfunction getAndExtendSideEffectModules(variable: Variable, module: Module): Set {\n\tconst sideEffectModules = getOrCreate(\n\t\tmodule.sideEffectDependenciesByVariable,\n\t\tvariable,\n\t\t() => new Set()\n\t);\n\tlet currentVariable: Variable | null = variable;\n\tconst referencedVariables = new Set([currentVariable]);\n\twhile (true) {\n\t\tconst importingModule = currentVariable.module! as Module;\n\t\tcurrentVariable =\n\t\t\tcurrentVariable instanceof ExportDefaultVariable\n\t\t\t\t? currentVariable.getDirectOriginalVariable()\n\t\t\t\t: currentVariable instanceof SyntheticNamedExportVariable\n\t\t\t\t? currentVariable.syntheticNamespace\n\t\t\t\t: null;\n\t\tif (!currentVariable || referencedVariables.has(currentVariable)) {\n\t\t\tbreak;\n\t\t}\n\t\treferencedVariables.add(currentVariable);\n\t\tsideEffectModules.add(importingModule);\n\t\tconst originalSideEffects =\n\t\t\timportingModule.sideEffectDependenciesByVariable.get(currentVariable);\n\t\tif (originalSideEffects) {\n\t\t\tfor (const module of originalSideEffects) {\n\t\t\t\tsideEffectModules.add(module);\n\t\t\t}\n\t\t}\n\t}\n\treturn sideEffectModules;\n}\n\nexport default class Module {\n\treadonly alternativeReexportModules = new Map();\n\treadonly chunkFileNames = new Set();\n\tchunkNames: {\n\t\tisUserDefined: boolean;\n\t\tname: string;\n\t\tpriority: number;\n\t}[] = [];\n\treadonly cycles = new Set();\n\treadonly dependencies = new Set();\n\treadonly dynamicDependencies = new Set();\n\treadonly dynamicImporters: string[] = [];\n\treadonly dynamicImports: DynamicImport[] = [];\n\texcludeFromSourcemap: boolean;\n\texecIndex = Infinity;\n\treadonly implicitlyLoadedAfter = new Set();\n\treadonly implicitlyLoadedBefore = new Set();\n\treadonly importDescriptions = new Map();\n\treadonly importMetas: MetaProperty[] = [];\n\timportedFromNotTreeshaken = false;\n\treadonly importers: string[] = [];\n\treadonly includedDynamicImporters: Module[] = [];\n\treadonly includedImports = new Set();\n\treadonly info: ModuleInfo;\n\tisExecuted = false;\n\tisUserDefinedEntryPoint = false;\n\tdeclare namespace: NamespaceVariable;\n\tneedsExportShim = false;\n\tdeclare originalCode: string;\n\tdeclare originalSourcemap: ExistingDecodedSourceMap | null;\n\tpreserveSignature: PreserveEntrySignaturesOption;\n\tdeclare resolvedIds: ResolvedIdMap;\n\tdeclare scope: ModuleScope;\n\treadonly sideEffectDependenciesByVariable = new Map>();\n\tdeclare sourcemapChain: DecodedSourceMapOrMissing[];\n\treadonly sources = new Set();\n\tdeclare transformFiles?: EmittedFile[];\n\tusesTopLevelAwait = false;\n\n\tprivate allExportNames: Set | null = null;\n\tprivate ast: Program | null = null;\n\tprivate declare astContext: AstContext;\n\tprivate readonly context: string;\n\tprivate declare customTransformCache: boolean;\n\tprivate readonly exportAllModules: (Module | ExternalModule)[] = [];\n\tprivate readonly exportAllSources = new Set();\n\tprivate exportNamesByVariable: Map | null = null;\n\tprivate readonly exportShimVariable = new ExportShimVariable(this);\n\tprivate readonly exports = new Map();\n\tprivate declare magicString: MagicString;\n\tprivate readonly namespaceReexportsByName = new Map<\n\t\tstring,\n\t\t[variable: Variable | null, indirectExternal?: boolean]\n\t>();\n\tprivate readonly reexportDescriptions = new Map();\n\tprivate relevantDependencies: Set | null = null;\n\tprivate readonly syntheticExports = new Map();\n\tprivate syntheticNamespace: Variable | null | undefined = null;\n\tprivate transformDependencies: string[] = [];\n\tprivate transitiveReexports: string[] | null = null;\n\n\tconstructor(\n\t\tprivate readonly graph: Graph,\n\t\tpublic readonly id: string,\n\t\tprivate readonly options: NormalizedInputOptions,\n\t\tisEntry: boolean,\n\t\tmoduleSideEffects: boolean | 'no-treeshake',\n\t\tsyntheticNamedExports: boolean | string,\n\t\tmeta: CustomPluginOptions\n\t) {\n\t\tthis.excludeFromSourcemap = /\\0/.test(id);\n\t\tthis.context = options.moduleContext(id);\n\t\tthis.preserveSignature = this.options.preserveEntrySignatures;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-this-alias\n\t\tconst module = this;\n\t\tconst {\n\t\t\tdynamicImports,\n\t\t\tdynamicImporters,\n\t\t\timplicitlyLoadedAfter,\n\t\t\timplicitlyLoadedBefore,\n\t\t\timporters,\n\t\t\treexportDescriptions,\n\t\t\tsources\n\t\t} = this;\n\n\t\tthis.info = {\n\t\t\tast: null,\n\t\t\tcode: null,\n\t\t\tget dynamicallyImportedIdResolutions() {\n\t\t\t\treturn dynamicImports\n\t\t\t\t\t.map(({ argument }) => typeof argument === 'string' && module.resolvedIds[argument])\n\t\t\t\t\t.filter(Boolean) as ResolvedId[];\n\t\t\t},\n\t\t\tget dynamicallyImportedIds() {\n\t\t\t\t// We cannot use this.dynamicDependencies because this is needed before\n\t\t\t\t// dynamicDependencies are populated\n\t\t\t\treturn dynamicImports.map(({ id }) => id).filter((id): id is string => id != null);\n\t\t\t},\n\t\t\tget dynamicImporters() {\n\t\t\t\treturn dynamicImporters.sort();\n\t\t\t},\n\t\t\tget hasDefaultExport() {\n\t\t\t\t// This information is only valid after parsing\n\t\t\t\tif (!module.ast) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn module.exports.has('default') || reexportDescriptions.has('default');\n\t\t\t},\n\t\t\tget hasModuleSideEffects() {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.',\n\t\t\t\t\tfalse,\n\t\t\t\t\toptions\n\t\t\t\t);\n\t\t\t\treturn this.moduleSideEffects;\n\t\t\t},\n\t\t\tid,\n\t\t\tget implicitlyLoadedAfterOneOf() {\n\t\t\t\treturn Array.from(implicitlyLoadedAfter, getId).sort();\n\t\t\t},\n\t\t\tget implicitlyLoadedBefore() {\n\t\t\t\treturn Array.from(implicitlyLoadedBefore, getId).sort();\n\t\t\t},\n\t\t\tget importedIdResolutions() {\n\t\t\t\treturn Array.from(sources, source => module.resolvedIds[source]).filter(Boolean);\n\t\t\t},\n\t\t\tget importedIds() {\n\t\t\t\t// We cannot use this.dependencies because this is needed before\n\t\t\t\t// dependencies are populated\n\t\t\t\treturn Array.from(sources, source => module.resolvedIds[source]?.id).filter(Boolean);\n\t\t\t},\n\t\t\tget importers() {\n\t\t\t\treturn importers.sort();\n\t\t\t},\n\t\t\tisEntry,\n\t\t\tisExternal: false,\n\t\t\tget isIncluded() {\n\t\t\t\tif (graph.phase !== BuildPhase.GENERATE) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn module.isIncluded();\n\t\t\t},\n\t\t\tmeta: { ...meta },\n\t\t\tmoduleSideEffects,\n\t\t\tsyntheticNamedExports\n\t\t};\n\t\t// Hide the deprecated key so that it only warns when accessed explicitly\n\t\tObject.defineProperty(this.info, 'hasModuleSideEffects', {\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tbasename(): string {\n\t\tconst base = basename(this.id);\n\t\tconst ext = extname(this.id);\n\n\t\treturn makeLegal(ext ? base.slice(0, -ext.length) : base);\n\t}\n\n\tbindReferences(): void {\n\t\tthis.ast!.bind();\n\t}\n\n\terror(props: RollupError, pos: number): never {\n\t\tthis.addLocationToLogProps(props, pos);\n\t\treturn error(props);\n\t}\n\n\tgetAllExportNames(): Set {\n\t\tif (this.allExportNames) {\n\t\t\treturn this.allExportNames;\n\t\t}\n\t\tthis.allExportNames = new Set([...this.exports.keys(), ...this.reexportDescriptions.keys()]);\n\t\tfor (const module of this.exportAllModules) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tthis.allExportNames.add(`*${module.id}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tfor (const name of module.getAllExportNames()) {\n\t\t\t\tif (name !== 'default') this.allExportNames.add(name);\n\t\t\t}\n\t\t}\n\t\t// We do not count the synthetic namespace as a regular export to hide it\n\t\t// from entry signatures and namespace objects\n\t\tif (typeof this.info.syntheticNamedExports === 'string') {\n\t\t\tthis.allExportNames.delete(this.info.syntheticNamedExports);\n\t\t}\n\t\treturn this.allExportNames;\n\t}\n\n\tgetDependenciesToBeIncluded(): Set {\n\t\tif (this.relevantDependencies) return this.relevantDependencies;\n\n\t\tthis.relevantDependencies = new Set();\n\t\tconst necessaryDependencies = new Set();\n\t\tconst alwaysCheckedDependencies = new Set();\n\t\tconst dependencyVariables = new Set(this.includedImports);\n\n\t\tif (\n\t\t\tthis.info.isEntry ||\n\t\t\tthis.includedDynamicImporters.length > 0 ||\n\t\t\tthis.namespace.included ||\n\t\t\tthis.implicitlyLoadedAfter.size > 0\n\t\t) {\n\t\t\tfor (const exportName of [...this.getReexports(), ...this.getExports()]) {\n\t\t\t\tconst [exportedVariable] = this.getVariableForExportName(exportName);\n\t\t\t\tif (exportedVariable) {\n\t\t\t\t\tdependencyVariables.add(exportedVariable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let variable of dependencyVariables) {\n\t\t\tconst sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);\n\t\t\tif (sideEffectDependencies) {\n\t\t\t\tfor (const module of sideEffectDependencies) {\n\t\t\t\t\talwaysCheckedDependencies.add(module);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tvariable = variable.getBaseVariable();\n\t\t\t} else if (variable instanceof ExportDefaultVariable) {\n\t\t\t\tvariable = variable.getOriginalVariable();\n\t\t\t}\n\t\t\tnecessaryDependencies.add(variable.module!);\n\t\t}\n\t\tif (!this.options.treeshake || this.info.moduleSideEffects === 'no-treeshake') {\n\t\t\tfor (const dependency of this.dependencies) {\n\t\t\t\tthis.relevantDependencies.add(dependency);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.addRelevantSideEffectDependencies(\n\t\t\t\tthis.relevantDependencies,\n\t\t\t\tnecessaryDependencies,\n\t\t\t\talwaysCheckedDependencies\n\t\t\t);\n\t\t}\n\t\tfor (const dependency of necessaryDependencies) {\n\t\t\tthis.relevantDependencies.add(dependency);\n\t\t}\n\t\treturn this.relevantDependencies;\n\t}\n\n\tgetExportNamesByVariable(): Map {\n\t\tif (this.exportNamesByVariable) {\n\t\t\treturn this.exportNamesByVariable;\n\t\t}\n\t\tconst exportNamesByVariable = new Map();\n\t\tfor (const exportName of this.getAllExportNames()) {\n\t\t\tlet [tracedVariable] = this.getVariableForExportName(exportName);\n\t\t\tif (tracedVariable instanceof ExportDefaultVariable) {\n\t\t\t\ttracedVariable = tracedVariable.getOriginalVariable();\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!tracedVariable ||\n\t\t\t\t!(tracedVariable.included || tracedVariable instanceof ExternalVariable)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst existingExportNames = exportNamesByVariable.get(tracedVariable);\n\t\t\tif (existingExportNames) {\n\t\t\t\texistingExportNames.push(exportName);\n\t\t\t} else {\n\t\t\t\texportNamesByVariable.set(tracedVariable, [exportName]);\n\t\t\t}\n\t\t}\n\t\treturn (this.exportNamesByVariable = exportNamesByVariable);\n\t}\n\n\tgetExports(): string[] {\n\t\treturn Array.from(this.exports.keys());\n\t}\n\n\tgetReexports(): string[] {\n\t\tif (this.transitiveReexports) {\n\t\t\treturn this.transitiveReexports;\n\t\t}\n\t\t// to avoid infinite recursion when using circular `export * from X`\n\t\tthis.transitiveReexports = [];\n\n\t\tconst reexports = new Set(this.reexportDescriptions.keys());\n\n\t\tfor (const module of this.exportAllModules) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\treexports.add(`*${module.id}`);\n\t\t\t} else {\n\t\t\t\tfor (const name of [...module.getReexports(), ...module.getExports()]) {\n\t\t\t\t\tif (name !== 'default') reexports.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn (this.transitiveReexports = [...reexports]);\n\t}\n\n\tgetRenderedExports(): { removedExports: string[]; renderedExports: string[] } {\n\t\t// only direct exports are counted here, not reexports at all\n\t\tconst renderedExports: string[] = [];\n\t\tconst removedExports: string[] = [];\n\t\tfor (const exportName of this.exports.keys()) {\n\t\t\tconst [variable] = this.getVariableForExportName(exportName);\n\t\t\t(variable && variable.included ? renderedExports : removedExports).push(exportName);\n\t\t}\n\t\treturn { removedExports, renderedExports };\n\t}\n\n\tgetSyntheticNamespace(): Variable {\n\t\tif (this.syntheticNamespace === null) {\n\t\t\tthis.syntheticNamespace = undefined;\n\t\t\t[this.syntheticNamespace] = this.getVariableForExportName(\n\t\t\t\ttypeof this.info.syntheticNamedExports === 'string'\n\t\t\t\t\t? this.info.syntheticNamedExports\n\t\t\t\t\t: 'default',\n\t\t\t\t{ onlyExplicit: true }\n\t\t\t);\n\t\t}\n\t\tif (!this.syntheticNamespace) {\n\t\t\treturn error(\n\t\t\t\terrSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports)\n\t\t\t);\n\t\t}\n\t\treturn this.syntheticNamespace;\n\t}\n\n\tgetVariableForExportName(\n\t\tname: string,\n\t\t{\n\t\t\timporterForSideEffects,\n\t\t\tisExportAllSearch,\n\t\t\tonlyExplicit,\n\t\t\tsearchedNamesAndModules\n\t\t}: {\n\t\t\timporterForSideEffects?: Module;\n\t\t\tisExportAllSearch?: boolean;\n\t\t\tonlyExplicit?: boolean;\n\t\t\tsearchedNamesAndModules?: Map>;\n\t\t} = EMPTY_OBJECT\n\t): [variable: Variable | null, indirectExternal?: boolean] {\n\t\tif (name[0] === '*') {\n\t\t\tif (name.length === 1) {\n\t\t\t\t// export * from './other'\n\t\t\t\treturn [this.namespace];\n\t\t\t}\n\t\t\t// export * from 'external'\n\t\t\tconst module = this.graph.modulesById.get(name.slice(1)) as ExternalModule;\n\t\t\treturn module.getVariableForExportName('*');\n\t\t}\n\n\t\t// export { foo } from './other'\n\t\tconst reexportDeclaration = this.reexportDescriptions.get(name);\n\t\tif (reexportDeclaration) {\n\t\t\tconst [variable] = getVariableForExportNameRecursive(\n\t\t\t\treexportDeclaration.module,\n\t\t\t\treexportDeclaration.localName,\n\t\t\t\timporterForSideEffects,\n\t\t\t\tfalse,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t);\n\t\t\tif (!variable) {\n\t\t\t\treturn this.error(\n\t\t\t\t\terrMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id),\n\t\t\t\t\treexportDeclaration.start\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (importerForSideEffects) {\n\t\t\t\tsetAlternativeExporterIfCyclic(variable, importerForSideEffects, this);\n\t\t\t}\n\t\t\treturn [variable];\n\t\t}\n\n\t\tconst exportDeclaration = this.exports.get(name);\n\t\tif (exportDeclaration) {\n\t\t\tif (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {\n\t\t\t\treturn [this.exportShimVariable];\n\t\t\t}\n\t\t\tconst name = exportDeclaration.localName;\n\t\t\tconst variable = this.traceVariable(name, {\n\t\t\t\timporterForSideEffects,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t})!;\n\t\t\tif (importerForSideEffects) {\n\t\t\t\tgetOrCreate(\n\t\t\t\t\timporterForSideEffects.sideEffectDependenciesByVariable,\n\t\t\t\t\tvariable,\n\t\t\t\t\t() => new Set()\n\t\t\t\t).add(this);\n\t\t\t\tsetAlternativeExporterIfCyclic(variable, importerForSideEffects, this);\n\t\t\t}\n\t\t\treturn [variable];\n\t\t}\n\n\t\tif (onlyExplicit) {\n\t\t\treturn [null];\n\t\t}\n\n\t\tif (name !== 'default') {\n\t\t\tconst foundNamespaceReexport =\n\t\t\t\tthis.namespaceReexportsByName.get(name) ??\n\t\t\t\tthis.getVariableFromNamespaceReexports(\n\t\t\t\t\tname,\n\t\t\t\t\timporterForSideEffects,\n\t\t\t\t\tsearchedNamesAndModules\n\t\t\t\t);\n\t\t\tthis.namespaceReexportsByName.set(name, foundNamespaceReexport);\n\t\t\tif (foundNamespaceReexport[0]) {\n\t\t\t\treturn foundNamespaceReexport;\n\t\t\t}\n\t\t}\n\n\t\tif (this.info.syntheticNamedExports) {\n\t\t\treturn [\n\t\t\t\tgetOrCreate(\n\t\t\t\t\tthis.syntheticExports,\n\t\t\t\t\tname,\n\t\t\t\t\t() =>\n\t\t\t\t\t\tnew SyntheticNamedExportVariable(this.astContext, name, this.getSyntheticNamespace())\n\t\t\t\t)\n\t\t\t];\n\t\t}\n\n\t\t// we don't want to create shims when we are just\n\t\t// probing export * modules for exports\n\t\tif (!isExportAllSearch) {\n\t\t\tif (this.options.shimMissingExports) {\n\t\t\t\tthis.shimMissingExport(name);\n\t\t\t\treturn [this.exportShimVariable];\n\t\t\t}\n\t\t}\n\t\treturn [null];\n\t}\n\n\thasEffects(): boolean {\n\t\treturn (\n\t\t\tthis.info.moduleSideEffects === 'no-treeshake' ||\n\t\t\t(this.ast!.included && this.ast!.hasEffects(createHasEffectsContext()))\n\t\t);\n\t}\n\n\tinclude(): void {\n\t\tconst context = createInclusionContext();\n\t\tif (this.ast!.shouldBeIncluded(context)) this.ast!.include(context, false);\n\t}\n\n\tincludeAllExports(includeNamespaceMembers: boolean): void {\n\t\tif (!this.isExecuted) {\n\t\t\tmarkModuleAndImpureDependenciesAsExecuted(this);\n\t\t\tthis.graph.needsTreeshakingPass = true;\n\t\t}\n\n\t\tfor (const exportName of this.exports.keys()) {\n\t\t\tif (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {\n\t\t\t\tconst variable = this.getVariableForExportName(exportName)[0]!;\n\t\t\t\tvariable.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tif (!variable.included) {\n\t\t\t\t\tthis.includeVariable(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const name of this.getReexports()) {\n\t\t\tconst [variable] = this.getVariableForExportName(name);\n\t\t\tif (variable) {\n\t\t\t\tvariable.deoptimizePath(UNKNOWN_PATH);\n\t\t\t\tif (!variable.included) {\n\t\t\t\t\tthis.includeVariable(variable);\n\t\t\t\t}\n\t\t\t\tif (variable instanceof ExternalVariable) {\n\t\t\t\t\tvariable.module.reexported = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (includeNamespaceMembers) {\n\t\t\tthis.namespace.setMergedNamespaces(this.includeAndGetAdditionalMergedNamespaces());\n\t\t}\n\t}\n\n\tincludeAllInBundle(): void {\n\t\tthis.ast!.include(createInclusionContext(), true);\n\t\tthis.includeAllExports(false);\n\t}\n\n\tisIncluded(): boolean {\n\t\treturn this.ast!.included || this.namespace.included || this.importedFromNotTreeshaken;\n\t}\n\n\tlinkImports(): void {\n\t\tthis.addModulesToImportDescriptions(this.importDescriptions);\n\t\tthis.addModulesToImportDescriptions(this.reexportDescriptions);\n\t\tconst externalExportAllModules: ExternalModule[] = [];\n\t\tfor (const source of this.exportAllSources) {\n\t\t\tconst module = this.graph.modulesById.get(this.resolvedIds[source].id)!;\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\texternalExportAllModules.push(module);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.exportAllModules.push(module);\n\t\t}\n\t\tthis.exportAllModules.push(...externalExportAllModules);\n\t}\n\n\trender(options: RenderOptions): MagicString {\n\t\tconst magicString = this.magicString.clone();\n\t\tthis.ast!.render(magicString, options);\n\t\tthis.usesTopLevelAwait = this.astContext.usesTopLevelAwait;\n\t\treturn magicString;\n\t}\n\n\tsetSource({\n\t\tast,\n\t\tcode,\n\t\tcustomTransformCache,\n\t\toriginalCode,\n\t\toriginalSourcemap,\n\t\tresolvedIds,\n\t\tsourcemapChain,\n\t\ttransformDependencies,\n\t\ttransformFiles,\n\t\t...moduleOptions\n\t}: TransformModuleJSON & {\n\t\tresolvedIds?: ResolvedIdMap;\n\t\ttransformFiles?: EmittedFile[] | undefined;\n\t}): void {\n\t\tthis.info.code = code;\n\t\tthis.originalCode = originalCode;\n\t\tthis.originalSourcemap = originalSourcemap;\n\t\tthis.sourcemapChain = sourcemapChain;\n\t\tif (transformFiles) {\n\t\t\tthis.transformFiles = transformFiles;\n\t\t}\n\t\tthis.transformDependencies = transformDependencies;\n\t\tthis.customTransformCache = customTransformCache;\n\t\tthis.updateOptions(moduleOptions);\n\n\t\ttimeStart('generate ast', 3);\n\n\t\tif (!ast) {\n\t\t\tast = this.tryParse();\n\t\t}\n\n\t\ttimeEnd('generate ast', 3);\n\n\t\tthis.resolvedIds = resolvedIds || Object.create(null);\n\n\t\t// By default, `id` is the file name. Custom resolvers and loaders\n\t\t// can change that, but it makes sense to use it for the source file name\n\t\tconst fileName = this.id;\n\n\t\tthis.magicString = new MagicString(code, {\n\t\t\tfilename: (this.excludeFromSourcemap ? null : fileName)!, // don't include plugin helpers in sourcemap\n\t\t\tindentExclusionRanges: []\n\t\t});\n\n\t\ttimeStart('analyse ast', 3);\n\n\t\tthis.astContext = {\n\t\t\taddDynamicImport: this.addDynamicImport.bind(this),\n\t\t\taddExport: this.addExport.bind(this),\n\t\t\taddImport: this.addImport.bind(this),\n\t\t\taddImportMeta: this.addImportMeta.bind(this),\n\t\t\tcode, // Only needed for debugging\n\t\t\tdeoptimizationTracker: this.graph.deoptimizationTracker,\n\t\t\terror: this.error.bind(this),\n\t\t\tfileName, // Needed for warnings\n\t\t\tgetExports: this.getExports.bind(this),\n\t\t\tgetModuleExecIndex: () => this.execIndex,\n\t\t\tgetModuleName: this.basename.bind(this),\n\t\t\tgetNodeConstructor: (name: string) => nodeConstructors[name] || nodeConstructors.UnknownNode,\n\t\t\tgetReexports: this.getReexports.bind(this),\n\t\t\timportDescriptions: this.importDescriptions,\n\t\t\tincludeAllExports: () => this.includeAllExports(true),\n\t\t\tincludeDynamicImport: this.includeDynamicImport.bind(this),\n\t\t\tincludeVariableInModule: this.includeVariableInModule.bind(this),\n\t\t\tmagicString: this.magicString,\n\t\t\tmodule: this,\n\t\t\tmoduleContext: this.context,\n\t\t\toptions: this.options,\n\t\t\trequestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),\n\t\t\ttraceExport: (name: string) => this.getVariableForExportName(name)[0],\n\t\t\ttraceVariable: this.traceVariable.bind(this),\n\t\t\tusesTopLevelAwait: false,\n\t\t\twarn: this.warn.bind(this)\n\t\t};\n\n\t\tthis.scope = new ModuleScope(this.graph.scope, this.astContext);\n\t\tthis.namespace = new NamespaceVariable(this.astContext);\n\t\tthis.ast = new Program(ast, { context: this.astContext, type: 'Module' }, this.scope);\n\t\tthis.info.ast = ast;\n\n\t\ttimeEnd('analyse ast', 3);\n\t}\n\n\ttoJSON(): ModuleJSON {\n\t\treturn {\n\t\t\tast: this.ast!.esTreeNode,\n\t\t\tcode: this.info.code!,\n\t\t\tcustomTransformCache: this.customTransformCache,\n\t\t\tdependencies: Array.from(this.dependencies, getId),\n\t\t\tid: this.id,\n\t\t\tmeta: this.info.meta,\n\t\t\tmoduleSideEffects: this.info.moduleSideEffects,\n\t\t\toriginalCode: this.originalCode,\n\t\t\toriginalSourcemap: this.originalSourcemap,\n\t\t\tresolvedIds: this.resolvedIds,\n\t\t\tsourcemapChain: this.sourcemapChain,\n\t\t\tsyntheticNamedExports: this.info.syntheticNamedExports,\n\t\t\ttransformDependencies: this.transformDependencies,\n\t\t\ttransformFiles: this.transformFiles\n\t\t};\n\t}\n\n\ttraceVariable(\n\t\tname: string,\n\t\t{\n\t\t\timporterForSideEffects,\n\t\t\tisExportAllSearch,\n\t\t\tsearchedNamesAndModules\n\t\t}: {\n\t\t\timporterForSideEffects?: Module;\n\t\t\tisExportAllSearch?: boolean;\n\t\t\tsearchedNamesAndModules?: Map>;\n\t\t} = EMPTY_OBJECT\n\t): Variable | null {\n\t\tconst localVariable = this.scope.variables.get(name);\n\t\tif (localVariable) {\n\t\t\treturn localVariable;\n\t\t}\n\n\t\tconst importDeclaration = this.importDescriptions.get(name);\n\t\tif (importDeclaration) {\n\t\t\tconst otherModule = importDeclaration.module;\n\n\t\t\tif (otherModule instanceof Module && importDeclaration.name === '*') {\n\t\t\t\treturn otherModule.namespace;\n\t\t\t}\n\n\t\t\tconst [declaration] = getVariableForExportNameRecursive(\n\t\t\t\totherModule,\n\t\t\t\timportDeclaration.name,\n\t\t\t\timporterForSideEffects || this,\n\t\t\t\tisExportAllSearch,\n\t\t\t\tsearchedNamesAndModules\n\t\t\t);\n\n\t\t\tif (!declaration) {\n\t\t\t\treturn this.error(\n\t\t\t\t\terrMissingExport(importDeclaration.name, this.id, otherModule.id),\n\t\t\t\t\timportDeclaration.start\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declaration;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\ttryParse(): acorn.Node {\n\t\ttry {\n\t\t\treturn this.graph.contextParse(this.info.code!);\n\t\t} catch (err: any) {\n\t\t\tlet message = err.message.replace(/ \\(\\d+:\\d+\\)$/, '');\n\t\t\tif (this.id.endsWith('.json')) {\n\t\t\t\tmessage += ' (Note that you need @rollup/plugin-json to import JSON files)';\n\t\t\t} else if (!this.id.endsWith('.js')) {\n\t\t\t\tmessage += ' (Note that you need plugins to import files that are not JavaScript)';\n\t\t\t}\n\t\t\treturn this.error(\n\t\t\t\t{\n\t\t\t\t\tcode: 'PARSE_ERROR',\n\t\t\t\t\tmessage,\n\t\t\t\t\tparserError: err\n\t\t\t\t},\n\t\t\t\terr.pos\n\t\t\t);\n\t\t}\n\t}\n\n\tupdateOptions({\n\t\tmeta,\n\t\tmoduleSideEffects,\n\t\tsyntheticNamedExports\n\t}: Partial>): void {\n\t\tif (moduleSideEffects != null) {\n\t\t\tthis.info.moduleSideEffects = moduleSideEffects;\n\t\t}\n\t\tif (syntheticNamedExports != null) {\n\t\t\tthis.info.syntheticNamedExports = syntheticNamedExports;\n\t\t}\n\t\tif (meta != null) {\n\t\t\tObject.assign(this.info.meta, meta);\n\t\t}\n\t}\n\n\twarn(props: RollupWarning, pos: number): void {\n\t\tthis.addLocationToLogProps(props, pos);\n\t\tthis.options.onwarn(props);\n\t}\n\n\tprivate addDynamicImport(node: ImportExpression) {\n\t\tlet argument: ExpressionNode | string = node.source;\n\t\tif (argument instanceof TemplateLiteral) {\n\t\t\tif (argument.quasis.length === 1 && argument.quasis[0].value.cooked) {\n\t\t\t\targument = argument.quasis[0].value.cooked;\n\t\t\t}\n\t\t} else if (argument instanceof Literal && typeof argument.value === 'string') {\n\t\t\targument = argument.value;\n\t\t}\n\t\tthis.dynamicImports.push({ argument, id: null, node, resolution: null });\n\t}\n\n\tprivate addExport(\n\t\tnode: ExportAllDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration\n\t): void {\n\t\tif (node instanceof ExportDefaultDeclaration) {\n\t\t\t// export default foo;\n\n\t\t\tthis.exports.set('default', {\n\t\t\t\tidentifier: node.variable.getAssignedVariableName(),\n\t\t\t\tlocalName: 'default'\n\t\t\t});\n\t\t} else if (node instanceof ExportAllDeclaration) {\n\t\t\tconst source = node.source.value;\n\t\t\tthis.sources.add(source);\n\t\t\tif (node.exported) {\n\t\t\t\t// export * as name from './other'\n\n\t\t\t\tconst name = node.exported.name;\n\t\t\t\tthis.reexportDescriptions.set(name, {\n\t\t\t\t\tlocalName: '*',\n\t\t\t\t\tmodule: null as never, // filled in later,\n\t\t\t\t\tsource,\n\t\t\t\t\tstart: node.start\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// export * from './other'\n\n\t\t\t\tthis.exportAllSources.add(source);\n\t\t\t}\n\t\t} else if (node.source instanceof Literal) {\n\t\t\t// export { name } from './other'\n\n\t\t\tconst source = node.source.value;\n\t\t\tthis.sources.add(source);\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tconst name = specifier.exported.name;\n\t\t\t\tthis.reexportDescriptions.set(name, {\n\t\t\t\t\tlocalName: specifier.local.name,\n\t\t\t\t\tmodule: null as never, // filled in later,\n\t\t\t\t\tsource,\n\t\t\t\t\tstart: specifier.start\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (node.declaration) {\n\t\t\tconst declaration = node.declaration;\n\t\t\tif (declaration instanceof VariableDeclaration) {\n\t\t\t\t// export var { foo, bar } = ...\n\t\t\t\t// export var foo = 1, bar = 2;\n\n\t\t\t\tfor (const declarator of declaration.declarations) {\n\t\t\t\t\tfor (const localName of extractAssignedNames(declarator.id)) {\n\t\t\t\t\t\tthis.exports.set(localName, { identifier: null, localName });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// export function foo () {}\n\n\t\t\t\tconst localName = (declaration.id as Identifier).name;\n\t\t\t\tthis.exports.set(localName, { identifier: null, localName });\n\t\t\t}\n\t\t} else {\n\t\t\t// export { foo, bar, baz }\n\n\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\tconst localName = specifier.local.name;\n\t\t\t\tconst exportedName = specifier.exported.name;\n\t\t\t\tthis.exports.set(exportedName, { identifier: null, localName });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addImport(node: ImportDeclaration): void {\n\t\tconst source = node.source.value;\n\t\tthis.sources.add(source);\n\t\tfor (const specifier of node.specifiers) {\n\t\t\tconst isDefault = specifier.type === NodeType.ImportDefaultSpecifier;\n\t\t\tconst isNamespace = specifier.type === NodeType.ImportNamespaceSpecifier;\n\n\t\t\tconst name = isDefault ? 'default' : isNamespace ? '*' : specifier.imported.name;\n\t\t\tthis.importDescriptions.set(specifier.local.name, {\n\t\t\t\tmodule: null as never, // filled in later\n\t\t\t\tname,\n\t\t\t\tsource,\n\t\t\t\tstart: specifier.start\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate addImportMeta(node: MetaProperty): void {\n\t\tthis.importMetas.push(node);\n\t}\n\n\tprivate addLocationToLogProps(props: RollupLogProps, pos: number): void {\n\t\tprops.id = this.id;\n\t\tprops.pos = pos;\n\t\tlet code = this.info.code;\n\t\tconst location = locate(code!, pos, { offsetLine: 1 });\n\t\tif (location) {\n\t\t\tlet { column, line } = location;\n\t\t\ttry {\n\t\t\t\t({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));\n\t\t\t\tcode = this.originalCode;\n\t\t\t} catch (err: any) {\n\t\t\t\tthis.options.onwarn({\n\t\t\t\t\tcode: 'SOURCEMAP_ERROR',\n\t\t\t\t\tid: this.id,\n\t\t\t\t\tloc: {\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tfile: this.id,\n\t\t\t\t\t\tline\n\t\t\t\t\t},\n\t\t\t\t\tmessage: `Error when using sourcemap for reporting an error: ${err.message}`,\n\t\t\t\t\tpos\n\t\t\t\t});\n\t\t\t}\n\t\t\taugmentCodeLocation(props, { column, line }, code!, this.id);\n\t\t}\n\t}\n\n\tprivate addModulesToImportDescriptions(\n\t\timportDescription: ReadonlyMap\n\t): void {\n\t\tfor (const specifier of importDescription.values()) {\n\t\t\tconst { id } = this.resolvedIds[specifier.source];\n\t\t\tspecifier.module = this.graph.modulesById.get(id)!;\n\t\t}\n\t}\n\n\tprivate addRelevantSideEffectDependencies(\n\t\trelevantDependencies: Set,\n\t\tnecessaryDependencies: ReadonlySet,\n\t\talwaysCheckedDependencies: ReadonlySet\n\t): void {\n\t\tconst handledDependencies = new Set();\n\n\t\tconst addSideEffectDependencies = (\n\t\t\tpossibleDependencies: ReadonlySet\n\t\t) => {\n\t\t\tfor (const dependency of possibleDependencies) {\n\t\t\t\tif (handledDependencies.has(dependency)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thandledDependencies.add(dependency);\n\t\t\t\tif (necessaryDependencies.has(dependency)) {\n\t\t\t\t\trelevantDependencies.add(dependency);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!(dependency.info.moduleSideEffects || alwaysCheckedDependencies.has(dependency))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (dependency instanceof ExternalModule || dependency.hasEffects()) {\n\t\t\t\t\trelevantDependencies.add(dependency);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\taddSideEffectDependencies(dependency.dependencies);\n\t\t\t}\n\t\t};\n\n\t\taddSideEffectDependencies(this.dependencies);\n\t\taddSideEffectDependencies(alwaysCheckedDependencies);\n\t}\n\n\tprivate getVariableFromNamespaceReexports(\n\t\tname: string,\n\t\timporterForSideEffects?: Module,\n\t\tsearchedNamesAndModules?: Map>\n\t): [variable: Variable | null, indirectExternal?: boolean] {\n\t\tlet foundSyntheticDeclaration: SyntheticNamedExportVariable | null = null;\n\t\tconst foundInternalDeclarations = new Map();\n\t\tconst foundExternalDeclarations = new Set();\n\t\tfor (const module of this.exportAllModules) {\n\t\t\t// Synthetic namespaces should not hide \"regular\" exports of the same name\n\t\t\tif (module.info.syntheticNamedExports === name) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst [variable, indirectExternal] = getVariableForExportNameRecursive(\n\t\t\t\tmodule,\n\t\t\t\tname,\n\t\t\t\timporterForSideEffects,\n\t\t\t\ttrue,\n\t\t\t\t// We are creating a copy to handle the case where the same binding is\n\t\t\t\t// imported through different namespace reexports gracefully\n\t\t\t\tcopyNameToModulesMap(searchedNamesAndModules)\n\t\t\t);\n\n\t\t\tif (module instanceof ExternalModule || indirectExternal) {\n\t\t\t\tfoundExternalDeclarations.add(variable as ExternalVariable);\n\t\t\t} else if (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tif (!foundSyntheticDeclaration) {\n\t\t\t\t\tfoundSyntheticDeclaration = variable;\n\t\t\t\t}\n\t\t\t} else if (variable) {\n\t\t\t\tfoundInternalDeclarations.set(variable, module);\n\t\t\t}\n\t\t}\n\t\tif (foundInternalDeclarations.size > 0) {\n\t\t\tconst foundDeclarationList = [...foundInternalDeclarations];\n\t\t\tconst usedDeclaration = foundDeclarationList[0][0];\n\t\t\tif (foundDeclarationList.length === 1) {\n\t\t\t\treturn [usedDeclaration];\n\t\t\t}\n\t\t\tthis.options.onwarn(\n\t\t\t\terrNamespaceConflict(\n\t\t\t\t\tname,\n\t\t\t\t\tthis.id,\n\t\t\t\t\tfoundDeclarationList.map(([, module]) => module.id)\n\t\t\t\t)\n\t\t\t);\n\t\t\t// TODO we are pretending it was not found while it should behave like \"undefined\"\n\t\t\treturn [null];\n\t\t}\n\t\tif (foundExternalDeclarations.size > 0) {\n\t\t\tconst foundDeclarationList = [...foundExternalDeclarations];\n\t\t\tconst usedDeclaration = foundDeclarationList[0];\n\t\t\tif (foundDeclarationList.length > 1) {\n\t\t\t\tthis.options.onwarn(\n\t\t\t\t\terrAmbiguousExternalNamespaces(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tthis.id,\n\t\t\t\t\t\tusedDeclaration.module.id,\n\t\t\t\t\t\tfoundDeclarationList.map(declaration => declaration.module.id)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn [usedDeclaration, true];\n\t\t}\n\t\tif (foundSyntheticDeclaration) {\n\t\t\treturn [foundSyntheticDeclaration];\n\t\t}\n\t\treturn [null];\n\t}\n\n\tprivate includeAndGetAdditionalMergedNamespaces(): Variable[] {\n\t\tconst externalNamespaces = new Set();\n\t\tconst syntheticNamespaces = new Set();\n\t\tfor (const module of [this, ...this.exportAllModules]) {\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tconst [externalVariable] = module.getVariableForExportName('*');\n\t\t\t\texternalVariable.include();\n\t\t\t\tthis.includedImports.add(externalVariable);\n\t\t\t\texternalNamespaces.add(externalVariable);\n\t\t\t} else if (module.info.syntheticNamedExports) {\n\t\t\t\tconst syntheticNamespace = module.getSyntheticNamespace();\n\t\t\t\tsyntheticNamespace.include();\n\t\t\t\tthis.includedImports.add(syntheticNamespace);\n\t\t\t\tsyntheticNamespaces.add(syntheticNamespace);\n\t\t\t}\n\t\t}\n\t\treturn [...syntheticNamespaces, ...externalNamespaces];\n\t}\n\n\tprivate includeDynamicImport(node: ImportExpression): void {\n\t\tconst resolution = (\n\t\t\tthis.dynamicImports.find(dynamicImport => dynamicImport.node === node) as {\n\t\t\t\tresolution: string | Module | ExternalModule | undefined;\n\t\t\t}\n\t\t).resolution;\n\t\tif (resolution instanceof Module) {\n\t\t\tresolution.includedDynamicImporters.push(this);\n\t\t\tresolution.includeAllExports(true);\n\t\t}\n\t}\n\n\tprivate includeVariable(variable: Variable): void {\n\t\tif (!variable.included) {\n\t\t\tvariable.include();\n\t\t\tthis.graph.needsTreeshakingPass = true;\n\t\t\tconst variableModule = variable.module;\n\t\t\tif (variableModule instanceof Module) {\n\t\t\t\tif (!variableModule.isExecuted) {\n\t\t\t\t\tmarkModuleAndImpureDependenciesAsExecuted(variableModule);\n\t\t\t\t}\n\t\t\t\tif (variableModule !== this) {\n\t\t\t\t\tconst sideEffectModules = getAndExtendSideEffectModules(variable, this);\n\t\t\t\t\tfor (const module of sideEffectModules) {\n\t\t\t\t\t\tif (!module.isExecuted) {\n\t\t\t\t\t\t\tmarkModuleAndImpureDependenciesAsExecuted(module);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate includeVariableInModule(variable: Variable): void {\n\t\tthis.includeVariable(variable);\n\t\tconst variableModule = variable.module;\n\t\tif (variableModule && variableModule !== this) {\n\t\t\tthis.includedImports.add(variable);\n\t\t}\n\t}\n\n\tprivate shimMissingExport(name: string): void {\n\t\tthis.options.onwarn({\n\t\t\tcode: 'SHIMMED_EXPORT',\n\t\t\texporter: relativeId(this.id),\n\t\t\texportName: name,\n\t\t\tmessage: `Missing export \"${name}\" has been shimmed in module ${relativeId(this.id)}.`\n\t\t});\n\t\tthis.exports.set(name, MISSING_EXPORT_SHIM_DESCRIPTION);\n\t}\n}\n\n// if there is a cyclic import in the reexport chain, we should not\n// import from the original module but from the cyclic module to not\n// mess up execution order.\nfunction setAlternativeExporterIfCyclic(\n\tvariable: Variable,\n\timporter: Module,\n\treexporter: Module\n): void {\n\tif (variable.module instanceof Module && variable.module !== reexporter) {\n\t\tconst exporterCycles = variable.module.cycles;\n\t\tif (exporterCycles.size > 0) {\n\t\t\tconst importerCycles = reexporter.cycles;\n\t\t\tfor (const cycleSymbol of importerCycles) {\n\t\t\t\tif (exporterCycles.has(cycleSymbol)) {\n\t\t\t\t\timporter.alternativeReexportModules.set(variable, reexporter);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst copyNameToModulesMap = (\n\tsearchedNamesAndModules?: Map>\n): Map> | undefined =>\n\tsearchedNamesAndModules &&\n\tnew Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)]));\n","import type { DecodedSourceMapOrMissing, ExistingDecodedSourceMap } from '../rollup/types';\n\nexport function getOriginalLocation(\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\tlocation: { column: number; line: number }\n): { column: number; line: number } {\n\tconst filteredSourcemapChain = sourcemapChain.filter(\n\t\t(sourcemap): sourcemap is ExistingDecodedSourceMap => !!sourcemap.mappings\n\t);\n\ttraceSourcemap: while (filteredSourcemapChain.length > 0) {\n\t\tconst sourcemap = filteredSourcemapChain.pop()!;\n\t\tconst line = sourcemap.mappings[location.line - 1];\n\t\tif (line) {\n\t\t\tconst filteredLine = line.filter(\n\t\t\t\t(segment): segment is [number, number, number, number] => segment.length > 1\n\t\t\t);\n\t\t\tconst lastSegment = filteredLine[filteredLine.length - 1];\n\t\t\tfor (const segment of filteredLine) {\n\t\t\t\tif (segment[0] >= location.column || segment === lastSegment) {\n\t\t\t\t\tlocation = {\n\t\t\t\t\t\tcolumn: segment[3],\n\t\t\t\t\t\tline: segment[2] + 1\n\t\t\t\t\t};\n\t\t\t\t\tcontinue traceSourcemap;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Can't resolve original location of error.\");\n\t}\n\treturn location;\n}\n","export default function removeJsExtension(name: string): string {\n\treturn name.endsWith('.js') ? name.slice(0, -3) : name;\n}\n","import type { NormalizedOutputOptions } from '../../rollup/types';\nimport removeJsExtension from './removeJsExtension';\n\nexport default function getCompleteAmdId(\n\toptions: NormalizedOutputOptions['amd'],\n\tchunkId: string\n): string {\n\tif (options.autoId) {\n\t\treturn `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`;\n\t}\n\n\treturn options.id || '';\n}\n","import type { ChunkDependencies, ChunkExports } from '../../Chunk';\nimport type { GetInterop } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tgetToStringTagValue,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\n\nexport function getExportBlock(\n\texports: ChunkExports,\n\tdependencies: ChunkDependencies,\n\tnamedExportsMode: boolean,\n\tinterop: GetInterop,\n\tsnippets: GenerateCodeSnippets,\n\tt: string,\n\texternalLiveBindings: boolean,\n\tmechanism = 'return '\n): string {\n\tconst { _, cnst, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;\n\tif (!namedExportsMode) {\n\t\treturn `${n}${n}${mechanism}${getSingleDefaultExport(\n\t\t\texports,\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tgetPropertyAccess\n\t\t)};`;\n\t}\n\n\tlet exportBlock = '';\n\n\tfor (const {\n\t\tdefaultVariableName,\n\t\tid,\n\t\tisChunk,\n\t\tname,\n\t\tnamedExportsMode: depNamedExportsMode,\n\t\tnamespaceVariableName,\n\t\treexports\n\t} of dependencies) {\n\t\tif (reexports && namedExportsMode) {\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported !== '*') {\n\t\t\t\t\tconst importName = getReexportedImportName(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tspecifier.imported,\n\t\t\t\t\t\tdepNamedExportsMode,\n\t\t\t\t\t\tisChunk,\n\t\t\t\t\t\tdefaultVariableName!,\n\t\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\t\tinterop,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\texternalLiveBindings,\n\t\t\t\t\t\tgetPropertyAccess\n\t\t\t\t\t);\n\t\t\t\t\tif (exportBlock) exportBlock += n;\n\t\t\t\t\tif (specifier.imported !== '*' && specifier.needsLiveBinding) {\n\t\t\t\t\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\t\t\t\t\tfunctionReturn: true,\n\t\t\t\t\t\t\tlineBreakIndent: null,\n\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\texportBlock +=\n\t\t\t\t\t\t\t`Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` +\n\t\t\t\t\t\t\t`${t}enumerable:${_}true,${n}` +\n\t\t\t\t\t\t\t`${t}get:${_}${left}${importName}${right}${n}});`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\texportBlock += `exports${getPropertyAccess(\n\t\t\t\t\t\t\tspecifier.reexported\n\t\t\t\t\t\t)}${_}=${_}${importName};`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const { exported, local } of exports) {\n\t\tconst lhs = `exports${getPropertyAccess(exported)}`;\n\t\tconst rhs = local;\n\t\tif (lhs !== rhs) {\n\t\t\tif (exportBlock) exportBlock += n;\n\t\t\texportBlock += `${lhs}${_}=${_}${rhs};`;\n\t\t}\n\t}\n\n\tfor (const { name, reexports } of dependencies) {\n\t\tif (reexports && namedExportsMode) {\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported === '*') {\n\t\t\t\t\tif (exportBlock) exportBlock += n;\n\t\t\t\t\tconst copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}${getDefineProperty(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tspecifier.needsLiveBinding,\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tsnippets\n\t\t\t\t\t)}${s}${n}}`;\n\t\t\t\t\texportBlock +=\n\t\t\t\t\t\tcnst === 'var' && specifier.needsLiveBinding\n\t\t\t\t\t\t\t? `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {\n\t\t\t\t\t\t\t\t\tisAsync: false,\n\t\t\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t\t })}${copyPropertyIfNecessary});`\n\t\t\t\t\t\t\t: `for${_}(${cnst} k in ${name})${_}${copyPropertyIfNecessary}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (exportBlock) {\n\t\treturn `${n}${n}${exportBlock}`;\n\t}\n\n\treturn '';\n}\n\nfunction getSingleDefaultExport(\n\texports: ChunkExports,\n\tdependencies: ChunkDependencies,\n\tinterop: GetInterop,\n\texternalLiveBindings: boolean,\n\tgetPropertyAccess: (name: string) => string\n) {\n\tif (exports.length > 0) {\n\t\treturn exports[0].local;\n\t} else {\n\t\tfor (const {\n\t\t\tdefaultVariableName,\n\t\t\tid,\n\t\t\tisChunk,\n\t\t\tname,\n\t\t\tnamedExportsMode: depNamedExportsMode,\n\t\t\tnamespaceVariableName,\n\t\t\treexports\n\t\t} of dependencies) {\n\t\t\tif (reexports) {\n\t\t\t\treturn getReexportedImportName(\n\t\t\t\t\tname,\n\t\t\t\t\treexports[0].imported,\n\t\t\t\t\tdepNamedExportsMode,\n\t\t\t\t\tisChunk,\n\t\t\t\t\tdefaultVariableName!,\n\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\tinterop,\n\t\t\t\t\tid,\n\t\t\t\t\texternalLiveBindings,\n\t\t\t\t\tgetPropertyAccess\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getReexportedImportName(\n\tmoduleVariableName: string,\n\timported: string,\n\tdepNamedExportsMode: boolean,\n\tisChunk: boolean,\n\tdefaultVariableName: string,\n\tnamespaceVariableName: string,\n\tinterop: GetInterop,\n\tmoduleId: string,\n\texternalLiveBindings: boolean,\n\tgetPropertyAccess: (name: string) => string\n) {\n\tif (imported === 'default') {\n\t\tif (!isChunk) {\n\t\t\tconst moduleInterop = String(interop(moduleId));\n\t\t\tconst variableName = defaultInteropHelpersByInteropType[moduleInterop]\n\t\t\t\t? defaultVariableName\n\t\t\t\t: moduleVariableName;\n\t\t\treturn isDefaultAProperty(moduleInterop, externalLiveBindings)\n\t\t\t\t? `${variableName}${getPropertyAccess('default')}`\n\t\t\t\t: variableName;\n\t\t}\n\t\treturn depNamedExportsMode\n\t\t\t? `${moduleVariableName}${getPropertyAccess('default')}`\n\t\t\t: moduleVariableName;\n\t}\n\tif (imported === '*') {\n\t\treturn (\n\t\t\tisChunk\n\t\t\t\t? !depNamedExportsMode\n\t\t\t\t: namespaceInteropHelpersByInteropType[String(interop(moduleId))]\n\t\t)\n\t\t\t? namespaceVariableName\n\t\t\t: moduleVariableName;\n\t}\n\treturn `${moduleVariableName}${getPropertyAccess(imported)}`;\n}\n\nfunction getEsModuleValue(getObject: GenerateCodeSnippets['getObject']) {\n\treturn getObject([['value', 'true']], {\n\t\tlineBreakIndent: null\n\t});\n}\n\nexport function getNamespaceMarkers(\n\thasNamedExports: boolean,\n\taddEsModule: boolean,\n\taddNamespaceToStringTag: boolean,\n\t{ _, getObject }: GenerateCodeSnippets\n): string {\n\tif (hasNamedExports) {\n\t\tif (addEsModule) {\n\t\t\tif (addNamespaceToStringTag) {\n\t\t\t\treturn `Object.defineProperties(exports,${_}${getObject(\n\t\t\t\t\t[\n\t\t\t\t\t\t['__esModule', getEsModuleValue(getObject)],\n\t\t\t\t\t\t[null, `[Symbol.toStringTag]:${_}${getToStringTagValue(getObject)}`]\n\t\t\t\t\t],\n\t\t\t\t\t{\n\t\t\t\t\t\tlineBreakIndent: null\n\t\t\t\t\t}\n\t\t\t\t)});`;\n\t\t\t}\n\t\t\treturn `Object.defineProperty(exports,${_}'__esModule',${_}${getEsModuleValue(getObject)});`;\n\t\t}\n\t\tif (addNamespaceToStringTag) {\n\t\t\treturn `Object.defineProperty(exports,${_}Symbol.toStringTag,${_}${getToStringTagValue(\n\t\t\t\tgetObject\n\t\t\t)});`;\n\t\t}\n\t}\n\treturn '';\n}\n\nconst getDefineProperty = (\n\tname: string,\n\tneedsLiveBinding: boolean,\n\tt: string,\n\t{ _, getDirectReturnFunction, n }: GenerateCodeSnippets\n) => {\n\tif (needsLiveBinding) {\n\t\tconst [left, right] = getDirectReturnFunction([], {\n\t\t\tfunctionReturn: true,\n\t\t\tlineBreakIndent: null,\n\t\t\tname: null\n\t\t});\n\t\treturn (\n\t\t\t`Object.defineProperty(exports,${_}k,${_}{${n}` +\n\t\t\t`${t}${t}enumerable:${_}true,${n}` +\n\t\t\t`${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`\n\t\t);\n\t}\n\treturn `exports[k]${_}=${_}${name}[k]`;\n};\n","import type { ModuleDeclarationDependency, ReexportSpecifier } from '../../Chunk';\nimport type { GetInterop } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tgetHelpersBlock,\n\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\tnamespaceInteropHelpersByInteropType\n} from '../../utils/interopHelpers';\n\nexport default function getInteropBlock(\n\tdependencies: readonly ModuleDeclarationDependency[],\n\tinterop: GetInterop,\n\texternalLiveBindings: boolean,\n\tfreeze: boolean,\n\tnamespaceToStringTag: boolean,\n\taccessedGlobals: Set,\n\tindent: string,\n\tsnippets: GenerateCodeSnippets\n): string {\n\tconst { _, cnst, n } = snippets;\n\tconst neededInteropHelpers = new Set();\n\tconst interopStatements: string[] = [];\n\tconst addInteropStatement = (\n\t\thelperVariableName: string,\n\t\thelper: string,\n\t\tdependencyVariableName: string\n\t): void => {\n\t\tneededInteropHelpers.add(helper);\n\t\tinteropStatements.push(\n\t\t\t`${cnst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`\n\t\t);\n\t};\n\tfor (const {\n\t\tdefaultVariableName,\n\t\timports,\n\t\tid,\n\t\tisChunk,\n\t\tname,\n\t\tnamedExportsMode,\n\t\tnamespaceVariableName,\n\t\treexports\n\t} of dependencies) {\n\t\tif (isChunk) {\n\t\t\tfor (const { imported, reexported } of [\n\t\t\t\t...(imports || []),\n\t\t\t\t...(reexports || [])\n\t\t\t] as ReexportSpecifier[]) {\n\t\t\t\tif (imported === '*' && reexported !== '*') {\n\t\t\t\t\tif (!namedExportsMode) {\n\t\t\t\t\t\taddInteropStatement(\n\t\t\t\t\t\t\tnamespaceVariableName!,\n\t\t\t\t\t\t\tINTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst moduleInterop = String(interop(id));\n\t\t\tlet hasDefault = false;\n\t\t\tlet hasNamespace = false;\n\t\t\tfor (const { imported, reexported } of [\n\t\t\t\t...(imports || []),\n\t\t\t\t...(reexports || [])\n\t\t\t] as ReexportSpecifier[]) {\n\t\t\t\tlet helper: string | undefined | null;\n\t\t\t\tlet variableName: string | undefined;\n\t\t\t\tif (imported === 'default') {\n\t\t\t\t\tif (!hasDefault) {\n\t\t\t\t\t\thasDefault = true;\n\t\t\t\t\t\tif (defaultVariableName !== namespaceVariableName) {\n\t\t\t\t\t\t\tvariableName = defaultVariableName!;\n\t\t\t\t\t\t\thelper = defaultInteropHelpersByInteropType[moduleInterop];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (imported === '*' && reexported !== '*') {\n\t\t\t\t\tif (!hasNamespace) {\n\t\t\t\t\t\thasNamespace = true;\n\t\t\t\t\t\thelper = namespaceInteropHelpersByInteropType[moduleInterop];\n\t\t\t\t\t\tvariableName = namespaceVariableName!;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (helper) {\n\t\t\t\t\taddInteropStatement(variableName!, helper, name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn `${getHelpersBlock(\n\t\tneededInteropHelpers,\n\t\taccessedGlobals,\n\t\tindent,\n\t\tsnippets,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag\n\t)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;\n}\n","import addJsExtension from './addJsExtension';\nimport removeJsExtension from './removeJsExtension';\n\n// AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.\n// The assumption is that this makes sense for all relative ids:\n// https://requirejs.org/docs/api.html#jsfiles\nexport default function updateExtensionForRelativeAmdId(\n\tid: string,\n\tforceJsExtensionForImports: boolean\n): string {\n\tif (id[0] !== '.') {\n\t\treturn id;\n\t}\n\n\treturn forceJsExtensionForImports ? addJsExtension(id) : removeJsExtension(id);\n}\n","export default function addJsExtension(name: string): string {\n\treturn name.endsWith('.js') ? name : name + '.js';\n}\n","import type { ChunkDependencies } from '../../Chunk';\nimport type { RollupWarning } from '../../rollup/types';\nimport { printQuotedStringList } from '../../utils/printStringList';\n\nconst builtins = {\n\tassert: true,\n\tbuffer: true,\n\tconsole: true,\n\tconstants: true,\n\tdomain: true,\n\tevents: true,\n\thttp: true,\n\thttps: true,\n\tos: true,\n\tpath: true,\n\tprocess: true,\n\tpunycode: true,\n\tquerystring: true,\n\tstream: true,\n\tstring_decoder: true,\n\ttimers: true,\n\ttty: true,\n\turl: true,\n\tutil: true,\n\tvm: true,\n\tzlib: true\n};\n\nexport default function warnOnBuiltins(\n\twarn: (warning: RollupWarning) => void,\n\tdependencies: ChunkDependencies\n): void {\n\tconst externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins);\n\n\tif (!externalBuiltins.length) return;\n\n\twarn({\n\t\tcode: 'MISSING_NODE_BUILTINS',\n\t\tmessage: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(\n\t\t\texternalBuiltins\n\t\t)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`,\n\t\tmodules: externalBuiltins\n\t});\n}\n","export const keypath = (keypath: string, getPropertyAccess: (name: string) => string): string =>\n\tkeypath.split('.').map(getPropertyAccess).join('');\n","import type { GlobalsOption } from '../../rollup/types';\nimport type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets';\n\nexport default function setupNamespace(\n\tname: string,\n\troot: string,\n\tglobals: GlobalsOption,\n\t{ _, getPropertyAccess, s }: GenerateCodeSnippets,\n\tcompact: boolean | undefined\n): string {\n\tconst parts = name.split('.');\n\tparts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];\n\tparts.pop();\n\n\tlet propertyPath = root;\n\treturn (\n\t\tparts\n\t\t\t.map(part => {\n\t\t\t\tpropertyPath += getPropertyAccess(part);\n\t\t\t\treturn `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}${s}`;\n\t\t\t})\n\t\t\t.join(compact ? ',' : '\\n') + (compact && parts.length ? ';' : '\\n')\n\t);\n}\n\nexport function assignToDeepVariable(\n\tdeepName: string,\n\troot: string,\n\tglobals: GlobalsOption,\n\tassignment: string,\n\t{ _, getPropertyAccess }: GenerateCodeSnippets\n): string {\n\tconst parts = deepName.split('.');\n\tparts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];\n\tconst last = parts.pop()!;\n\n\tlet propertyPath = root;\n\tlet deepAssignment =\n\t\tparts\n\t\t\t.map(part => {\n\t\t\t\tpropertyPath += getPropertyAccess(part);\n\t\t\t\treturn `${propertyPath}${_}=${_}${propertyPath}${_}||${_}{}`;\n\t\t\t})\n\t\t\t.concat(`${propertyPath}${getPropertyAccess(last)}`)\n\t\t\t.join(`,${_}`) + `${_}=${_}${assignment}`;\n\tif (parts.length > 0) {\n\t\tdeepAssignment = `(${deepAssignment})`;\n\t}\n\treturn deepAssignment;\n}\n","import type { ModuleDeclarationDependency } from '../../Chunk';\n\nexport default function trimEmptyImports(\n\tdependencies: readonly ModuleDeclarationDependency[]\n): ModuleDeclarationDependency[] {\n\tlet i = dependencies.length;\n\n\twhile (i--) {\n\t\tconst { imports, reexports } = dependencies[i];\n\t\tif (imports || reexports) {\n\t\t\treturn dependencies.slice(0, i + 1);\n\t\t}\n\t}\n\n\treturn [];\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports, ModuleDeclarations } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getHelpersBlock } from '../utils/interopHelpers';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from '../utils/variableNames';\nimport type { FinaliserOptions } from './index';\n\nexport default function system(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tsnippets,\n\t\toutro,\n\t\tusesTopLevelAwait\n\t}: FinaliserOptions,\n\t{\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tstrict,\n\t\tsystemNullSetters\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets;\n\tconst { importBindings, setters, starExcludes } = analyzeDependencies(\n\t\tdependencies,\n\t\texports,\n\t\tt,\n\t\tsnippets\n\t);\n\tconst registeredName = name ? `'${name}',${_}` : '';\n\tconst wrapperParams = accessedGlobals.has('module')\n\t\t? ['exports', 'module']\n\t\t: hasExports\n\t\t? ['exports']\n\t\t: [];\n\n\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t// cf. https://v8.dev/blog/preparser#pife\n\tlet wrapperStart =\n\t\t`System.register(${registeredName}[` +\n\t\tdependencies.map(({ id }) => `'${id}'`).join(`,${_}`) +\n\t\t`],${_}(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}${t}${\n\t\t\tstrict ? \"'use strict';\" : ''\n\t\t}` +\n\t\tgetStarExcludesBlock(starExcludes, t, snippets) +\n\t\tgetImportBindingsBlock(importBindings, t, snippets) +\n\t\t`${n}${t}return${_}{${\n\t\t\tsetters.length\n\t\t\t\t? `${n}${t}${t}setters:${_}[${setters\n\t\t\t\t\t\t.map(setter =>\n\t\t\t\t\t\t\tsetter\n\t\t\t\t\t\t\t\t? `${getFunctionIntro(['module'], {\n\t\t\t\t\t\t\t\t\t\tisAsync: false,\n\t\t\t\t\t\t\t\t\t\tname: null\n\t\t\t\t\t\t\t\t })}{${n}${t}${t}${t}${setter}${n}${t}${t}}`\n\t\t\t\t\t\t\t\t: systemNullSetters\n\t\t\t\t\t\t\t\t? `null`\n\t\t\t\t\t\t\t\t: `${getFunctionIntro([], { isAsync: false, name: null })}{}`\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(`,${_}`)}],`\n\t\t\t\t: ''\n\t\t}${n}`;\n\twrapperStart += `${t}${t}execute:${_}(${getNonArrowFunctionIntro([], {\n\t\tisAsync: usesTopLevelAwait,\n\t\tname: null\n\t})}{${n}${n}`;\n\n\tconst wrapperEnd = `${t}${t}})${n}${t}}${s}${n}}));`;\n\n\tmagicString.prepend(\n\t\tintro +\n\t\t\tgetHelpersBlock(\n\t\t\t\tnull,\n\t\t\t\taccessedGlobals,\n\t\t\t\tt,\n\t\t\t\tsnippets,\n\t\t\t\texternalLiveBindings,\n\t\t\t\tfreeze,\n\t\t\t\tnamespaceToStringTag\n\t\t\t) +\n\t\t\tgetHoistedExportsBlock(exports, t, snippets)\n\t);\n\tmagicString.append(\n\t\t`${outro}${n}${n}` +\n\t\t\tgetSyntheticExportsBlock(exports, t, snippets) +\n\t\t\tgetMissingExportsBlock(exports, t, snippets)\n\t);\n\treturn magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart);\n}\n\nfunction analyzeDependencies(\n\tdependencies: ChunkDependencies,\n\texports: ChunkExports,\n\tt: string,\n\t{ _, cnst, getObject, getPropertyAccess, n }: GenerateCodeSnippets\n): { importBindings: string[]; setters: string[]; starExcludes: Set | null } {\n\tconst importBindings: string[] = [];\n\tconst setters: string[] = [];\n\tlet starExcludes: Set | null = null;\n\n\tfor (const { imports, reexports } of dependencies) {\n\t\tconst setter: string[] = [];\n\t\tif (imports) {\n\t\t\tfor (const specifier of imports) {\n\t\t\t\timportBindings.push(specifier.local);\n\t\t\t\tif (specifier.imported === '*') {\n\t\t\t\t\tsetter.push(`${specifier.local}${_}=${_}module;`);\n\t\t\t\t} else {\n\t\t\t\t\tsetter.push(`${specifier.local}${_}=${_}module${getPropertyAccess(specifier.imported)};`);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (reexports) {\n\t\t\tconst reexportedNames: [key: string | null, value: string][] = [];\n\t\t\tlet hasStarReexport = false;\n\t\t\tfor (const { imported, reexported } of reexports) {\n\t\t\t\tif (reexported === '*') {\n\t\t\t\t\thasStarReexport = true;\n\t\t\t\t} else {\n\t\t\t\t\treexportedNames.push([\n\t\t\t\t\t\treexported,\n\t\t\t\t\t\timported === '*' ? 'module' : `module${getPropertyAccess(imported)}`\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (reexportedNames.length > 1 || hasStarReexport) {\n\t\t\t\tconst exportMapping = getObject(reexportedNames, { lineBreakIndent: null });\n\t\t\t\tif (hasStarReexport) {\n\t\t\t\t\tif (!starExcludes) {\n\t\t\t\t\t\tstarExcludes = getStarExcludes({ dependencies, exports });\n\t\t\t\t\t}\n\t\t\t\t\tsetter.push(\n\t\t\t\t\t\t`${cnst} setter${_}=${_}${exportMapping};`,\n\t\t\t\t\t\t`for${_}(${cnst} name in module)${_}{`,\n\t\t\t\t\t\t`${t}if${_}(!_starExcludes[name])${_}setter[name]${_}=${_}module[name];`,\n\t\t\t\t\t\t'}',\n\t\t\t\t\t\t'exports(setter);'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tsetter.push(`exports(${exportMapping});`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst [key, value] = reexportedNames[0];\n\t\t\t\tsetter.push(`exports('${key}',${_}${value});`);\n\t\t\t}\n\t\t}\n\t\tsetters.push(setter.join(`${n}${t}${t}${t}`));\n\t}\n\treturn { importBindings, setters, starExcludes };\n}\n\nconst getStarExcludes = ({ dependencies, exports }: ModuleDeclarations): Set => {\n\tconst starExcludes = new Set(exports.map(expt => expt.exported));\n\tstarExcludes.add('default');\n\tfor (const { reexports } of dependencies) {\n\t\tif (reexports) {\n\t\t\tfor (const reexport of reexports) {\n\t\t\t\tif (reexport.reexported !== '*') starExcludes.add(reexport.reexported);\n\t\t\t}\n\t\t}\n\t}\n\treturn starExcludes;\n};\n\nconst getStarExcludesBlock = (\n\tstarExcludes: ReadonlySet | null,\n\tt: string,\n\t{ _, cnst, getObject, n }: GenerateCodeSnippets\n): string =>\n\tstarExcludes\n\t\t? `${n}${t}${cnst} _starExcludes${_}=${_}${getObject(\n\t\t\t\t[...starExcludes].map(prop => [prop, '1']),\n\t\t\t\t{ lineBreakIndent: { base: t, t } }\n\t\t )};`\n\t\t: '';\n\nconst getImportBindingsBlock = (\n\timportBindings: readonly string[],\n\tt: string,\n\t{ _, n }: GenerateCodeSnippets\n): string => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');\n\nconst getHoistedExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })),\n\t\tt,\n\t\tsnippets\n\t);\n\nfunction getExportsBlock(\n\texports: readonly { name: string; value: string }[],\n\tt: string,\n\t{ _, n }: GenerateCodeSnippets\n): string {\n\tif (exports.length === 0) {\n\t\treturn '';\n\t}\n\tif (exports.length === 1) {\n\t\treturn `exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;\n\t}\n\treturn (\n\t\t`exports({${n}` +\n\t\texports.map(({ name, value }) => `${t}${name}:${_}${value}`).join(`,${n}`) +\n\t\t`${n}});${n}${n}`\n\t);\n}\n\nconst getSyntheticExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports\n\t\t\t.filter(expt => expt.expression)\n\t\t\t.map(expt => ({ name: expt.exported, value: expt.local })),\n\t\tt,\n\t\tsnippets\n\t);\n\nconst getMissingExportsBlock = (\n\texports: ChunkExports,\n\tt: string,\n\tsnippets: GenerateCodeSnippets\n): string =>\n\tgetExportsBlock(\n\t\texports\n\t\t\t.filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)\n\t\t\t.map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })),\n\t\tt,\n\t\tsnippets\n\t);\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport { error } from '../utils/error';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport getCompleteAmdId from './shared/getCompleteAmdId';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport { keypath } from './shared/sanitize';\nimport { assignToDeepVariable } from './shared/setupNamespace';\nimport trimEmptyImports from './shared/trimEmptyImports';\nimport updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nfunction globalProp(name: string, globalVar: string, getPropertyAccess: (name: string) => string) {\n\tif (!name) return 'null';\n\treturn `${globalVar}${keypath(name, getPropertyAccess)}`;\n}\n\nfunction safeAccess(\n\tname: string,\n\tglobalVar: string,\n\t{ _, getPropertyAccess }: GenerateCodeSnippets\n) {\n\tlet propertyPath = globalVar;\n\treturn name\n\t\t.split('.')\n\t\t.map(part => (propertyPath += getPropertyAccess(part)))\n\t\t.join(`${_}&&${_}`);\n}\n\nexport default function umd(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tid,\n\t\tindent: t,\n\t\tintro,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tamd,\n\t\tcompact,\n\t\tesModule,\n\t\textend,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tglobals,\n\t\tnoConflict,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets;\n\tconst factoryVar = compact ? 'f' : 'factory';\n\tconst globalVar = compact ? 'g' : 'global';\n\n\tif (hasExports && !name) {\n\t\treturn error({\n\t\t\tcode: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',\n\t\t\tmessage:\n\t\t\t\t'You must supply \"output.name\" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'\n\t\t});\n\t}\n\n\twarnOnBuiltins(warn, dependencies);\n\n\tconst amdDeps = dependencies.map(\n\t\tm => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`\n\t);\n\tconst cjsDeps = dependencies.map(m => `require('${m.id}')`);\n\n\tconst trimmedImports = trimEmptyImports(dependencies);\n\tconst globalDeps = trimmedImports.map(module =>\n\t\tglobalProp(module.globalName, globalVar, getPropertyAccess)\n\t);\n\tconst factoryParams = trimmedImports.map(m => m.name);\n\n\tif (namedExportsMode && (hasExports || noConflict)) {\n\t\tamdDeps.unshift(`'exports'`);\n\t\tcjsDeps.unshift(`exports`);\n\t\tglobalDeps.unshift(\n\t\t\tassignToDeepVariable(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tglobals,\n\t\t\t\t`${extend ? `${globalProp(name!, globalVar, getPropertyAccess)}${_}||${_}` : ''}{}`,\n\t\t\t\tsnippets\n\t\t\t)\n\t\t);\n\n\t\tfactoryParams.unshift('exports');\n\t}\n\n\tconst completeAmdId = getCompleteAmdId(amd, id);\n\tconst amdParams =\n\t\t(completeAmdId ? `'${completeAmdId}',${_}` : ``) +\n\t\t(amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``);\n\n\tconst define = amd.define;\n\tconst cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``;\n\tconst useStrict = strict ? `${_}'use strict';${n}` : ``;\n\n\tlet iifeExport;\n\n\tif (noConflict) {\n\t\tconst noConflictExportsVar = compact ? 'e' : 'exports';\n\t\tlet factory;\n\n\t\tif (!namedExportsMode && hasExports) {\n\t\t\tfactory = `${cnst} ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tglobals,\n\t\t\t\t`${factoryVar}(${globalDeps.join(`,${_}`)})`,\n\t\t\t\tsnippets\n\t\t\t)};`;\n\t\t} else {\n\t\t\tconst module = globalDeps.shift();\n\t\t\tfactory =\n\t\t\t\t`${cnst} ${noConflictExportsVar}${_}=${_}${module};${n}` +\n\t\t\t\t`${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`;\n\t\t}\n\t\tiifeExport =\n\t\t\t`(${getFunctionIntro([], { isAsync: false, name: null })}{${n}` +\n\t\t\t`${t}${t}${cnst} current${_}=${_}${safeAccess(name!, globalVar, snippets)};${n}` +\n\t\t\t`${t}${t}${factory}${n}` +\n\t\t\t`${t}${t}${noConflictExportsVar}.noConflict${_}=${_}${getFunctionIntro([], {\n\t\t\t\tisAsync: false,\n\t\t\t\tname: null\n\t\t\t})}{${_}` +\n\t\t\t`${globalProp(\n\t\t\t\tname!,\n\t\t\t\tglobalVar,\n\t\t\t\tgetPropertyAccess\n\t\t\t)}${_}=${_}current;${_}return ${noConflictExportsVar}${s}${_}};${n}` +\n\t\t\t`${t}})()`;\n\t} else {\n\t\tiifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`;\n\t\tif (!namedExportsMode && hasExports) {\n\t\t\tiifeExport = assignToDeepVariable(name!, globalVar, globals, iifeExport, snippets);\n\t\t}\n\t}\n\n\tconst iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0;\n\tconst wrapperParams: string[] = [factoryVar];\n\tif (iifeNeedsGlobal) {\n\t\twrapperParams.unshift(globalVar);\n\t}\n\tconst globalArg = iifeNeedsGlobal ? `this,${_}` : '';\n\tconst iifeStart = iifeNeedsGlobal\n\t\t? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}`\n\t\t: '';\n\tconst iifeEnd = iifeNeedsGlobal ? ')' : '';\n\tconst cjsIntro = iifeNeedsGlobal\n\t\t? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` +\n\t\t `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}`\n\t\t: '';\n\n\tconst wrapperIntro =\n\t\t`(${getNonArrowFunctionIntro(wrapperParams, { isAsync: false, name: null })}{${n}` +\n\t\tcjsIntro +\n\t\t`${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` +\n\t\t`${t}${iifeStart}${iifeExport}${iifeEnd};${n}` +\n\t\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t\t// cf. https://v8.dev/blog/preparser#pife\n\t\t`})(${globalArg}(${getNonArrowFunctionIntro(factoryParams, {\n\t\t\tisAsync: false,\n\t\t\tname: null\n\t\t})}{${useStrict}${n}`;\n\n\tconst wrapperOutro = n + n + '}));';\n\n\tmagicString.prepend(\n\t\t`${intro}${getInteropBlock(\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tfreeze,\n\t\t\tnamespaceToStringTag,\n\t\t\taccessedGlobals,\n\t\t\tt,\n\t\t\tsnippets\n\t\t)}`\n\t);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tesModule,\n\t\tnamespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);\n}\n","import type { Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports } from '../Chunk';\nimport type { NormalizedOutputOptions, RollupWarning } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport amd from './amd';\nimport cjs from './cjs';\nimport es from './es';\nimport iife from './iife';\nimport system from './system';\nimport umd from './umd';\n\nexport interface FinaliserOptions {\n\taccessedGlobals: Set;\n\tdependencies: ChunkDependencies;\n\texports: ChunkExports;\n\thasExports: boolean;\n\tid: string;\n\tindent: string;\n\tintro: string;\n\tisEntryFacade: boolean;\n\tisModuleFacade: boolean;\n\tnamedExportsMode: boolean;\n\toutro: string;\n\tsnippets: GenerateCodeSnippets;\n\tusesTopLevelAwait: boolean;\n\twarn(warning: RollupWarning): void;\n}\n\nexport type Finaliser = (\n\tmagicString: MagicStringBundle,\n\tfinaliserOptions: FinaliserOptions,\n\toptions: NormalizedOutputOptions\n) => MagicStringBundle;\n\nexport default { amd, cjs, es, iife, system, umd } as {\n\t[format: string]: Finaliser;\n};\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport getCompleteAmdId from './shared/getCompleteAmdId';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport updateExtensionForRelativeAmdId from './shared/updateExtensionForRelativeAmdId';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nexport default function amd(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tid,\n\t\tindent: t,\n\t\tintro,\n\t\tisEntryFacade,\n\t\tisModuleFacade,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tamd,\n\t\tesModule,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\twarnOnBuiltins(warn, dependencies);\n\tconst deps = dependencies.map(\n\t\tm => `'${updateExtensionForRelativeAmdId(m.id, amd.forceJsExtensionForImports)}'`\n\t);\n\tconst args = dependencies.map(m => m.name);\n\tconst { n, getNonArrowFunctionIntro, _ } = snippets;\n\n\tif (namedExportsMode && hasExports) {\n\t\targs.unshift(`exports`);\n\t\tdeps.unshift(`'exports'`);\n\t}\n\n\tif (accessedGlobals.has('require')) {\n\t\targs.unshift('require');\n\t\tdeps.unshift(`'require'`);\n\t}\n\n\tif (accessedGlobals.has('module')) {\n\t\targs.unshift('module');\n\t\tdeps.unshift(`'module'`);\n\t}\n\n\tconst completeAmdId = getCompleteAmdId(amd, id);\n\tconst params =\n\t\t(completeAmdId ? `'${completeAmdId}',${_}` : ``) +\n\t\t(deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);\n\tconst useStrict = strict ? `${_}'use strict';` : '';\n\n\tmagicString.prepend(\n\t\t`${intro}${getInteropBlock(\n\t\t\tdependencies,\n\t\t\tinterop,\n\t\t\texternalLiveBindings,\n\t\t\tfreeze,\n\t\t\tnamespaceToStringTag,\n\t\t\taccessedGlobals,\n\t\t\tt,\n\t\t\tsnippets\n\t\t)}`\n\t);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tisEntryFacade && esModule,\n\t\tisModuleFacade && namespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn (\n\t\tmagicString\n\t\t\t.indent(t)\n\t\t\t// factory function should be wrapped by parentheses to avoid lazy parsing,\n\t\t\t// cf. https://v8.dev/blog/preparser#pife\n\t\t\t.prepend(\n\t\t\t\t`${amd.define}(${params}(${getNonArrowFunctionIntro(args, {\n\t\t\t\t\tisAsync: false,\n\t\t\t\t\tname: null\n\t\t\t\t})}{${useStrict}${n}${n}`\n\t\t\t)\n\t\t\t.append(`${n}${n}}));`)\n\t);\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport type { FinaliserOptions } from './index';\n\nexport default function cjs(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tisEntryFacade,\n\t\tisModuleFacade,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets\n\t}: FinaliserOptions,\n\t{\n\t\tcompact,\n\t\tesModule,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tinterop,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, n } = snippets;\n\n\tconst useStrict = strict ? `'use strict';${n}${n}` : '';\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tisEntryFacade && esModule,\n\t\tisModuleFacade && namespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers += n + n;\n\t}\n\tconst importBlock = getImportBlock(dependencies, snippets, compact);\n\tconst interopBlock = getInteropBlock(\n\t\tdependencies,\n\t\tinterop,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets\n\t);\n\n\tmagicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings,\n\t\t`module.exports${_}=${_}`\n\t);\n\n\treturn magicString.append(`${exportBlock}${outro}`);\n}\n\nfunction getImportBlock(\n\tdependencies: ChunkDependencies,\n\t{ _, cnst, n }: GenerateCodeSnippets,\n\tcompact: boolean\n): string {\n\tlet importBlock = '';\n\tlet definingVariable = false;\n\tfor (const { id, name, reexports, imports } of dependencies) {\n\t\tif (!reexports && !imports) {\n\t\t\tif (importBlock) {\n\t\t\t\timportBlock += compact && !definingVariable ? ',' : `;${n}`;\n\t\t\t}\n\t\t\tdefiningVariable = false;\n\t\t\timportBlock += `require('${id}')`;\n\t\t} else {\n\t\t\timportBlock += compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${cnst} `;\n\t\t\tdefiningVariable = true;\n\t\t\timportBlock += `${name}${_}=${_}require('${id}')`;\n\t\t}\n\t}\n\tif (importBlock) {\n\t\treturn `${importBlock};${n}${n}`;\n\t}\n\treturn '';\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { ChunkDependencies, ChunkExports, ImportSpecifier, ReexportSpecifier } from '../Chunk';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport type { GenerateCodeSnippets } from '../utils/generateCodeSnippets';\nimport { getHelpersBlock } from '../utils/interopHelpers';\nimport type { FinaliserOptions } from './index';\n\nexport default function es(\n\tmagicString: MagicStringBundle,\n\t{ accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }: FinaliserOptions,\n\t{ externalLiveBindings, freeze, namespaceToStringTag }: NormalizedOutputOptions\n): Bundle {\n\tconst { _, n } = snippets;\n\n\tconst importBlock = getImportBlock(dependencies, _);\n\tif (importBlock.length > 0) intro += importBlock.join(n) + n + n;\n\tintro += getHelpersBlock(\n\t\tnull,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag\n\t);\n\tif (intro) magicString.prepend(intro);\n\n\tconst exportBlock = getExportBlock(exports, snippets);\n\tif (exportBlock.length) magicString.append(n + n + exportBlock.join(n).trim());\n\tif (outro) magicString.append(outro);\n\n\treturn magicString.trim();\n}\n\nfunction getImportBlock(dependencies: ChunkDependencies, _: string): string[] {\n\tconst importBlock: string[] = [];\n\tfor (const { id, reexports, imports, name } of dependencies) {\n\t\tif (!reexports && !imports) {\n\t\t\timportBlock.push(`import${_}'${id}';`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (imports) {\n\t\t\tlet defaultImport: ImportSpecifier | null = null;\n\t\t\tlet starImport: ImportSpecifier | null = null;\n\t\t\tconst importedNames: ImportSpecifier[] = [];\n\t\t\tfor (const specifier of imports) {\n\t\t\t\tif (specifier.imported === 'default') {\n\t\t\t\t\tdefaultImport = specifier;\n\t\t\t\t} else if (specifier.imported === '*') {\n\t\t\t\t\tstarImport = specifier;\n\t\t\t\t} else {\n\t\t\t\t\timportedNames.push(specifier);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (starImport) {\n\t\t\t\timportBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`);\n\t\t\t}\n\t\t\tif (defaultImport && importedNames.length === 0) {\n\t\t\t\timportBlock.push(`import ${defaultImport.local} from${_}'${id}';`);\n\t\t\t} else if (importedNames.length > 0) {\n\t\t\t\timportBlock.push(\n\t\t\t\t\t`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames\n\t\t\t\t\t\t.map(specifier => {\n\t\t\t\t\t\t\tif (specifier.imported === specifier.local) {\n\t\t\t\t\t\t\t\treturn specifier.imported;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn `${specifier.imported} as ${specifier.local}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`,${_}`)}${_}}${_}from${_}'${id}';`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (reexports) {\n\t\t\tlet starExport: ReexportSpecifier | null = null;\n\t\t\tconst namespaceReexports: ReexportSpecifier[] = [];\n\t\t\tconst namedReexports: ReexportSpecifier[] = [];\n\t\t\tfor (const specifier of reexports) {\n\t\t\t\tif (specifier.reexported === '*') {\n\t\t\t\t\tstarExport = specifier;\n\t\t\t\t} else if (specifier.imported === '*') {\n\t\t\t\t\tnamespaceReexports.push(specifier);\n\t\t\t\t} else {\n\t\t\t\t\tnamedReexports.push(specifier);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (starExport) {\n\t\t\t\timportBlock.push(`export${_}*${_}from${_}'${id}';`);\n\t\t\t}\n\t\t\tif (namespaceReexports.length > 0) {\n\t\t\t\tif (\n\t\t\t\t\t!imports ||\n\t\t\t\t\t!imports.some(specifier => specifier.imported === '*' && specifier.local === name)\n\t\t\t\t) {\n\t\t\t\t\timportBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`);\n\t\t\t\t}\n\t\t\t\tfor (const specifier of namespaceReexports) {\n\t\t\t\t\timportBlock.push(\n\t\t\t\t\t\t`export${_}{${_}${\n\t\t\t\t\t\t\tname === specifier.reexported ? name : `${name} as ${specifier.reexported}`\n\t\t\t\t\t\t} };`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (namedReexports.length > 0) {\n\t\t\t\timportBlock.push(\n\t\t\t\t\t`export${_}{${_}${namedReexports\n\t\t\t\t\t\t.map(specifier => {\n\t\t\t\t\t\t\tif (specifier.imported === specifier.reexported) {\n\t\t\t\t\t\t\t\treturn specifier.imported;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn `${specifier.imported} as ${specifier.reexported}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join(`,${_}`)}${_}}${_}from${_}'${id}';`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn importBlock;\n}\n\nfunction getExportBlock(exports: ChunkExports, { _, cnst }: GenerateCodeSnippets): string[] {\n\tconst exportBlock: string[] = [];\n\tconst exportDeclaration: string[] = [];\n\tfor (const specifier of exports) {\n\t\tif (specifier.expression) {\n\t\t\texportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`);\n\t\t}\n\t\texportDeclaration.push(\n\t\t\tspecifier.exported === specifier.local\n\t\t\t\t? specifier.local\n\t\t\t\t: `${specifier.local} as ${specifier.exported}`\n\t\t);\n\t}\n\tif (exportDeclaration.length) {\n\t\texportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);\n\t}\n\treturn exportBlock;\n}\n","import type { Bundle, Bundle as MagicStringBundle } from 'magic-string';\nimport type { NormalizedOutputOptions } from '../rollup/types';\nimport { error } from '../utils/error';\nimport { isLegal } from '../utils/identifierHelpers';\nimport { getExportBlock, getNamespaceMarkers } from './shared/getExportBlock';\nimport getInteropBlock from './shared/getInteropBlock';\nimport { keypath } from './shared/sanitize';\nimport setupNamespace from './shared/setupNamespace';\nimport trimEmptyImports from './shared/trimEmptyImports';\nimport warnOnBuiltins from './shared/warnOnBuiltins';\nimport type { FinaliserOptions } from './index';\n\nexport default function iife(\n\tmagicString: MagicStringBundle,\n\t{\n\t\taccessedGlobals,\n\t\tdependencies,\n\t\texports,\n\t\thasExports,\n\t\tindent: t,\n\t\tintro,\n\t\tnamedExportsMode,\n\t\toutro,\n\t\tsnippets,\n\t\twarn\n\t}: FinaliserOptions,\n\t{\n\t\tcompact,\n\t\tesModule,\n\t\textend,\n\t\tfreeze,\n\t\texternalLiveBindings,\n\t\tglobals,\n\t\tinterop,\n\t\tname,\n\t\tnamespaceToStringTag,\n\t\tstrict\n\t}: NormalizedOutputOptions\n): Bundle {\n\tconst { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;\n\tconst isNamespaced = name && name.includes('.');\n\tconst useVariableAssignment = !extend && !isNamespaced;\n\n\tif (name && useVariableAssignment && !isLegal(name)) {\n\t\treturn error({\n\t\t\tcode: 'ILLEGAL_IDENTIFIER_AS_NAME',\n\t\t\tmessage: `Given name \"${name}\" is not a legal JS identifier. If you need this, you can try \"output.extend: true\".`\n\t\t});\n\t}\n\n\twarnOnBuiltins(warn, dependencies);\n\n\tconst external = trimEmptyImports(dependencies);\n\tconst deps = external.map(dep => dep.globalName || 'null');\n\tconst args = external.map(m => m.name);\n\n\tif (hasExports && !name) {\n\t\twarn({\n\t\t\tcode: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',\n\t\t\tmessage: `If you do not supply \"output.name\", you may not be able to access the exports of an IIFE bundle.`\n\t\t});\n\t}\n\n\tif (namedExportsMode && hasExports) {\n\t\tif (extend) {\n\t\t\tdeps.unshift(\n\t\t\t\t`this${keypath(name!, getPropertyAccess)}${_}=${_}this${keypath(\n\t\t\t\t\tname!,\n\t\t\t\t\tgetPropertyAccess\n\t\t\t\t)}${_}||${_}{}`\n\t\t\t);\n\t\t\targs.unshift('exports');\n\t\t} else {\n\t\t\tdeps.unshift('{}');\n\t\t\targs.unshift('exports');\n\t\t}\n\t}\n\n\tconst useStrict = strict ? `${t}'use strict';${n}` : '';\n\tconst interopBlock = getInteropBlock(\n\t\tdependencies,\n\t\tinterop,\n\t\texternalLiveBindings,\n\t\tfreeze,\n\t\tnamespaceToStringTag,\n\t\taccessedGlobals,\n\t\tt,\n\t\tsnippets\n\t);\n\tmagicString.prepend(`${intro}${interopBlock}`);\n\n\tlet wrapperIntro = `(${getNonArrowFunctionIntro(args, {\n\t\tisAsync: false,\n\t\tname: null\n\t})}{${n}${useStrict}${n}`;\n\tif (hasExports) {\n\t\tif (name && !(extend && namedExportsMode)) {\n\t\t\twrapperIntro =\n\t\t\t\t(useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) +\n\t\t\t\t`${_}=${_}${wrapperIntro}`;\n\t\t}\n\t\tif (isNamespaced) {\n\t\t\twrapperIntro = setupNamespace(name!, 'this', globals, snippets, compact) + wrapperIntro;\n\t\t}\n\t}\n\n\tlet wrapperOutro = `${n}${n}})(${deps.join(`,${_}`)});`;\n\tif (hasExports && !extend && namedExportsMode) {\n\t\twrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;\n\t}\n\n\tconst exportBlock = getExportBlock(\n\t\texports,\n\t\tdependencies,\n\t\tnamedExportsMode,\n\t\tinterop,\n\t\tsnippets,\n\t\tt,\n\t\texternalLiveBindings\n\t);\n\tlet namespaceMarkers = getNamespaceMarkers(\n\t\tnamedExportsMode && hasExports,\n\t\tesModule,\n\t\tnamespaceToStringTag,\n\t\tsnippets\n\t);\n\tif (namespaceMarkers) {\n\t\tnamespaceMarkers = n + n + namespaceMarkers;\n\t}\n\tmagicString.append(`${exportBlock}${namespaceMarkers}${outro}`);\n\treturn magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro);\n}\n","import { type DecodedSourceMap, SourceMap } from 'magic-string';\nimport type Module from '../Module';\nimport type {\n\tDecodedSourceMapOrMissing,\n\tExistingDecodedSourceMap,\n\tSourceMapSegment,\n\tWarningHandler\n} from '../rollup/types';\nimport { error } from './error';\nimport { basename, dirname, relative, resolve } from './path';\n\nclass Source {\n\treadonly content: string;\n\treadonly filename: string;\n\tisOriginal = true;\n\n\tconstructor(filename: string, content: string) {\n\t\tthis.filename = filename;\n\t\tthis.content = content;\n\t}\n\n\ttraceSegment(line: number, column: number, name: string): SourceMapSegmentObject {\n\t\treturn { column, line, name, source: this };\n\t}\n}\n\ninterface SourceMapSegmentObject {\n\tcolumn: number;\n\tline: number;\n\tname: string;\n\tsource: Source;\n}\n\nclass Link {\n\treadonly mappings: readonly SourceMapSegment[][];\n\treadonly names: readonly string[];\n\treadonly sources: (Source | Link)[];\n\n\tconstructor(\n\t\tmap: { mappings: readonly SourceMapSegment[][]; names: readonly string[] },\n\t\tsources: (Source | Link)[]\n\t) {\n\t\tthis.sources = sources;\n\t\tthis.names = map.names;\n\t\tthis.mappings = map.mappings;\n\t}\n\n\ttraceMappings() {\n\t\tconst sources: string[] = [];\n\t\tconst sourceIndexMap = new Map();\n\t\tconst sourcesContent: string[] = [];\n\t\tconst names: string[] = [];\n\t\tconst nameIndexMap = new Map();\n\n\t\tconst mappings = [];\n\n\t\tfor (const line of this.mappings) {\n\t\t\tconst tracedLine: SourceMapSegment[] = [];\n\n\t\t\tfor (const segment of line) {\n\t\t\t\tif (segment.length === 1) continue;\n\t\t\t\tconst source = this.sources[segment[1]];\n\t\t\t\tif (!source) continue;\n\n\t\t\t\tconst traced = source.traceSegment(\n\t\t\t\t\tsegment[2],\n\t\t\t\t\tsegment[3],\n\t\t\t\t\tsegment.length === 5 ? this.names[segment[4]] : ''\n\t\t\t\t);\n\n\t\t\t\tif (traced) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tcolumn,\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tsource: { content, filename }\n\t\t\t\t\t} = traced;\n\t\t\t\t\tlet sourceIndex = sourceIndexMap.get(filename);\n\t\t\t\t\tif (sourceIndex === undefined) {\n\t\t\t\t\t\tsourceIndex = sources.length;\n\t\t\t\t\t\tsources.push(filename);\n\t\t\t\t\t\tsourceIndexMap.set(filename, sourceIndex);\n\t\t\t\t\t\tsourcesContent[sourceIndex] = content;\n\t\t\t\t\t} else if (sourcesContent[sourceIndex] == null) {\n\t\t\t\t\t\tsourcesContent[sourceIndex] = content;\n\t\t\t\t\t} else if (content != null && sourcesContent[sourceIndex] !== content) {\n\t\t\t\t\t\treturn error({\n\t\t\t\t\t\t\tmessage: `Multiple conflicting contents for sourcemap source ${filename}`\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst tracedSegment: SourceMapSegment = [segment[0], sourceIndex, line, column];\n\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlet nameIndex = nameIndexMap.get(name);\n\t\t\t\t\t\tif (nameIndex === undefined) {\n\t\t\t\t\t\t\tnameIndex = names.length;\n\t\t\t\t\t\t\tnames.push(name);\n\t\t\t\t\t\t\tnameIndexMap.set(name, nameIndex);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t(tracedSegment as SourceMapSegment)[4] = nameIndex;\n\t\t\t\t\t}\n\n\t\t\t\t\ttracedLine.push(tracedSegment);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmappings.push(tracedLine);\n\t\t}\n\n\t\treturn { mappings, names, sources, sourcesContent };\n\t}\n\n\ttraceSegment(line: number, column: number, name: string): SourceMapSegmentObject | null {\n\t\tconst segments = this.mappings[line];\n\t\tif (!segments) return null;\n\n\t\t// binary search through segments for the given column\n\t\tlet searchStart = 0;\n\t\tlet searchEnd = segments.length - 1;\n\n\t\twhile (searchStart <= searchEnd) {\n\t\t\tconst m = (searchStart + searchEnd) >> 1;\n\t\t\tconst segment = segments[m];\n\n\t\t\t// If a sourcemap does not have sufficient resolution to contain a\n\t\t\t// necessary mapping, e.g. because it only contains line information, we\n\t\t\t// use the best approximation we could find\n\t\t\tif (segment[0] === column || searchStart === searchEnd) {\n\t\t\t\tif (segment.length == 1) return null;\n\t\t\t\tconst source = this.sources[segment[1]];\n\t\t\t\tif (!source) return null;\n\n\t\t\t\treturn source.traceSegment(\n\t\t\t\t\tsegment[2],\n\t\t\t\t\tsegment[3],\n\t\t\t\t\tsegment.length === 5 ? this.names[segment[4]] : name\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (segment[0] > column) {\n\t\t\t\tsearchEnd = m - 1;\n\t\t\t} else {\n\t\t\t\tsearchStart = m + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nfunction getLinkMap(warn: WarningHandler) {\n\treturn function linkMap(source: Source | Link, map: DecodedSourceMapOrMissing): Link {\n\t\tif (map.mappings) {\n\t\t\treturn new Link(map, [source]);\n\t\t}\n\n\t\twarn({\n\t\t\tcode: 'SOURCEMAP_BROKEN',\n\t\t\tmessage:\n\t\t\t\t`Sourcemap is likely to be incorrect: a plugin (${map.plugin}) was used to transform ` +\n\t\t\t\t\"files, but didn't generate a sourcemap for the transformation. Consult the plugin \" +\n\t\t\t\t'documentation for help',\n\t\t\tplugin: map.plugin,\n\t\t\turl: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`\n\t\t});\n\n\t\treturn new Link(\n\t\t\t{\n\t\t\t\tmappings: [],\n\t\t\t\tnames: []\n\t\t\t},\n\t\t\t[source]\n\t\t);\n\t};\n}\n\nfunction getCollapsedSourcemap(\n\tid: string,\n\toriginalCode: string,\n\toriginalSourcemap: ExistingDecodedSourceMap | null,\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\tlinkMap: (source: Source | Link, map: DecodedSourceMapOrMissing) => Link\n): Source | Link {\n\tlet source: Source | Link;\n\n\tif (!originalSourcemap) {\n\t\tsource = new Source(id, originalCode);\n\t} else {\n\t\tconst sources = originalSourcemap.sources;\n\t\tconst sourcesContent = originalSourcemap.sourcesContent || [];\n\t\tconst directory = dirname(id) || '.';\n\t\tconst sourceRoot = originalSourcemap.sourceRoot || '.';\n\n\t\tconst baseSources = sources.map(\n\t\t\t(source, i) => new Source(resolve(directory, sourceRoot, source), sourcesContent[i])\n\t\t);\n\t\tsource = new Link(originalSourcemap, baseSources);\n\t}\n\treturn sourcemapChain.reduce(linkMap, source);\n}\n\nexport function collapseSourcemaps(\n\tfile: string,\n\tmap: DecodedSourceMap,\n\tmodules: readonly Module[],\n\tbundleSourcemapChain: readonly DecodedSourceMapOrMissing[],\n\texcludeContent: boolean | undefined,\n\twarn: WarningHandler\n): SourceMap {\n\tconst linkMap = getLinkMap(warn);\n\tconst moduleSources = modules\n\t\t.filter(module => !module.excludeFromSourcemap)\n\t\t.map(module =>\n\t\t\tgetCollapsedSourcemap(\n\t\t\t\tmodule.id,\n\t\t\t\tmodule.originalCode,\n\t\t\t\tmodule.originalSourcemap,\n\t\t\t\tmodule.sourcemapChain,\n\t\t\t\tlinkMap\n\t\t\t)\n\t\t);\n\n\tconst link = new Link(map, moduleSources);\n\tconst source = bundleSourcemapChain.reduce(linkMap, link);\n\tlet { sources, sourcesContent, names, mappings } = source.traceMappings();\n\n\tif (file) {\n\t\tconst directory = dirname(file);\n\t\tsources = sources.map((source: string) => relative(directory, source));\n\t\tfile = basename(file);\n\t}\n\n\tsourcesContent = (excludeContent ? null : sourcesContent) as string[];\n\n\treturn new SourceMap({ file, mappings, names, sources, sourcesContent });\n}\n\nexport function collapseSourcemap(\n\tid: string,\n\toriginalCode: string,\n\toriginalSourcemap: ExistingDecodedSourceMap | null,\n\tsourcemapChain: readonly DecodedSourceMapOrMissing[],\n\twarn: WarningHandler\n): ExistingDecodedSourceMap | null {\n\tif (!sourcemapChain.length) {\n\t\treturn originalSourcemap;\n\t}\n\n\tconst source = getCollapsedSourcemap(\n\t\tid,\n\t\toriginalCode,\n\t\toriginalSourcemap,\n\t\tsourcemapChain,\n\t\tgetLinkMap(warn)\n\t) as Link;\n\tconst map = source.traceMappings();\n\treturn { version: 3, ...map };\n}\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction isSurrogatePair(msg, i) {\n if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {\n return false;\n }\n if (i < 0 || i + 1 >= msg.length) {\n return false;\n }\n return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;\n}\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n // Inspired by stringToUtf8ByteArray() in closure-library by Google\n // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143\n // Apache License 2.0\n // https://github.com/google/closure-library/blob/master/LICENSE\n var p = 0;\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n if (c < 128) {\n res[p++] = c;\n } else if (c < 2048) {\n res[p++] = (c >> 6) | 192;\n res[p++] = (c & 63) | 128;\n } else if (isSurrogatePair(msg, i)) {\n c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);\n res[p++] = (c >> 18) | 240;\n res[p++] = ((c >> 12) & 63) | 128;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n } else {\n res[p++] = (c >> 12) | 224;\n res[p++] = ((c >> 6) & 63) | 128;\n res[p++] = (c & 63) | 128;\n }\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","import sha256 from 'hash.js/lib/hash/sha/256';\n\nexport const createHash = (): {\n\tdigest: (format: string) => string;\n\tupdate: (data: unknown) => void;\n} => sha256();\n","import type Chunk from '../Chunk';\nimport ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\nimport type ChildScope from '../ast/scopes/ChildScope';\nimport ExportDefaultVariable from '../ast/variables/ExportDefaultVariable';\nimport type SyntheticNamedExportVariable from '../ast/variables/SyntheticNamedExportVariable';\nimport type Variable from '../ast/variables/Variable';\nimport type { GetInterop, InternalModuleFormat } from '../rollup/types';\nimport {\n\tcanDefaultBeTakenFromNamespace,\n\tdefaultInteropHelpersByInteropType,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from './interopHelpers';\nimport { getSafeName } from './safeName';\n\nexport interface DependenciesToBeDeconflicted {\n\tdeconflictedDefault: ReadonlySet;\n\tdeconflictedNamespace: ReadonlySet;\n\tdependencies: ReadonlySet;\n}\n\nconst DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT: {\n\t[format in InternalModuleFormat]: (\n\t\tusedNames: Set,\n\t\timports: ReadonlySet,\n\t\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\t\tinterop: GetInterop,\n\t\tpreserveModules: boolean,\n\t\texternalLiveBindings: boolean,\n\t\tchunkByModule: ReadonlyMap,\n\t\tsyntheticExports: ReadonlySet\n\t) => void;\n} = {\n\tamd: deconflictImportsOther,\n\tcjs: deconflictImportsOther,\n\tes: deconflictImportsEsmOrSystem,\n\tiife: deconflictImportsOther,\n\tsystem: deconflictImportsEsmOrSystem,\n\tumd: deconflictImportsOther\n};\n\nexport function deconflictChunk(\n\tmodules: readonly Module[],\n\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\timports: ReadonlySet,\n\tusedNames: Set,\n\tformat: InternalModuleFormat,\n\tinterop: GetInterop,\n\tpreserveModules: boolean,\n\texternalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap,\n\tsyntheticExports: ReadonlySet,\n\texportNamesByVariable: ReadonlyMap,\n\taccessedGlobalsByScope: ReadonlyMap>,\n\tincludedNamespaces: ReadonlySet\n): void {\n\tconst reversedModules = modules.slice().reverse();\n\tfor (const module of reversedModules) {\n\t\tmodule.scope.addUsedOutsideNames(\n\t\t\tusedNames,\n\t\t\tformat,\n\t\t\texportNamesByVariable,\n\t\t\taccessedGlobalsByScope\n\t\t);\n\t}\n\tdeconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);\n\tDECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](\n\t\tusedNames,\n\t\timports,\n\t\tdependenciesToBeDeconflicted,\n\t\tinterop,\n\t\tpreserveModules,\n\t\texternalLiveBindings,\n\t\tchunkByModule,\n\t\tsyntheticExports\n\t);\n\n\tfor (const module of reversedModules) {\n\t\tmodule.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);\n\t}\n}\n\nfunction deconflictImportsEsmOrSystem(\n\tusedNames: Set,\n\timports: ReadonlySet,\n\tdependenciesToBeDeconflicted: DependenciesToBeDeconflicted,\n\t_interop: GetInterop,\n\tpreserveModules: boolean,\n\t_externalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap,\n\tsyntheticExports: ReadonlySet\n) {\n\t// This is needed for namespace reexports\n\tfor (const dependency of dependenciesToBeDeconflicted.dependencies) {\n\t\tif (preserveModules || dependency instanceof ExternalModule) {\n\t\t\tdependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);\n\t\t}\n\t}\n\tfor (const variable of imports) {\n\t\tconst module = variable.module!;\n\t\tconst name = variable.name;\n\t\tif (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {\n\t\t\tvariable.setRenderNames(\n\t\t\t\tnull,\n\t\t\t\t(module instanceof ExternalModule ? module : chunkByModule.get(module)!).variableName\n\t\t\t);\n\t\t} else if (module instanceof ExternalModule && name === 'default') {\n\t\t\tvariable.setRenderNames(\n\t\t\t\tnull,\n\t\t\t\tgetSafeName(\n\t\t\t\t\t[...module.exportedVariables].some(\n\t\t\t\t\t\t([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included\n\t\t\t\t\t)\n\t\t\t\t\t\t? module.suggestedVariableName + '__default'\n\t\t\t\t\t\t: module.suggestedVariableName,\n\t\t\t\t\tusedNames\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tvariable.setRenderNames(null, getSafeName(name, usedNames));\n\t\t}\n\t}\n\tfor (const variable of syntheticExports) {\n\t\tvariable.setRenderNames(null, getSafeName(variable.name, usedNames));\n\t}\n}\n\nfunction deconflictImportsOther(\n\tusedNames: Set,\n\timports: ReadonlySet,\n\t{ deconflictedDefault, deconflictedNamespace, dependencies }: DependenciesToBeDeconflicted,\n\tinterop: GetInterop,\n\tpreserveModules: boolean,\n\texternalLiveBindings: boolean,\n\tchunkByModule: ReadonlyMap\n): void {\n\tfor (const chunkOrExternalModule of dependencies) {\n\t\tchunkOrExternalModule.variableName = getSafeName(\n\t\t\tchunkOrExternalModule.suggestedVariableName,\n\t\t\tusedNames\n\t\t);\n\t}\n\tfor (const externalModuleOrChunk of deconflictedNamespace) {\n\t\texternalModuleOrChunk.namespaceVariableName = getSafeName(\n\t\t\t`${externalModuleOrChunk.suggestedVariableName}__namespace`,\n\t\t\tusedNames\n\t\t);\n\t}\n\tfor (const externalModule of deconflictedDefault) {\n\t\tif (\n\t\t\tdeconflictedNamespace.has(externalModule) &&\n\t\t\tcanDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)\n\t\t) {\n\t\t\texternalModule.defaultVariableName = externalModule.namespaceVariableName;\n\t\t} else {\n\t\t\texternalModule.defaultVariableName = getSafeName(\n\t\t\t\t`${externalModule.suggestedVariableName}__default`,\n\t\t\t\tusedNames\n\t\t\t);\n\t\t}\n\t}\n\tfor (const variable of imports) {\n\t\tconst module = variable.module;\n\t\tif (module instanceof ExternalModule) {\n\t\t\tconst name = variable.name;\n\t\t\tif (name === 'default') {\n\t\t\t\tconst moduleInterop = String(interop(module.id));\n\t\t\t\tconst variableName = defaultInteropHelpersByInteropType[moduleInterop]\n\t\t\t\t\t? module.defaultVariableName\n\t\t\t\t\t: module.variableName;\n\t\t\t\tif (isDefaultAProperty(moduleInterop, externalLiveBindings)) {\n\t\t\t\t\tvariable.setRenderNames(variableName, 'default');\n\t\t\t\t} else {\n\t\t\t\t\tvariable.setRenderNames(null, variableName);\n\t\t\t\t}\n\t\t\t} else if (name === '*') {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tnull,\n\t\t\t\t\tnamespaceInteropHelpersByInteropType[String(interop(module.id))]\n\t\t\t\t\t\t? module.namespaceVariableName\n\t\t\t\t\t\t: module.variableName\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// if the second parameter is `null`, it uses its \"name\" for the property name\n\t\t\t\tvariable.setRenderNames(module.variableName, null);\n\t\t\t}\n\t\t} else {\n\t\t\tconst chunk = chunkByModule.get(module!)!;\n\t\t\tif (preserveModules && variable.isNamespace) {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tnull,\n\t\t\t\t\tchunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName\n\t\t\t\t);\n\t\t\t} else if (chunk.exportMode === 'default') {\n\t\t\t\tvariable.setRenderNames(null, chunk.variableName);\n\t\t\t} else {\n\t\t\t\tvariable.setRenderNames(\n\t\t\t\t\tchunk.variableName,\n\t\t\t\t\tchunk.getVariableExportName(variable) as string | null\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction deconflictTopLevelVariables(\n\tusedNames: Set,\n\tmodules: readonly Module[],\n\tincludedNamespaces: ReadonlySet\n): void {\n\tfor (const module of modules) {\n\t\tfor (const variable of module.scope.variables.values()) {\n\t\t\tif (\n\t\t\t\tvariable.included &&\n\t\t\t\t// this will only happen for exports in some formats\n\t\t\t\t!(\n\t\t\t\t\tvariable.renderBaseName ||\n\t\t\t\t\t(variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable)\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tvariable.setRenderNames(null, getSafeName(variable.name, usedNames));\n\t\t\t}\n\t\t}\n\t\tif (includedNamespaces.has(module)) {\n\t\t\tconst namespace = module.namespace;\n\t\t\tnamespace.setRenderNames(null, getSafeName(namespace.name, usedNames));\n\t\t}\n\t}\n}\n","const needsEscapeRegEx = /[\\\\'\\r\\n\\u2028\\u2029]/;\nconst quoteNewlineRegEx = /(['\\r\\n\\u2028\\u2029])/g;\nconst backSlashRegEx = /\\\\/g;\n\nexport function escapeId(id: string): string {\n\tif (!id.match(needsEscapeRegEx)) return id;\n\treturn id.replace(backSlashRegEx, '\\\\\\\\').replace(quoteNewlineRegEx, '\\\\$1');\n}\n","import type Chunk from '../Chunk';\nimport type { NormalizedOutputOptions, WarningHandler } from '../rollup/types';\nimport {\n\terrIncompatibleExportOptionValue,\n\terrMixedExport,\n\terror,\n\terrPreferNamedExports\n} from './error';\n\nexport default function getExportMode(\n\tchunk: Chunk,\n\t{ exports: exportMode, name, format }: NormalizedOutputOptions,\n\tunsetOptions: ReadonlySet,\n\tfacadeModuleId: string,\n\twarn: WarningHandler\n): 'default' | 'named' | 'none' {\n\tconst exportKeys = chunk.getExportNames();\n\n\tif (exportMode === 'default') {\n\t\tif (exportKeys.length !== 1 || exportKeys[0] !== 'default') {\n\t\t\treturn error(errIncompatibleExportOptionValue('default', exportKeys, facadeModuleId));\n\t\t}\n\t} else if (exportMode === 'none' && exportKeys.length) {\n\t\treturn error(errIncompatibleExportOptionValue('none', exportKeys, facadeModuleId));\n\t}\n\n\tif (exportMode === 'auto') {\n\t\tif (exportKeys.length === 0) {\n\t\t\texportMode = 'none';\n\t\t} else if (exportKeys.length === 1 && exportKeys[0] === 'default') {\n\t\t\tif (format === 'cjs' && unsetOptions.has('exports')) {\n\t\t\t\twarn(errPreferNamedExports(facadeModuleId));\n\t\t\t}\n\t\t\texportMode = 'default';\n\t\t} else {\n\t\t\tif (format !== 'es' && format !== 'system' && exportKeys.includes('default')) {\n\t\t\t\twarn(errMixedExport(facadeModuleId, name));\n\t\t\t}\n\t\t\texportMode = 'named';\n\t\t}\n\t}\n\n\treturn exportMode;\n}\n","import type Module from '../Module';\n\nfunction guessIndentString(code: string): string | null {\n\tconst lines = code.split('\\n');\n\n\tconst tabbed = lines.filter(line => /^\\t+/.test(line));\n\tconst spaced = lines.filter(line => /^ {2,}/.test(line));\n\n\tif (tabbed.length === 0 && spaced.length === 0) {\n\t\treturn null;\n\t}\n\n\t// More lines tabbed than spaced? Assume tabs, and\n\t// default to tabs in the case of a tie (or nothing\n\t// to go on)\n\tif (tabbed.length >= spaced.length) {\n\t\treturn '\\t';\n\t}\n\n\t// Otherwise, we need to guess the multiple\n\tconst min = spaced.reduce((previous, current) => {\n\t\tconst numSpaces = /^ +/.exec(current)![0].length;\n\t\treturn Math.min(numSpaces, previous);\n\t}, Infinity);\n\n\treturn new Array(min + 1).join(' ');\n}\n\nexport default function getIndentString(\n\tmodules: readonly Module[],\n\toptions: { indent: true | string }\n): string {\n\tif (options.indent !== true) return options.indent;\n\tfor (const module of modules) {\n\t\tconst indent = guessIndentString(module.originalCode);\n\t\tif (indent !== null) return indent;\n\t}\n\n\treturn '\\t';\n}\n","import type Chunk from '../Chunk';\nimport ExternalModule from '../ExternalModule';\nimport type Module from '../Module';\n\nexport function getStaticDependencies(\n\tchunk: Chunk,\n\torderedModules: readonly Module[],\n\tchunkByModule: ReadonlyMap\n): Set {\n\tconst staticDependencyBlocks: (Chunk | ExternalModule)[][] = [];\n\tconst handledDependencies = new Set();\n\tfor (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {\n\t\tconst module = orderedModules[modulePos];\n\t\tif (!handledDependencies.has(module)) {\n\t\t\tconst staticDependencies: (Chunk | ExternalModule)[] = [];\n\t\t\taddStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);\n\t\t\tstaticDependencyBlocks.unshift(staticDependencies);\n\t\t}\n\t}\n\tconst dependencies = new Set();\n\tfor (const block of staticDependencyBlocks) {\n\t\tfor (const dependency of block) {\n\t\t\tdependencies.add(dependency);\n\t\t}\n\t}\n\treturn dependencies;\n}\n\nfunction addStaticDependencies(\n\tmodule: Module,\n\tstaticDependencies: (Chunk | ExternalModule)[],\n\thandledModules: Set,\n\tchunk: Chunk,\n\tchunkByModule: ReadonlyMap\n): void {\n\tconst dependencies = module.getDependenciesToBeIncluded();\n\tfor (const dependency of dependencies) {\n\t\tif (dependency instanceof ExternalModule) {\n\t\t\tstaticDependencies.push(dependency);\n\t\t\tcontinue;\n\t\t}\n\t\tconst dependencyChunk = chunkByModule.get(dependency)!;\n\t\tif (dependencyChunk !== chunk) {\n\t\t\tstaticDependencies.push(dependencyChunk);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!handledModules.has(dependency)) {\n\t\t\thandledModules.add(dependency);\n\t\t\taddStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);\n\t\t}\n\t}\n}\n","import { decode } from 'sourcemap-codec';\nimport type {\n\tExistingDecodedSourceMap,\n\tExistingRawSourceMap,\n\tSourceMapInput\n} from '../rollup/types';\n\ntype Input = SourceMapInput | ExistingDecodedSourceMap | undefined;\n\nexport function decodedSourcemap(map: Input): ExistingDecodedSourceMap | null {\n\tif (!map) return null;\n\n\tif (typeof map === 'string') {\n\t\tmap = JSON.parse(map) as ExistingRawSourceMap;\n\t}\n\tif (map.mappings === '') {\n\t\treturn {\n\t\t\tmappings: [],\n\t\t\tnames: [],\n\t\t\tsources: [],\n\t\t\tversion: 3\n\t\t};\n\t}\n\n\tconst mappings = typeof map.mappings === 'string' ? decode(map.mappings) : map.mappings;\n\n\treturn { ...(map as ExistingRawSourceMap | ExistingDecodedSourceMap), mappings };\n}\n","import { OutputAsset, OutputBundle, OutputChunk } from '../rollup/types';\n\nexport const lowercaseBundleKeys = Symbol('bundleKeys');\n\nexport const FILE_PLACEHOLDER = {\n\ttype: 'placeholder' as const\n};\n\nexport interface OutputBundleWithPlaceholders {\n\t[fileName: string]: OutputAsset | OutputChunk | typeof FILE_PLACEHOLDER;\n\t[lowercaseBundleKeys]: Set;\n}\n\nexport const getOutputBundle = (outputBundleBase: OutputBundle): OutputBundleWithPlaceholders => {\n\tconst reservedLowercaseBundleKeys = new Set();\n\treturn new Proxy(outputBundleBase, {\n\t\tdeleteProperty(target, key) {\n\t\t\tif (typeof key === 'string') {\n\t\t\t\treservedLowercaseBundleKeys.delete(key.toLowerCase());\n\t\t\t}\n\t\t\treturn Reflect.deleteProperty(target, key);\n\t\t},\n\t\tget(target, key) {\n\t\t\tif (key === lowercaseBundleKeys) {\n\t\t\t\treturn reservedLowercaseBundleKeys;\n\t\t\t}\n\t\t\treturn Reflect.get(target, key);\n\t\t},\n\t\tset(target, key, value) {\n\t\t\tif (typeof key === 'string') {\n\t\t\t\treservedLowercaseBundleKeys.add(key.toLowerCase());\n\t\t\t}\n\t\t\treturn Reflect.set(target, key, value);\n\t\t}\n\t}) as OutputBundleWithPlaceholders;\n};\n","import { errFailedValidation, error } from './error';\nimport { lowercaseBundleKeys, OutputBundleWithPlaceholders } from './outputBundle';\nimport { extname } from './path';\nimport { isPathFragment } from './relativeId';\n\nexport function renderNamePattern(\n\tpattern: string,\n\tpatternName: string,\n\treplacements: { [name: string]: () => string }\n): string {\n\tif (isPathFragment(pattern))\n\t\treturn error(\n\t\t\terrFailedValidation(\n\t\t\t\t`Invalid pattern \"${pattern}\" for \"${patternName}\", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`\n\t\t\t)\n\t\t);\n\treturn pattern.replace(/\\[(\\w+)\\]/g, (_match, type) => {\n\t\tif (!replacements.hasOwnProperty(type)) {\n\t\t\treturn error(\n\t\t\t\terrFailedValidation(`\"[${type}]\" is not a valid placeholder in \"${patternName}\" pattern.`)\n\t\t\t);\n\t\t}\n\t\tconst replacement = replacements[type]();\n\t\tif (isPathFragment(replacement))\n\t\t\treturn error(\n\t\t\t\terrFailedValidation(\n\t\t\t\t\t`Invalid substitution \"${replacement}\" for placeholder \"[${type}]\" in \"${patternName}\" pattern, can be neither absolute nor relative path.`\n\t\t\t\t)\n\t\t\t);\n\t\treturn replacement;\n\t});\n}\n\nexport function makeUnique(\n\tname: string,\n\t{ [lowercaseBundleKeys]: reservedLowercaseBundleKeys }: OutputBundleWithPlaceholders\n): string {\n\tif (!reservedLowercaseBundleKeys.has(name.toLowerCase())) return name;\n\tconst ext = extname(name);\n\tname = name.substring(0, name.length - ext.length);\n\tlet uniqueName: string,\n\t\tuniqueIndex = 1;\n\twhile (reservedLowercaseBundleKeys.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()));\n\treturn uniqueName;\n}\n","import MagicString, { Bundle as MagicStringBundle, type SourceMap } from 'magic-string';\nimport { relative } from '../browser/path';\nimport ExternalModule from './ExternalModule';\nimport Module from './Module';\nimport ExportDefaultDeclaration from './ast/nodes/ExportDefaultDeclaration';\nimport FunctionDeclaration from './ast/nodes/FunctionDeclaration';\nimport type ChildScope from './ast/scopes/ChildScope';\nimport ExportDefaultVariable from './ast/variables/ExportDefaultVariable';\nimport LocalVariable from './ast/variables/LocalVariable';\nimport NamespaceVariable from './ast/variables/NamespaceVariable';\nimport SyntheticNamedExportVariable from './ast/variables/SyntheticNamedExportVariable';\nimport type Variable from './ast/variables/Variable';\nimport finalisers from './finalisers/index';\nimport type {\n\tDecodedSourceMapOrMissing,\n\tGetInterop,\n\tGlobalsOption,\n\tInternalModuleFormat,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions,\n\tPreRenderedChunk,\n\tRenderedChunk,\n\tRenderedModule,\n\tWarningHandler\n} from './rollup/types';\nimport type { PluginDriver } from './utils/PluginDriver';\nimport type { Addons } from './utils/addons';\nimport { collapseSourcemaps } from './utils/collapseSourcemaps';\nimport { createHash } from './utils/crypto';\nimport { deconflictChunk, type DependenciesToBeDeconflicted } from './utils/deconflictChunk';\nimport {\n\terrCyclicCrossChunkReexport,\n\terrFailedValidation,\n\terrInvalidOption,\n\terror,\n\terrUnexpectedNamedImport,\n\terrUnexpectedNamespaceReexport\n} from './utils/error';\nimport { escapeId } from './utils/escapeId';\nimport { assignExportsToMangledNames, assignExportsToNames } from './utils/exportNames';\nimport type { GenerateCodeSnippets } from './utils/generateCodeSnippets';\nimport getExportMode from './utils/getExportMode';\nimport { getId } from './utils/getId';\nimport getIndentString from './utils/getIndentString';\nimport { getOrCreate } from './utils/getOrCreate';\nimport { getStaticDependencies } from './utils/getStaticDependencies';\nimport { makeLegal } from './utils/identifierHelpers';\nimport {\n\tdefaultInteropHelpersByInteropType,\n\tHELPER_NAMES,\n\tisDefaultAProperty,\n\tnamespaceInteropHelpersByInteropType\n} from './utils/interopHelpers';\nimport { OutputBundleWithPlaceholders } from './utils/outputBundle';\nimport { dirname, extname, isAbsolute, normalize, resolve } from './utils/path';\nimport relativeId, { getAliasName, getImportPath } from './utils/relativeId';\nimport renderChunk from './utils/renderChunk';\nimport type { RenderOptions } from './utils/renderHelpers';\nimport { makeUnique, renderNamePattern } from './utils/renderNamePattern';\nimport { timeEnd, timeStart } from './utils/timers';\nimport { MISSING_EXPORT_SHIM_VARIABLE } from './utils/variableNames';\n\nexport interface ModuleDeclarations {\n\tdependencies: ModuleDeclarationDependency[];\n\texports: ChunkExports;\n}\n\nexport interface ModuleDeclarationDependency {\n\tdefaultVariableName: string | undefined;\n\tglobalName: string;\n\tid: string;\n\timports: ImportSpecifier[] | null;\n\tisChunk: boolean;\n\tname: string;\n\tnamedExportsMode: boolean;\n\tnamespaceVariableName: string | undefined;\n\treexports: ReexportSpecifier[] | null;\n}\n\nexport type ChunkDependencies = ModuleDeclarationDependency[];\n\nexport type ChunkExports = {\n\texported: string;\n\texpression: string | null;\n\thoisted: boolean;\n\tlocal: string;\n}[];\n\nexport interface ReexportSpecifier {\n\timported: string;\n\tneedsLiveBinding: boolean;\n\treexported: string;\n}\n\nexport interface ImportSpecifier {\n\timported: string;\n\tlocal: string;\n}\n\ninterface FacadeName {\n\tfileName?: string;\n\tname?: string;\n}\n\nconst NON_ASSET_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];\n\nfunction getGlobalName(\n\tmodule: ExternalModule,\n\tglobals: GlobalsOption,\n\thasExports: boolean,\n\twarn: WarningHandler\n): string | undefined {\n\tconst globalName = typeof globals === 'function' ? globals(module.id) : globals[module.id];\n\tif (globalName) {\n\t\treturn globalName;\n\t}\n\n\tif (hasExports) {\n\t\twarn({\n\t\t\tcode: 'MISSING_GLOBAL_NAME',\n\t\t\tguess: module.variableName,\n\t\t\tmessage: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`,\n\t\t\tsource: module.id\n\t\t});\n\t\treturn module.variableName;\n\t}\n}\n\nexport default class Chunk {\n\treadonly entryModules: Module[] = [];\n\texecIndex: number;\n\texportMode: 'none' | 'named' | 'default' = 'named';\n\tfacadeModule: Module | null = null;\n\tid: string | null = null;\n\tnamespaceVariableName = '';\n\tneedsExportsShim = false;\n\tsuggestedVariableName: string;\n\tvariableName = '';\n\n\tprivate readonly accessedGlobalsByScope = new Map>();\n\tprivate dependencies = new Set();\n\tprivate readonly dynamicDependencies = new Set();\n\tprivate readonly dynamicEntryModules: Module[] = [];\n\tprivate dynamicName: string | null = null;\n\tprivate readonly exportNamesByVariable = new Map();\n\tprivate readonly exports = new Set();\n\tprivate readonly exportsByName = new Map();\n\tprivate fileName: string | null = null;\n\tprivate implicitEntryModules: Module[] = [];\n\tprivate readonly implicitlyLoadedBefore = new Set();\n\tprivate readonly imports = new Set();\n\tprivate readonly includedReexportsByModule = new Map();\n\tprivate indentString: string = undefined as never;\n\t// This may only be updated in the constructor\n\tprivate readonly isEmpty: boolean = true;\n\tprivate name: string | null = null;\n\tprivate renderedDependencies: Map | null =\n\t\tnull;\n\tprivate renderedExports: ChunkExports | null = null;\n\tprivate renderedHash: string | undefined = undefined;\n\tprivate readonly renderedModuleSources = new Map();\n\tprivate readonly renderedModules: {\n\t\t[moduleId: string]: RenderedModule;\n\t} = Object.create(null);\n\tprivate renderedSource: MagicStringBundle | null = null;\n\tprivate sortedExportNames: string[] | null = null;\n\tprivate strictFacade = false;\n\tprivate usedModules: Module[] = undefined as never;\n\n\tconstructor(\n\t\tprivate readonly orderedModules: readonly Module[],\n\t\tprivate readonly inputOptions: NormalizedInputOptions,\n\t\tprivate readonly outputOptions: NormalizedOutputOptions,\n\t\tprivate readonly unsetOptions: ReadonlySet,\n\t\tprivate readonly pluginDriver: PluginDriver,\n\t\tprivate readonly modulesById: ReadonlyMap,\n\t\tprivate readonly chunkByModule: ReadonlyMap,\n\t\tprivate readonly facadeChunkByModule: Map,\n\t\tprivate readonly includedNamespaces: Set,\n\t\tprivate readonly manualChunkAlias: string | null\n\t) {\n\t\tthis.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;\n\t\tconst chunkModules = new Set(orderedModules);\n\n\t\tfor (const module of orderedModules) {\n\t\t\tif (module.namespace.included) {\n\t\t\t\tincludedNamespaces.add(module);\n\t\t\t}\n\t\t\tif (this.isEmpty && module.isIncluded()) {\n\t\t\t\tthis.isEmpty = false;\n\t\t\t}\n\t\t\tif (module.info.isEntry || outputOptions.preserveModules) {\n\t\t\t\tthis.entryModules.push(module);\n\t\t\t}\n\t\t\tfor (const importer of module.includedDynamicImporters) {\n\t\t\t\tif (!chunkModules.has(importer)) {\n\t\t\t\t\tthis.dynamicEntryModules.push(module);\n\t\t\t\t\t// Modules with synthetic exports need an artificial namespace for dynamic imports\n\t\t\t\t\tif (module.info.syntheticNamedExports && !outputOptions.preserveModules) {\n\t\t\t\t\t\tincludedNamespaces.add(module);\n\t\t\t\t\t\tthis.exports.add(module.namespace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (module.implicitlyLoadedAfter.size > 0) {\n\t\t\t\tthis.implicitEntryModules.push(module);\n\t\t\t}\n\t\t}\n\t\tthis.suggestedVariableName = makeLegal(this.generateVariableName());\n\t}\n\n\tprivate static generateFacade(\n\t\tinputOptions: NormalizedInputOptions,\n\t\toutputOptions: NormalizedOutputOptions,\n\t\tunsetOptions: ReadonlySet,\n\t\tpluginDriver: PluginDriver,\n\t\tmodulesById: ReadonlyMap,\n\t\tchunkByModule: ReadonlyMap,\n\t\tfacadeChunkByModule: Map,\n\t\tincludedNamespaces: Set,\n\t\tfacadedModule: Module,\n\t\tfacadeName: FacadeName\n\t): Chunk {\n\t\tconst chunk = new Chunk(\n\t\t\t[],\n\t\t\tinputOptions,\n\t\t\toutputOptions,\n\t\t\tunsetOptions,\n\t\t\tpluginDriver,\n\t\t\tmodulesById,\n\t\t\tchunkByModule,\n\t\t\tfacadeChunkByModule,\n\t\t\tincludedNamespaces,\n\t\t\tnull\n\t\t);\n\t\tchunk.assignFacadeName(facadeName, facadedModule);\n\t\tif (!facadeChunkByModule.has(facadedModule)) {\n\t\t\tfacadeChunkByModule.set(facadedModule, chunk);\n\t\t}\n\t\tfor (const dependency of facadedModule.getDependenciesToBeIncluded()) {\n\t\t\tchunk.dependencies.add(\n\t\t\t\tdependency instanceof Module ? chunkByModule.get(dependency)! : dependency\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t!chunk.dependencies.has(chunkByModule.get(facadedModule)!) &&\n\t\t\tfacadedModule.info.moduleSideEffects &&\n\t\t\tfacadedModule.hasEffects()\n\t\t) {\n\t\t\tchunk.dependencies.add(chunkByModule.get(facadedModule)!);\n\t\t}\n\t\tchunk.ensureReexportsAreAvailableForModule(facadedModule);\n\t\tchunk.facadeModule = facadedModule;\n\t\tchunk.strictFacade = true;\n\t\treturn chunk;\n\t}\n\n\tcanModuleBeFacade(module: Module, exposedVariables: ReadonlySet): boolean {\n\t\tconst moduleExportNamesByVariable = module.getExportNamesByVariable();\n\t\tfor (const exposedVariable of this.exports) {\n\t\t\tif (!moduleExportNamesByVariable.has(exposedVariable)) {\n\t\t\t\tif (\n\t\t\t\t\tmoduleExportNamesByVariable.size === 0 &&\n\t\t\t\t\tmodule.isUserDefinedEntryPoint &&\n\t\t\t\t\tmodule.preserveSignature === 'strict' &&\n\t\t\t\t\tthis.unsetOptions.has('preserveEntrySignatures')\n\t\t\t\t) {\n\t\t\t\t\tthis.inputOptions.onwarn({\n\t\t\t\t\t\tcode: 'EMPTY_FACADE',\n\t\t\t\t\t\tid: module.id,\n\t\t\t\t\t\tmessage: `To preserve the export signature of the entry module \"${relativeId(\n\t\t\t\t\t\t\tmodule.id\n\t\t\t\t\t\t)}\", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set \"preserveEntrySignatures: false\" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set \"preserveEntrySignatures: 'strict'\" explicitly to silence this warning.`,\n\t\t\t\t\t\turl: 'https://rollupjs.org/guide/en/#preserveentrysignatures'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tfor (const exposedVariable of exposedVariables) {\n\t\t\tif (\n\t\t\t\t!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tgenerateExports(): void {\n\t\tthis.sortedExportNames = null;\n\t\tconst remainingExports = new Set(this.exports);\n\t\tif (\n\t\t\tthis.facadeModule !== null &&\n\t\t\t(this.facadeModule.preserveSignature !== false || this.strictFacade)\n\t\t) {\n\t\t\tconst exportNamesByVariable = this.facadeModule.getExportNamesByVariable();\n\t\t\tfor (const [variable, exportNames] of exportNamesByVariable) {\n\t\t\t\tthis.exportNamesByVariable.set(variable, [...exportNames]);\n\t\t\t\tfor (const exportName of exportNames) {\n\t\t\t\t\tthis.exportsByName.set(exportName, variable);\n\t\t\t\t}\n\t\t\t\tremainingExports.delete(variable);\n\t\t\t}\n\t\t}\n\t\tif (this.outputOptions.minifyInternalExports) {\n\t\t\tassignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable);\n\t\t} else {\n\t\t\tassignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable);\n\t\t}\n\t\tif (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry))\n\t\t\tthis.exportMode = getExportMode(\n\t\t\t\tthis,\n\t\t\t\tthis.outputOptions,\n\t\t\t\tthis.unsetOptions,\n\t\t\t\tthis.facadeModule!.id,\n\t\t\t\tthis.inputOptions.onwarn\n\t\t\t);\n\t}\n\n\tgenerateFacades(): Chunk[] {\n\t\tconst facades: Chunk[] = [];\n\t\tconst entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]);\n\t\tconst exposedVariables = new Set(\n\t\t\tthis.dynamicEntryModules.map(({ namespace }) => namespace)\n\t\t);\n\t\tfor (const module of entryModules) {\n\t\t\tif (module.preserveSignature) {\n\t\t\t\tfor (const exportedVariable of module.getExportNamesByVariable().keys()) {\n\t\t\t\t\texposedVariables.add(exportedVariable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const module of entryModules) {\n\t\t\tconst requiredFacades: FacadeName[] = Array.from(\n\t\t\t\tnew Set(\n\t\t\t\t\tmodule.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)\n\t\t\t\t),\n\t\t\t\t// mapping must run after Set 'name' dedupe\n\t\t\t\tname => ({\n\t\t\t\t\tname\n\t\t\t\t})\n\t\t\t);\n\t\t\tif (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {\n\t\t\t\trequiredFacades.push({});\n\t\t\t}\n\t\t\trequiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));\n\t\t\tif (requiredFacades.length === 0) {\n\t\t\t\trequiredFacades.push({});\n\t\t\t}\n\t\t\tif (!this.facadeModule) {\n\t\t\t\tconst needsStrictFacade =\n\t\t\t\t\tmodule.preserveSignature === 'strict' ||\n\t\t\t\t\t(module.preserveSignature === 'exports-only' &&\n\t\t\t\t\t\tmodule.getExportNamesByVariable().size !== 0);\n\t\t\t\tif (\n\t\t\t\t\t!needsStrictFacade ||\n\t\t\t\t\tthis.outputOptions.preserveModules ||\n\t\t\t\t\tthis.canModuleBeFacade(module, exposedVariables)\n\t\t\t\t) {\n\t\t\t\t\tthis.facadeModule = module;\n\t\t\t\t\tthis.facadeChunkByModule.set(module, this);\n\t\t\t\t\tif (module.preserveSignature) {\n\t\t\t\t\t\tthis.strictFacade = needsStrictFacade;\n\t\t\t\t\t}\n\t\t\t\t\tthis.assignFacadeName(requiredFacades.shift()!, module);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const facadeName of requiredFacades) {\n\t\t\t\tfacades.push(\n\t\t\t\t\tChunk.generateFacade(\n\t\t\t\t\t\tthis.inputOptions,\n\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\tthis.unsetOptions,\n\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\tthis.modulesById,\n\t\t\t\t\t\tthis.chunkByModule,\n\t\t\t\t\t\tthis.facadeChunkByModule,\n\t\t\t\t\t\tthis.includedNamespaces,\n\t\t\t\t\t\tmodule,\n\t\t\t\t\t\tfacadeName\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tfor (const module of this.dynamicEntryModules) {\n\t\t\tif (module.info.syntheticNamedExports) continue;\n\t\t\tif (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {\n\t\t\t\tthis.facadeModule = module;\n\t\t\t\tthis.facadeChunkByModule.set(module, this);\n\t\t\t\tthis.strictFacade = true;\n\t\t\t\tthis.dynamicName = getChunkNameFromModule(module);\n\t\t\t} else if (\n\t\t\t\tthis.facadeModule === module &&\n\t\t\t\t!this.strictFacade &&\n\t\t\t\tthis.canModuleBeFacade(module, exposedVariables)\n\t\t\t) {\n\t\t\t\tthis.strictFacade = true;\n\t\t\t} else if (!this.facadeChunkByModule.get(module)?.strictFacade) {\n\t\t\t\tthis.includedNamespaces.add(module);\n\t\t\t\tthis.exports.add(module.namespace);\n\t\t\t}\n\t\t}\n\t\tif (!this.outputOptions.preserveModules) {\n\t\t\tthis.addNecessaryImportsForFacades();\n\t\t}\n\t\treturn facades;\n\t}\n\n\tgenerateId(\n\t\taddons: Addons,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tincludeHash: boolean\n\t): string {\n\t\tif (this.fileName !== null) {\n\t\t\treturn this.fileName;\n\t\t}\n\t\tconst [pattern, patternName] =\n\t\t\tthis.facadeModule && this.facadeModule.isUserDefinedEntryPoint\n\t\t\t\t? [options.entryFileNames, 'output.entryFileNames']\n\t\t\t\t: [options.chunkFileNames, 'output.chunkFileNames'];\n\t\treturn makeUnique(\n\t\t\trenderNamePattern(\n\t\t\t\ttypeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern,\n\t\t\t\tpatternName,\n\t\t\t\t{\n\t\t\t\t\tformat: () => options.format,\n\t\t\t\t\thash: () =>\n\t\t\t\t\t\tincludeHash\n\t\t\t\t\t\t\t? this.computeContentHashWithDependencies(addons, options, bundle)\n\t\t\t\t\t\t\t: '[hash]',\n\t\t\t\t\tname: () => this.getChunkName()\n\t\t\t\t}\n\t\t\t),\n\t\t\tbundle\n\t\t);\n\t}\n\n\tgenerateIdPreserveModules(\n\t\tpreserveModulesRelativeDir: string,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tunsetOptions: ReadonlySet\n\t): string {\n\t\tconst [{ id }] = this.orderedModules;\n\t\tconst sanitizedId = this.outputOptions.sanitizeFileName(id.split(QUERY_HASH_REGEX, 1)[0]);\n\t\tlet path: string;\n\n\t\tconst patternOpt = unsetOptions.has('entryFileNames')\n\t\t\t? '[name][assetExtname].js'\n\t\t\t: options.entryFileNames;\n\t\tconst pattern = typeof patternOpt === 'function' ? patternOpt(this.getChunkInfo()) : patternOpt;\n\n\t\tif (isAbsolute(sanitizedId)) {\n\t\t\tconst currentDir = dirname(sanitizedId);\n\t\t\tconst extension = extname(sanitizedId);\n\t\t\tconst fileName = renderNamePattern(pattern, 'output.entryFileNames', {\n\t\t\t\tassetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),\n\t\t\t\text: () => extension.substring(1),\n\t\t\t\textname: () => extension,\n\t\t\t\tformat: () => options.format as string,\n\t\t\t\tname: () => this.getChunkName()\n\t\t\t});\n\t\t\tconst currentPath = `${currentDir}/${fileName}`;\n\t\t\tconst { preserveModulesRoot } = options;\n\t\t\tif (preserveModulesRoot && resolve(currentPath).startsWith(preserveModulesRoot)) {\n\t\t\t\tpath = currentPath.slice(preserveModulesRoot.length).replace(/^[\\\\/]/, '');\n\t\t\t} else {\n\t\t\t\tpath = relative(preserveModulesRelativeDir, currentPath);\n\t\t\t}\n\t\t} else {\n\t\t\tconst extension = extname(sanitizedId);\n\t\t\tconst fileName = renderNamePattern(pattern, 'output.entryFileNames', {\n\t\t\t\tassetExtname: () => (NON_ASSET_EXTENSIONS.includes(extension) ? '' : extension),\n\t\t\t\text: () => extension.substring(1),\n\t\t\t\textname: () => extension,\n\t\t\t\tformat: () => options.format as string,\n\t\t\t\tname: () => getAliasName(sanitizedId)\n\t\t\t});\n\t\t\tpath = `_virtual/${fileName}`;\n\t\t}\n\t\treturn makeUnique(normalize(path), bundle);\n\t}\n\n\tgetChunkInfo(): PreRenderedChunk {\n\t\tconst facadeModule = this.facadeModule;\n\t\tconst getChunkName = this.getChunkName.bind(this);\n\t\treturn {\n\t\t\texports: this.getExportNames(),\n\t\t\tfacadeModuleId: facadeModule && facadeModule.id,\n\t\t\tisDynamicEntry: this.dynamicEntryModules.length > 0,\n\t\t\tisEntry: facadeModule !== null && facadeModule.info.isEntry,\n\t\t\tisImplicitEntry: this.implicitEntryModules.length > 0,\n\t\t\tmodules: this.renderedModules,\n\t\t\tget name() {\n\t\t\t\treturn getChunkName();\n\t\t\t},\n\t\t\ttype: 'chunk'\n\t\t};\n\t}\n\n\tgetChunkInfoWithFileNames(): RenderedChunk {\n\t\treturn Object.assign(this.getChunkInfo(), {\n\t\t\tcode: undefined,\n\t\t\tdynamicImports: Array.from(this.dynamicDependencies, getId),\n\t\t\tfileName: this.id!,\n\t\t\timplicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId),\n\t\t\timportedBindings: this.getImportedBindingsPerDependency(),\n\t\t\timports: Array.from(this.dependencies, getId),\n\t\t\tmap: undefined,\n\t\t\treferencedFiles: this.getReferencedFiles()\n\t\t});\n\t}\n\n\tgetChunkName(): string {\n\t\treturn (this.name ??= this.outputOptions.sanitizeFileName(this.getFallbackChunkName()));\n\t}\n\n\tgetExportNames(): string[] {\n\t\treturn (this.sortedExportNames ??= Array.from(this.exportsByName.keys()).sort());\n\t}\n\n\tgetRenderedHash(): string {\n\t\tif (this.renderedHash) return this.renderedHash;\n\t\tconst hash = createHash();\n\t\tconst hashAugmentation = this.pluginDriver.hookReduceValueSync(\n\t\t\t'augmentChunkHash',\n\t\t\t'',\n\t\t\t[this.getChunkInfo()],\n\t\t\t(augmentation, pluginHash) => {\n\t\t\t\tif (pluginHash) {\n\t\t\t\t\taugmentation += pluginHash;\n\t\t\t\t}\n\t\t\t\treturn augmentation;\n\t\t\t}\n\t\t);\n\t\thash.update(hashAugmentation);\n\t\thash.update(this.renderedSource!.toString());\n\t\thash.update(\n\t\t\tthis.getExportNames()\n\t\t\t\t.map(exportName => {\n\t\t\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\t\t\treturn `${relativeId((variable.module as Module).id).replace(/\\\\/g, '/')}:${\n\t\t\t\t\t\tvariable.name\n\t\t\t\t\t}:${exportName}`;\n\t\t\t\t})\n\t\t\t\t.join(',')\n\t\t);\n\t\treturn (this.renderedHash = hash.digest('hex'));\n\t}\n\n\tgetVariableExportName(variable: Variable): string {\n\t\tif (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) {\n\t\t\treturn '*';\n\t\t}\n\t\treturn this.exportNamesByVariable.get(variable)![0];\n\t}\n\n\tlink(): void {\n\t\tthis.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);\n\t\tfor (const module of this.orderedModules) {\n\t\t\tthis.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);\n\t\t\tthis.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);\n\t\t\tthis.setUpChunkImportsAndExportsForModule(module);\n\t\t}\n\t}\n\n\t// prerender allows chunk hashes and names to be generated before finalizing\n\tpreRender(\n\t\toptions: NormalizedOutputOptions,\n\t\tinputBase: string,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tconst { _, getPropertyAccess, n } = snippets;\n\t\tconst magicString = new MagicStringBundle({ separator: `${n}${n}` });\n\t\tthis.usedModules = [];\n\t\tthis.indentString = getIndentString(this.orderedModules, options);\n\n\t\tconst renderOptions: RenderOptions = {\n\t\t\tdynamicImportFunction: options.dynamicImportFunction,\n\t\t\texportNamesByVariable: this.exportNamesByVariable,\n\t\t\tformat: options.format,\n\t\t\tfreeze: options.freeze,\n\t\t\tindent: this.indentString,\n\t\t\tnamespaceToStringTag: options.namespaceToStringTag,\n\t\t\toutputPluginDriver: this.pluginDriver,\n\t\t\tsnippets\n\t\t};\n\n\t\t// for static and dynamic entry points, inline the execution list to avoid loading latency\n\t\tif (\n\t\t\toptions.hoistTransitiveImports &&\n\t\t\t!this.outputOptions.preserveModules &&\n\t\t\tthis.facadeModule !== null\n\t\t) {\n\t\t\tfor (const dep of this.dependencies) {\n\t\t\t\tif (dep instanceof Chunk) this.inlineChunkDependencies(dep);\n\t\t\t}\n\t\t}\n\n\t\tthis.prepareModulesForRendering(snippets);\n\t\tthis.setIdentifierRenderResolutions(options);\n\n\t\tlet hoistedSource = '';\n\t\tconst renderedModules = this.renderedModules;\n\n\t\tfor (const module of this.orderedModules) {\n\t\t\tlet renderedLength = 0;\n\t\t\tif (module.isIncluded() || this.includedNamespaces.has(module)) {\n\t\t\t\tconst source = module.render(renderOptions).trim();\n\t\t\t\trenderedLength = source.length();\n\t\t\t\tif (renderedLength) {\n\t\t\t\t\tif (options.compact && source.lastLine().includes('//')) source.append('\\n');\n\t\t\t\t\tthis.renderedModuleSources.set(module, source);\n\t\t\t\t\tmagicString.addSource(source);\n\t\t\t\t\tthis.usedModules.push(module);\n\t\t\t\t}\n\t\t\t\tconst namespace = module.namespace;\n\t\t\t\tif (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {\n\t\t\t\t\tconst rendered = namespace.renderBlock(renderOptions);\n\t\t\t\t\tif (namespace.renderFirst()) hoistedSource += n + rendered;\n\t\t\t\t\telse magicString.addSource(new MagicString(rendered));\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst { renderedExports, removedExports } = module.getRenderedExports();\n\t\t\tconst { renderedModuleSources } = this;\n\t\t\trenderedModules[module.id] = {\n\t\t\t\tget code() {\n\t\t\t\t\treturn renderedModuleSources.get(module)?.toString() ?? null;\n\t\t\t\t},\n\t\t\t\toriginalLength: module.originalCode.length,\n\t\t\t\tremovedExports,\n\t\t\t\trenderedExports,\n\t\t\t\trenderedLength\n\t\t\t};\n\t\t}\n\n\t\tif (hoistedSource) magicString.prepend(hoistedSource + n + n);\n\n\t\tif (this.needsExportsShim) {\n\t\t\tmagicString.prepend(\n\t\t\t\t`${n}${snippets.cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`\n\t\t\t);\n\t\t}\n\t\tif (options.compact) {\n\t\t\tthis.renderedSource = magicString;\n\t\t} else {\n\t\t\tthis.renderedSource = magicString.trim();\n\t\t}\n\n\t\tthis.renderedHash = undefined;\n\n\t\tif (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {\n\t\t\tconst chunkName = this.getChunkName();\n\t\t\tthis.inputOptions.onwarn({\n\t\t\t\tchunkName,\n\t\t\t\tcode: 'EMPTY_BUNDLE',\n\t\t\t\tmessage: `Generated an empty chunk: \"${chunkName}\"`\n\t\t\t});\n\t\t}\n\n\t\tthis.setExternalRenderPaths(options, inputBase);\n\n\t\tthis.renderedDependencies = this.getChunkDependencyDeclarations(options, getPropertyAccess);\n\t\tthis.renderedExports =\n\t\t\tthis.exportMode === 'none'\n\t\t\t\t? []\n\t\t\t\t: this.getChunkExportDeclarations(options.format, getPropertyAccess);\n\t}\n\n\tasync render(\n\t\toptions: NormalizedOutputOptions,\n\t\taddons: Addons,\n\t\toutputChunk: RenderedChunk,\n\t\tsnippets: GenerateCodeSnippets\n\t): Promise<{ code: string; map: SourceMap }> {\n\t\ttimeStart('render format', 2);\n\n\t\tconst format = options.format;\n\t\tconst finalise = finalisers[format];\n\t\tif (options.dynamicImportFunction && format !== 'es') {\n\t\t\tthis.inputOptions.onwarn(\n\t\t\t\terrInvalidOption(\n\t\t\t\t\t'output.dynamicImportFunction',\n\t\t\t\t\t'outputdynamicImportFunction',\n\t\t\t\t\t'this option is ignored for formats other than \"es\"'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// populate ids in the rendered declarations only here\n\t\t// as chunk ids known only after prerender\n\t\tfor (const dependency of this.dependencies) {\n\t\t\tconst renderedDependency = this.renderedDependencies!.get(dependency)!;\n\t\t\tif (dependency instanceof ExternalModule) {\n\t\t\t\tconst originalId = dependency.renderPath;\n\t\t\t\trenderedDependency.id = escapeId(\n\t\t\t\t\tdependency.renormalizeRenderPath\n\t\t\t\t\t\t? getImportPath(this.id!, originalId, false, false)\n\t\t\t\t\t\t: originalId\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\trenderedDependency.namedExportsMode = dependency.exportMode !== 'default';\n\t\t\t\trenderedDependency.id = escapeId(getImportPath(this.id!, dependency.id!, false, true));\n\t\t\t}\n\t\t}\n\n\t\tthis.finaliseDynamicImports(options, snippets);\n\t\tthis.finaliseImportMetas(format, snippets);\n\n\t\tconst hasExports =\n\t\t\tthis.renderedExports!.length !== 0 ||\n\t\t\t[...this.renderedDependencies!.values()].some(\n\t\t\t\tdep => (dep.reexports && dep.reexports.length !== 0)!\n\t\t\t);\n\n\t\tlet topLevelAwaitModule: string | null = null;\n\t\tconst accessedGlobals = new Set();\n\t\tfor (const module of this.orderedModules) {\n\t\t\tif (module.usesTopLevelAwait) {\n\t\t\t\ttopLevelAwaitModule = module.id;\n\t\t\t}\n\t\t\tconst accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope);\n\t\t\tif (accessedGlobalVariables) {\n\t\t\t\tfor (const name of accessedGlobalVariables) {\n\t\t\t\t\taccessedGlobals.add(name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (topLevelAwaitModule !== null && format !== 'es' && format !== 'system') {\n\t\t\treturn error({\n\t\t\t\tcode: 'INVALID_TLA_FORMAT',\n\t\t\t\tid: topLevelAwaitModule,\n\t\t\t\tmessage: `Module format ${format} does not support top-level await. Use the \"es\" or \"system\" output formats rather.`\n\t\t\t});\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\tif (!this.id) {\n\t\t\tthrow new Error('Internal Error: expecting chunk id');\n\t\t}\n\n\t\tconst magicString = finalise(\n\t\t\tthis.renderedSource!,\n\t\t\t{\n\t\t\t\taccessedGlobals,\n\t\t\t\tdependencies: [...this.renderedDependencies!.values()],\n\t\t\t\texports: this.renderedExports!,\n\t\t\t\thasExports,\n\t\t\t\tid: this.id,\n\t\t\t\tindent: this.indentString,\n\t\t\t\tintro: addons.intro,\n\t\t\t\tisEntryFacade:\n\t\t\t\t\tthis.outputOptions.preserveModules ||\n\t\t\t\t\t(this.facadeModule !== null && this.facadeModule.info.isEntry),\n\t\t\t\tisModuleFacade: this.facadeModule !== null,\n\t\t\t\tnamedExportsMode: this.exportMode !== 'default',\n\t\t\t\toutro: addons.outro,\n\t\t\t\tsnippets,\n\t\t\t\tusesTopLevelAwait: topLevelAwaitModule !== null,\n\t\t\t\twarn: this.inputOptions.onwarn\n\t\t\t},\n\t\t\toptions\n\t\t);\n\t\tif (addons.banner) magicString.prepend(addons.banner);\n\t\tif (addons.footer) magicString.append(addons.footer);\n\t\tconst prevCode = magicString.toString();\n\n\t\ttimeEnd('render format', 2);\n\n\t\tlet map: SourceMap = null as never;\n\t\tconst chunkSourcemapChain: DecodedSourceMapOrMissing[] = [];\n\n\t\tlet code = await renderChunk({\n\t\t\tcode: prevCode,\n\t\t\toptions,\n\t\t\toutputPluginDriver: this.pluginDriver,\n\t\t\trenderChunk: outputChunk,\n\t\t\tsourcemapChain: chunkSourcemapChain\n\t\t});\n\t\tif (options.sourcemap) {\n\t\t\ttimeStart('sourcemap', 2);\n\n\t\t\tlet file: string;\n\t\t\tif (options.file) file = resolve(options.sourcemapFile || options.file);\n\t\t\telse if (options.dir) file = resolve(options.dir, this.id);\n\t\t\telse file = resolve(this.id);\n\n\t\t\tconst decodedMap = magicString.generateDecodedMap({});\n\t\t\tmap = collapseSourcemaps(\n\t\t\t\tfile,\n\t\t\t\tdecodedMap,\n\t\t\t\tthis.usedModules,\n\t\t\t\tchunkSourcemapChain,\n\t\t\t\toptions.sourcemapExcludeSources,\n\t\t\t\tthis.inputOptions.onwarn\n\t\t\t);\n\t\t\tmap.sources = map.sources\n\t\t\t\t.map(sourcePath => {\n\t\t\t\t\tconst { sourcemapPathTransform } = options;\n\n\t\t\t\t\tif (sourcemapPathTransform) {\n\t\t\t\t\t\tconst newSourcePath = sourcemapPathTransform(sourcePath, `${file}.map`) as unknown;\n\n\t\t\t\t\t\tif (typeof newSourcePath !== 'string') {\n\t\t\t\t\t\t\terror(errFailedValidation(`sourcemapPathTransform function must return a string.`));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn newSourcePath;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn sourcePath;\n\t\t\t\t})\n\t\t\t\t.map(normalize);\n\n\t\t\ttimeEnd('sourcemap', 2);\n\t\t}\n\t\tif (!options.compact && code[code.length - 1] !== '\\n') code += '\\n';\n\t\treturn { code, map };\n\t}\n\n\tprivate addDependenciesToChunk(\n\t\tmoduleDependencies: ReadonlySet,\n\t\tchunkDependencies: Set\n\t): void {\n\t\tfor (const module of moduleDependencies) {\n\t\t\tif (module instanceof Module) {\n\t\t\t\tconst chunk = this.chunkByModule.get(module);\n\t\t\t\tif (chunk && chunk !== this) {\n\t\t\t\t\tchunkDependencies.add(chunk);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tchunkDependencies.add(module);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate addNecessaryImportsForFacades() {\n\t\tfor (const [module, variables] of this.includedReexportsByModule) {\n\t\t\tif (this.includedNamespaces.has(module)) {\n\t\t\t\tfor (const variable of variables) {\n\t\t\t\t\tthis.imports.add(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate assignFacadeName({ fileName, name }: FacadeName, facadedModule: Module): void {\n\t\tif (fileName) {\n\t\t\tthis.fileName = fileName;\n\t\t} else {\n\t\t\tthis.name = this.outputOptions.sanitizeFileName(\n\t\t\t\tname || getChunkNameFromModule(facadedModule)\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate checkCircularDependencyImport(variable: Variable, importingModule: Module): void {\n\t\tconst variableModule = variable.module;\n\t\tif (variableModule instanceof Module) {\n\t\t\tconst exportChunk = this.chunkByModule.get(variableModule);\n\t\t\tlet alternativeReexportModule;\n\t\t\tdo {\n\t\t\t\talternativeReexportModule = importingModule.alternativeReexportModules.get(variable);\n\t\t\t\tif (alternativeReexportModule) {\n\t\t\t\t\tconst exportingChunk = this.chunkByModule.get(alternativeReexportModule);\n\t\t\t\t\tif (exportingChunk && exportingChunk !== exportChunk) {\n\t\t\t\t\t\tthis.inputOptions.onwarn(\n\t\t\t\t\t\t\terrCyclicCrossChunkReexport(\n\t\t\t\t\t\t\t\tvariableModule.getExportNamesByVariable().get(variable)![0],\n\t\t\t\t\t\t\t\tvariableModule.id,\n\t\t\t\t\t\t\t\talternativeReexportModule.id,\n\t\t\t\t\t\t\t\timportingModule.id\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\timportingModule = alternativeReexportModule;\n\t\t\t\t}\n\t\t\t} while (alternativeReexportModule);\n\t\t}\n\t}\n\n\tprivate computeContentHashWithDependencies(\n\t\taddons: Addons,\n\t\toptions: NormalizedOutputOptions,\n\t\tbundle: OutputBundleWithPlaceholders\n\t): string {\n\t\tconst hash = createHash();\n\t\thash.update([addons.intro, addons.outro, addons.banner, addons.footer].join(':'));\n\t\thash.update(options.format);\n\t\tconst dependenciesForHashing = new Set([this]);\n\t\tfor (const current of dependenciesForHashing) {\n\t\t\tif (current instanceof ExternalModule) {\n\t\t\t\thash.update(`:${current.renderPath}`);\n\t\t\t} else {\n\t\t\t\thash.update(current.getRenderedHash());\n\t\t\t\thash.update(current.generateId(addons, options, bundle, false));\n\t\t\t}\n\t\t\tif (current instanceof ExternalModule) continue;\n\t\t\tfor (const dependency of [...current.dependencies, ...current.dynamicDependencies]) {\n\t\t\t\tdependenciesForHashing.add(dependency);\n\t\t\t}\n\t\t}\n\t\treturn hash.digest('hex').substr(0, 8);\n\t}\n\n\tprivate ensureReexportsAreAvailableForModule(module: Module): void {\n\t\tconst includedReexports: Variable[] = [];\n\t\tconst map = module.getExportNamesByVariable();\n\t\tfor (const exportedVariable of map.keys()) {\n\t\t\tconst isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;\n\t\t\tconst importedVariable = isSynthetic\n\t\t\t\t? (exportedVariable as SyntheticNamedExportVariable).getBaseVariable()\n\t\t\t\t: exportedVariable;\n\t\t\tif (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {\n\t\t\t\tthis.checkCircularDependencyImport(importedVariable, module);\n\t\t\t\tconst exportingModule = importedVariable.module;\n\t\t\t\tif (exportingModule instanceof Module) {\n\t\t\t\t\tconst chunk = this.chunkByModule.get(exportingModule);\n\t\t\t\t\tif (chunk && chunk !== this) {\n\t\t\t\t\t\tchunk.exports.add(importedVariable);\n\t\t\t\t\t\tincludedReexports.push(importedVariable);\n\t\t\t\t\t\tif (isSynthetic) {\n\t\t\t\t\t\t\tthis.imports.add(importedVariable);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (includedReexports.length) {\n\t\t\tthis.includedReexportsByModule.set(module, includedReexports);\n\t\t}\n\t}\n\n\tprivate finaliseDynamicImports(\n\t\toptions: NormalizedOutputOptions,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tconst stripKnownJsExtensions =\n\t\t\toptions.format === 'amd' && !options.amd.forceJsExtensionForImports;\n\t\tfor (const [module, code] of this.renderedModuleSources) {\n\t\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\t\tconst chunk = this.chunkByModule.get(resolution as Module);\n\t\t\t\tconst facadeChunk = this.facadeChunkByModule.get(resolution as Module);\n\t\t\t\tif (!resolution || !node.included || chunk === this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst renderedResolution =\n\t\t\t\t\tresolution instanceof Module\n\t\t\t\t\t\t? `'${escapeId(\n\t\t\t\t\t\t\t\tgetImportPath(this.id!, (facadeChunk || chunk!).id!, stripKnownJsExtensions, true)\n\t\t\t\t\t\t )}'`\n\t\t\t\t\t\t: resolution instanceof ExternalModule\n\t\t\t\t\t\t? `'${escapeId(\n\t\t\t\t\t\t\t\tresolution.renormalizeRenderPath\n\t\t\t\t\t\t\t\t\t? getImportPath(this.id!, resolution.renderPath, stripKnownJsExtensions, false)\n\t\t\t\t\t\t\t\t\t: resolution.renderPath\n\t\t\t\t\t\t )}'`\n\t\t\t\t\t\t: resolution;\n\t\t\t\tnode.renderFinalResolution(\n\t\t\t\t\tcode,\n\t\t\t\t\trenderedResolution,\n\t\t\t\t\tresolution instanceof Module &&\n\t\t\t\t\t\t!facadeChunk?.strictFacade &&\n\t\t\t\t\t\tchunk!.exportNamesByVariable.get(resolution.namespace)![0],\n\t\t\t\t\tsnippets\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate finaliseImportMetas(format: InternalModuleFormat, snippets: GenerateCodeSnippets): void {\n\t\tfor (const [module, code] of this.renderedModuleSources) {\n\t\t\tfor (const importMeta of module.importMetas) {\n\t\t\t\timportMeta.renderFinalMechanism(code, this.id!, format, snippets, this.pluginDriver);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate generateVariableName(): string {\n\t\tif (this.manualChunkAlias) {\n\t\t\treturn this.manualChunkAlias;\n\t\t}\n\t\tconst moduleForNaming =\n\t\t\tthis.entryModules[0] ||\n\t\t\tthis.implicitEntryModules[0] ||\n\t\t\tthis.dynamicEntryModules[0] ||\n\t\t\tthis.orderedModules[this.orderedModules.length - 1];\n\t\tif (moduleForNaming) {\n\t\t\treturn getChunkNameFromModule(moduleForNaming);\n\t\t}\n\t\treturn 'chunk';\n\t}\n\n\tprivate getChunkDependencyDeclarations(\n\t\toptions: NormalizedOutputOptions,\n\t\tgetPropertyAccess: (name: string) => string\n\t): Map {\n\t\tconst importSpecifiers = this.getImportSpecifiers(getPropertyAccess);\n\t\tconst reexportSpecifiers = this.getReexportSpecifiers();\n\t\tconst dependencyDeclaration = new Map();\n\t\tfor (const dep of this.dependencies) {\n\t\t\tconst imports = importSpecifiers.get(dep) || null;\n\t\t\tconst reexports = reexportSpecifiers.get(dep) || null;\n\t\t\tconst namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default';\n\n\t\t\tdependencyDeclaration.set(dep, {\n\t\t\t\tdefaultVariableName: (dep as ExternalModule).defaultVariableName,\n\t\t\t\tglobalName: (dep instanceof ExternalModule &&\n\t\t\t\t\t(options.format === 'umd' || options.format === 'iife') &&\n\t\t\t\t\tgetGlobalName(\n\t\t\t\t\t\tdep,\n\t\t\t\t\t\toptions.globals,\n\t\t\t\t\t\t(imports || reexports) !== null,\n\t\t\t\t\t\tthis.inputOptions.onwarn\n\t\t\t\t\t)) as string,\n\t\t\t\tid: undefined as never, // chunk id updated on render\n\t\t\t\timports,\n\t\t\t\tisChunk: dep instanceof Chunk,\n\t\t\t\tname: dep.variableName,\n\t\t\t\tnamedExportsMode,\n\t\t\t\tnamespaceVariableName: (dep as ExternalModule).namespaceVariableName,\n\t\t\t\treexports\n\t\t\t});\n\t\t}\n\n\t\treturn dependencyDeclaration;\n\t}\n\n\tprivate getChunkExportDeclarations(\n\t\tformat: InternalModuleFormat,\n\t\tgetPropertyAccess: (name: string) => string\n\t): ChunkExports {\n\t\tconst exports: ChunkExports = [];\n\t\tfor (const exportName of this.getExportNames()) {\n\t\t\tif (exportName[0] === '*') continue;\n\n\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\tif (!(variable instanceof SyntheticNamedExportVariable)) {\n\t\t\t\tconst module = variable.module;\n\t\t\t\tif (module && this.chunkByModule.get(module as Module) !== this) continue;\n\t\t\t}\n\t\t\tlet expression = null;\n\t\t\tlet hoisted = false;\n\t\t\tlet local = variable.getName(getPropertyAccess);\n\t\t\tif (variable instanceof LocalVariable) {\n\t\t\t\tfor (const declaration of variable.declarations) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tdeclaration.parent instanceof FunctionDeclaration ||\n\t\t\t\t\t\t(declaration instanceof ExportDefaultDeclaration &&\n\t\t\t\t\t\t\tdeclaration.declaration instanceof FunctionDeclaration)\n\t\t\t\t\t) {\n\t\t\t\t\t\thoisted = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\texpression = local;\n\t\t\t\tif (format === 'es') {\n\t\t\t\t\tlocal = variable.renderName!;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texports.push({\n\t\t\t\texported: exportName,\n\t\t\t\texpression,\n\t\t\t\thoisted,\n\t\t\t\tlocal\n\t\t\t});\n\t\t}\n\t\treturn exports;\n\t}\n\n\tprivate getDependenciesToBeDeconflicted(\n\t\taddNonNamespacesAndInteropHelpers: boolean,\n\t\taddDependenciesWithoutBindings: boolean,\n\t\tinterop: GetInterop\n\t): DependenciesToBeDeconflicted {\n\t\tconst dependencies = new Set();\n\t\tconst deconflictedDefault = new Set();\n\t\tconst deconflictedNamespace = new Set();\n\t\tfor (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) {\n\t\t\tif (addNonNamespacesAndInteropHelpers || variable.isNamespace) {\n\t\t\t\tconst module = variable.module!;\n\t\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\t\tdependencies.add(module);\n\t\t\t\t\tif (addNonNamespacesAndInteropHelpers) {\n\t\t\t\t\t\tif (variable.name === 'default') {\n\t\t\t\t\t\t\tif (defaultInteropHelpersByInteropType[String(interop(module.id))]) {\n\t\t\t\t\t\t\t\tdeconflictedDefault.add(module);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (variable.name === '*') {\n\t\t\t\t\t\t\tif (namespaceInteropHelpersByInteropType[String(interop(module.id))]) {\n\t\t\t\t\t\t\t\tdeconflictedNamespace.add(module);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst chunk = this.chunkByModule.get(module)!;\n\t\t\t\t\tif (chunk !== this) {\n\t\t\t\t\t\tdependencies.add(chunk);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\taddNonNamespacesAndInteropHelpers &&\n\t\t\t\t\t\t\tchunk.exportMode === 'default' &&\n\t\t\t\t\t\t\tvariable.isNamespace\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeconflictedNamespace.add(chunk);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (addDependenciesWithoutBindings) {\n\t\t\tfor (const dependency of this.dependencies) {\n\t\t\t\tdependencies.add(dependency);\n\t\t\t}\n\t\t}\n\t\treturn { deconflictedDefault, deconflictedNamespace, dependencies };\n\t}\n\n\tprivate getFallbackChunkName(): string {\n\t\tif (this.manualChunkAlias) {\n\t\t\treturn this.manualChunkAlias;\n\t\t}\n\t\tif (this.dynamicName) {\n\t\t\treturn this.dynamicName;\n\t\t}\n\t\tif (this.fileName) {\n\t\t\treturn getAliasName(this.fileName);\n\t\t}\n\t\treturn getAliasName(this.orderedModules[this.orderedModules.length - 1].id);\n\t}\n\n\tprivate getImportSpecifiers(\n\t\tgetPropertyAccess: (name: string) => string\n\t): Map {\n\t\tconst { interop } = this.outputOptions;\n\t\tconst importsByDependency = new Map();\n\t\tfor (const variable of this.imports) {\n\t\t\tconst module = variable.module!;\n\t\t\tlet dependency: Chunk | ExternalModule;\n\t\t\tlet imported: string;\n\t\t\tif (module instanceof ExternalModule) {\n\t\t\t\tdependency = module;\n\t\t\t\timported = variable.name;\n\t\t\t\tif (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {\n\t\t\t\t\treturn error(errUnexpectedNamedImport(module.id, imported, false));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdependency = this.chunkByModule.get(module)!;\n\t\t\t\timported = dependency.getVariableExportName(variable);\n\t\t\t}\n\t\t\tgetOrCreate(importsByDependency, dependency, () => []).push({\n\t\t\t\timported,\n\t\t\t\tlocal: variable.getName(getPropertyAccess)\n\t\t\t});\n\t\t}\n\t\treturn importsByDependency;\n\t}\n\n\tprivate getImportedBindingsPerDependency(): { [imported: string]: string[] } {\n\t\tconst importSpecifiers: { [imported: string]: string[] } = {};\n\t\tfor (const [dependency, declaration] of this.renderedDependencies!) {\n\t\t\tconst specifiers = new Set();\n\t\t\tif (declaration.imports) {\n\t\t\t\tfor (const { imported } of declaration.imports) {\n\t\t\t\t\tspecifiers.add(imported);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (declaration.reexports) {\n\t\t\t\tfor (const { imported } of declaration.reexports) {\n\t\t\t\t\tspecifiers.add(imported);\n\t\t\t\t}\n\t\t\t}\n\t\t\timportSpecifiers[dependency.id!] = [...specifiers];\n\t\t}\n\t\treturn importSpecifiers;\n\t}\n\n\tprivate getReexportSpecifiers(): Map {\n\t\tconst { externalLiveBindings, interop } = this.outputOptions;\n\t\tconst reexportSpecifiers = new Map();\n\t\tfor (let exportName of this.getExportNames()) {\n\t\t\tlet dependency: Chunk | ExternalModule;\n\t\t\tlet imported: string;\n\t\t\tlet needsLiveBinding = false;\n\t\t\tif (exportName[0] === '*') {\n\t\t\t\tconst id = exportName.substring(1);\n\t\t\t\tif (interop(id) === 'defaultOnly') {\n\t\t\t\t\tthis.inputOptions.onwarn(errUnexpectedNamespaceReexport(id));\n\t\t\t\t}\n\t\t\t\tneedsLiveBinding = externalLiveBindings;\n\t\t\t\tdependency = this.modulesById.get(id) as ExternalModule;\n\t\t\t\timported = exportName = '*';\n\t\t\t} else {\n\t\t\t\tconst variable = this.exportsByName.get(exportName)!;\n\t\t\t\tif (variable instanceof SyntheticNamedExportVariable) continue;\n\t\t\t\tconst module = variable.module!;\n\t\t\t\tif (module instanceof Module) {\n\t\t\t\t\tdependency = this.chunkByModule.get(module)!;\n\t\t\t\t\tif (dependency === this) continue;\n\t\t\t\t\timported = dependency.getVariableExportName(variable);\n\t\t\t\t\tneedsLiveBinding = variable.isReassigned;\n\t\t\t\t} else {\n\t\t\t\t\tdependency = module;\n\t\t\t\t\timported = variable.name;\n\t\t\t\t\tif (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {\n\t\t\t\t\t\treturn error(errUnexpectedNamedImport(module.id, imported, true));\n\t\t\t\t\t}\n\t\t\t\t\tneedsLiveBinding =\n\t\t\t\t\t\texternalLiveBindings &&\n\t\t\t\t\t\t(imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true));\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetOrCreate(reexportSpecifiers, dependency, () => []).push({\n\t\t\t\timported,\n\t\t\t\tneedsLiveBinding,\n\t\t\t\treexported: exportName\n\t\t\t});\n\t\t}\n\t\treturn reexportSpecifiers;\n\t}\n\n\tprivate getReferencedFiles(): string[] {\n\t\tconst referencedFiles: string[] = [];\n\t\tfor (const module of this.orderedModules) {\n\t\t\tfor (const meta of module.importMetas) {\n\t\t\t\tconst fileName = meta.getReferencedFileName(this.pluginDriver);\n\t\t\t\tif (fileName) {\n\t\t\t\t\treferencedFiles.push(fileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn referencedFiles;\n\t}\n\n\tprivate inlineChunkDependencies(chunk: Chunk): void {\n\t\tfor (const dep of chunk.dependencies) {\n\t\t\tif (this.dependencies.has(dep)) continue;\n\t\t\tthis.dependencies.add(dep);\n\t\t\tif (dep instanceof Chunk) {\n\t\t\t\tthis.inlineChunkDependencies(dep);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate prepareModulesForRendering(snippets: GenerateCodeSnippets): void {\n\t\tconst accessedGlobalsByScope = this.accessedGlobalsByScope;\n\t\tfor (const module of this.orderedModules) {\n\t\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\t\tif (node.included) {\n\t\t\t\t\tif (resolution instanceof Module) {\n\t\t\t\t\t\tconst chunk = this.chunkByModule.get(resolution);\n\t\t\t\t\t\tif (chunk === this) {\n\t\t\t\t\t\t\tnode.setInternalResolution(resolution.namespace);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnode.setExternalResolution(\n\t\t\t\t\t\t\t\tthis.facadeChunkByModule.get(resolution)?.exportMode || chunk!.exportMode,\n\t\t\t\t\t\t\t\tresolution,\n\t\t\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\t\t\tsnippets,\n\t\t\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\t\t\taccessedGlobalsByScope\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.setExternalResolution(\n\t\t\t\t\t\t\t'external',\n\t\t\t\t\t\t\tresolution,\n\t\t\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\t\t\tsnippets,\n\t\t\t\t\t\t\tthis.pluginDriver,\n\t\t\t\t\t\t\taccessedGlobalsByScope\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const importMeta of module.importMetas) {\n\t\t\t\timportMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope);\n\t\t\t}\n\t\t\tif (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {\n\t\t\t\tmodule.namespace.prepare(accessedGlobalsByScope);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setExternalRenderPaths(options: NormalizedOutputOptions, inputBase: string): void {\n\t\tfor (const dependency of [...this.dependencies, ...this.dynamicDependencies]) {\n\t\t\tif (dependency instanceof ExternalModule) {\n\t\t\t\tdependency.setRenderPath(options, inputBase);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setIdentifierRenderResolutions({\n\t\tformat,\n\t\tinterop,\n\t\tnamespaceToStringTag\n\t}: NormalizedOutputOptions) {\n\t\tconst syntheticExports = new Set();\n\t\tfor (const exportName of this.getExportNames()) {\n\t\t\tconst exportVariable = this.exportsByName.get(exportName)!;\n\t\t\tif (\n\t\t\t\tformat !== 'es' &&\n\t\t\t\tformat !== 'system' &&\n\t\t\t\texportVariable.isReassigned &&\n\t\t\t\t!exportVariable.isId\n\t\t\t) {\n\t\t\t\texportVariable.setRenderNames('exports', exportName);\n\t\t\t} else if (exportVariable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tsyntheticExports.add(exportVariable);\n\t\t\t} else {\n\t\t\t\texportVariable.setRenderNames(null, null);\n\t\t\t}\n\t\t}\n\t\tfor (const module of this.orderedModules) {\n\t\t\tif (module.needsExportShim) {\n\t\t\t\tthis.needsExportsShim = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tconst usedNames = new Set(['Object', 'Promise']);\n\t\tif (this.needsExportsShim) {\n\t\t\tusedNames.add(MISSING_EXPORT_SHIM_VARIABLE);\n\t\t}\n\t\tif (namespaceToStringTag) {\n\t\t\tusedNames.add('Symbol');\n\t\t}\n\t\tswitch (format) {\n\t\t\tcase 'system':\n\t\t\t\tusedNames.add('module').add('exports');\n\t\t\t\tbreak;\n\t\t\tcase 'es':\n\t\t\t\tbreak;\n\t\t\tcase 'cjs':\n\t\t\t\tusedNames.add('module').add('require').add('__filename').add('__dirname');\n\t\t\t// fallthrough\n\t\t\tdefault:\n\t\t\t\tusedNames.add('exports');\n\t\t\t\tfor (const helper of HELPER_NAMES) {\n\t\t\t\t\tusedNames.add(helper);\n\t\t\t\t}\n\t\t}\n\n\t\tdeconflictChunk(\n\t\t\tthis.orderedModules,\n\t\t\tthis.getDependenciesToBeDeconflicted(\n\t\t\t\tformat !== 'es' && format !== 'system',\n\t\t\t\tformat === 'amd' || format === 'umd' || format === 'iife',\n\t\t\t\tinterop\n\t\t\t),\n\t\t\tthis.imports,\n\t\t\tusedNames,\n\t\t\tformat,\n\t\t\tinterop,\n\t\t\tthis.outputOptions.preserveModules,\n\t\t\tthis.outputOptions.externalLiveBindings,\n\t\t\tthis.chunkByModule,\n\t\t\tsyntheticExports,\n\t\t\tthis.exportNamesByVariable,\n\t\t\tthis.accessedGlobalsByScope,\n\t\t\tthis.includedNamespaces\n\t\t);\n\t}\n\n\tprivate setUpChunkImportsAndExportsForModule(module: Module): void {\n\t\tconst moduleImports = new Set(module.includedImports);\n\t\t// when we are not preserving modules, we need to make all namespace variables available for\n\t\t// rendering the namespace object\n\t\tif (!this.outputOptions.preserveModules) {\n\t\t\tif (this.includedNamespaces.has(module)) {\n\t\t\t\tconst memberVariables = module.namespace.getMemberVariables();\n\t\t\t\tfor (const variable of Object.values(memberVariables)) {\n\t\t\t\t\tmoduleImports.add(variable);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (let variable of moduleImports) {\n\t\t\tif (variable instanceof ExportDefaultVariable) {\n\t\t\t\tvariable = variable.getOriginalVariable();\n\t\t\t}\n\t\t\tif (variable instanceof SyntheticNamedExportVariable) {\n\t\t\t\tvariable = variable.getBaseVariable();\n\t\t\t}\n\t\t\tconst chunk = this.chunkByModule.get(variable.module as Module);\n\t\t\tif (chunk !== this) {\n\t\t\t\tthis.imports.add(variable);\n\t\t\t\tif (\n\t\t\t\t\t!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) &&\n\t\t\t\t\tvariable.module instanceof Module\n\t\t\t\t) {\n\t\t\t\t\tchunk!.exports.add(variable);\n\t\t\t\t\tthis.checkCircularDependencyImport(variable, module);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tthis.includedNamespaces.has(module) ||\n\t\t\t(module.info.isEntry && module.preserveSignature !== false) ||\n\t\t\tmodule.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)\n\t\t) {\n\t\t\tthis.ensureReexportsAreAvailableForModule(module);\n\t\t}\n\t\tfor (const { node, resolution } of module.dynamicImports) {\n\t\t\tif (\n\t\t\t\tnode.included &&\n\t\t\t\tresolution instanceof Module &&\n\t\t\t\tthis.chunkByModule.get(resolution) === this &&\n\t\t\t\t!this.includedNamespaces.has(resolution)\n\t\t\t) {\n\t\t\t\tthis.includedNamespaces.add(resolution);\n\t\t\t\tthis.ensureReexportsAreAvailableForModule(resolution);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getChunkNameFromModule(module: Module): string {\n\treturn (\n\t\tmodule.chunkNames.find(({ isUserDefined }) => isUserDefined)?.name ??\n\t\tmodule.chunkNames[0]?.name ??\n\t\tgetAliasName(module.id)\n\t);\n}\n\nconst QUERY_HASH_REGEX = /[?#]/;\n","import type Variable from '../ast/variables/Variable';\nimport RESERVED_NAMES from './RESERVED_NAMES';\nimport { toBase64 } from './base64';\n\nexport function assignExportsToMangledNames(\n\texports: ReadonlySet,\n\texportsByName: Map,\n\texportNamesByVariable: Map\n): void {\n\tlet nameIndex = 0;\n\tfor (const variable of exports) {\n\t\tlet [exportName] = variable.name;\n\t\tif (exportsByName.has(exportName)) {\n\t\t\tdo {\n\t\t\t\texportName = toBase64(++nameIndex);\n\t\t\t\t// skip past leading number identifiers\n\t\t\t\tif (exportName.charCodeAt(0) === 49 /* '1' */) {\n\t\t\t\t\tnameIndex += 9 * 64 ** (exportName.length - 1);\n\t\t\t\t\texportName = toBase64(nameIndex);\n\t\t\t\t}\n\t\t\t} while (RESERVED_NAMES.has(exportName) || exportsByName.has(exportName));\n\t\t}\n\t\texportsByName.set(exportName, variable);\n\t\texportNamesByVariable.set(variable, [exportName]);\n\t}\n}\n\nexport function assignExportsToNames(\n\texports: ReadonlySet,\n\texportsByName: Map,\n\texportNamesByVariable: Map\n): void {\n\tfor (const variable of exports) {\n\t\tlet nameIndex = 0;\n\t\tlet exportName = variable.name;\n\t\twhile (exportsByName.has(exportName)) {\n\t\t\texportName = variable.name + '$' + ++nameIndex;\n\t\t}\n\t\texportsByName.set(exportName, variable);\n\t\texportNamesByVariable.set(variable, [exportName]);\n\t}\n}\n","import type {\n\tDecodedSourceMapOrMissing,\n\tNormalizedOutputOptions,\n\tPlugin,\n\tRenderedChunk,\n\tSourceMapInput\n} from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport { decodedSourcemap } from './decodedSourcemap';\n\nexport default function renderChunk({\n\tcode,\n\toptions,\n\toutputPluginDriver,\n\trenderChunk,\n\tsourcemapChain\n}: {\n\tcode: string;\n\toptions: NormalizedOutputOptions;\n\toutputPluginDriver: PluginDriver;\n\trenderChunk: RenderedChunk;\n\tsourcemapChain: DecodedSourceMapOrMissing[];\n}): Promise {\n\tconst renderChunkReducer = (\n\t\tcode: string,\n\t\tresult: { code: string; map?: SourceMapInput } | string | null | undefined,\n\t\tplugin: Plugin\n\t): string => {\n\t\tif (result == null) return code;\n\n\t\tif (typeof result === 'string')\n\t\t\tresult = {\n\t\t\t\tcode: result,\n\t\t\t\tmap: undefined\n\t\t\t};\n\n\t\t// strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning\n\t\tif (result.map !== null) {\n\t\t\tconst map = decodedSourcemap(result.map);\n\t\t\tsourcemapChain.push(map || { missing: true, plugin: plugin.name });\n\t\t}\n\n\t\treturn result.code;\n\t};\n\n\treturn outputPluginDriver.hookReduceArg0(\n\t\t'renderChunk',\n\t\t[code, renderChunk, options],\n\t\trenderChunkReducer\n\t);\n}\n","import type { NormalizedOutputOptions } from '../rollup/types';\nimport type { PluginDriver } from './PluginDriver';\nimport { error } from './error';\n\nexport interface Addons {\n\tbanner: string;\n\tfooter: string;\n\tintro: string;\n\toutro: string;\n}\n\nconst concatSep = (out: string, next: string) => (next ? `${out}\\n${next}` : out);\nconst concatDblSep = (out: string, next: string) => (next ? `${out}\\n\\n${next}` : out);\n\nexport async function createAddons(\n\toptions: NormalizedOutputOptions,\n\toutputPluginDriver: PluginDriver\n): Promise {\n\ttry {\n\t\tlet [banner, footer, intro, outro] = await Promise.all([\n\t\t\toutputPluginDriver.hookReduceValue('banner', options.banner(), [], concatSep),\n\t\t\toutputPluginDriver.hookReduceValue('footer', options.footer(), [], concatSep),\n\t\t\toutputPluginDriver.hookReduceValue('intro', options.intro(), [], concatDblSep),\n\t\t\toutputPluginDriver.hookReduceValue('outro', options.outro(), [], concatDblSep)\n\t\t]);\n\t\tif (intro) intro += '\\n\\n';\n\t\tif (outro) outro = `\\n\\n${outro}`;\n\t\tif (banner.length) banner += '\\n';\n\t\tif (footer.length) footer = '\\n' + footer;\n\n\t\treturn { banner, footer, intro, outro };\n\t} catch (err: any) {\n\t\treturn error({\n\t\t\tcode: 'ADDON_ERROR',\n\t\t\tmessage: `Could not retrieve ${err.hook}. Check configuration of plugin ${err.plugin}.\n\\tError Message: ${err.message}`\n\t\t});\n\t}\n}\n","import ExternalModule from '../ExternalModule';\nimport Module from '../Module';\nimport { getOrCreate } from './getOrCreate';\n\ntype DependentModuleMap = Map>;\ntype ChunkDefinitions = { alias: string | null; modules: Module[] }[];\n\nexport function getChunkAssignments(\n\tentryModules: readonly Module[],\n\tmanualChunkAliasByEntry: ReadonlyMap\n): ChunkDefinitions {\n\tconst chunkDefinitions: ChunkDefinitions = [];\n\tconst modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());\n\tconst manualChunkModulesByAlias: Record = Object.create(null);\n\tfor (const [entry, alias] of manualChunkAliasByEntry) {\n\t\tconst chunkModules = (manualChunkModulesByAlias[alias] =\n\t\t\tmanualChunkModulesByAlias[alias] || []);\n\t\taddStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);\n\t}\n\tfor (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {\n\t\tchunkDefinitions.push({ alias, modules });\n\t}\n\n\tconst assignedEntryPointsByModule: DependentModuleMap = new Map();\n\tconst { dependentEntryPointsByModule, dynamicEntryModules } = analyzeModuleGraph(entryModules);\n\tconst dynamicallyDependentEntryPointsByDynamicEntry: DependentModuleMap =\n\t\tgetDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules);\n\tconst staticEntries = new Set(entryModules);\n\n\tfunction assignEntryToStaticDependencies(\n\t\tentry: Module,\n\t\tdynamicDependentEntryPoints: ReadonlySet | null\n\t) {\n\t\tconst modulesToHandle = new Set([entry]);\n\t\tfor (const module of modulesToHandle) {\n\t\t\tconst assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());\n\t\t\tif (\n\t\t\t\tdynamicDependentEntryPoints &&\n\t\t\t\tareEntryPointsContainedOrDynamicallyDependent(\n\t\t\t\t\tdynamicDependentEntryPoints,\n\t\t\t\t\tdependentEntryPointsByModule.get(module)!\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tassignedEntryPoints.add(entry);\n\t\t\t}\n\t\t\tfor (const dependency of module.getDependenciesToBeIncluded()) {\n\t\t\t\tif (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {\n\t\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction areEntryPointsContainedOrDynamicallyDependent(\n\t\tentryPoints: ReadonlySet,\n\t\tcontainedIn: ReadonlySet\n\t): boolean {\n\t\tconst entriesToCheck = new Set(entryPoints);\n\t\tfor (const entry of entriesToCheck) {\n\t\t\tif (!containedIn.has(entry)) {\n\t\t\t\tif (staticEntries.has(entry)) return false;\n\t\t\t\tconst dynamicallyDependentEntryPoints =\n\t\t\t\t\tdynamicallyDependentEntryPointsByDynamicEntry.get(entry)!;\n\t\t\t\tfor (const dependentEntry of dynamicallyDependentEntryPoints) {\n\t\t\t\t\tentriesToCheck.add(dependentEntry);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tfor (const entry of entryModules) {\n\t\tif (!modulesInManualChunks.has(entry)) {\n\t\t\tassignEntryToStaticDependencies(entry, null);\n\t\t}\n\t}\n\n\tfor (const entry of dynamicEntryModules) {\n\t\tif (!modulesInManualChunks.has(entry)) {\n\t\t\tassignEntryToStaticDependencies(\n\t\t\t\tentry,\n\t\t\t\tdynamicallyDependentEntryPointsByDynamicEntry.get(entry)!\n\t\t\t);\n\t\t}\n\t}\n\n\tchunkDefinitions.push(\n\t\t...createChunks([...entryModules, ...dynamicEntryModules], assignedEntryPointsByModule)\n\t);\n\treturn chunkDefinitions;\n}\n\nfunction addStaticDependenciesToManualChunk(\n\tentry: Module,\n\tmanualChunkModules: Module[],\n\tmodulesInManualChunks: Set\n): void {\n\tconst modulesToHandle = new Set([entry]);\n\tfor (const module of modulesToHandle) {\n\t\tmodulesInManualChunks.add(module);\n\t\tmanualChunkModules.push(module);\n\t\tfor (const dependency of module.dependencies) {\n\t\t\tif (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {\n\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction analyzeModuleGraph(entryModules: readonly Module[]): {\n\tdependentEntryPointsByModule: DependentModuleMap;\n\tdynamicEntryModules: Set;\n} {\n\tconst dynamicEntryModules = new Set();\n\tconst dependentEntryPointsByModule: DependentModuleMap = new Map();\n\tconst entriesToHandle = new Set(entryModules);\n\tfor (const currentEntry of entriesToHandle) {\n\t\tconst modulesToHandle = new Set([currentEntry]);\n\t\tfor (const module of modulesToHandle) {\n\t\t\tgetOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);\n\t\t\tfor (const dependency of module.getDependenciesToBeIncluded()) {\n\t\t\t\tif (!(dependency instanceof ExternalModule)) {\n\t\t\t\t\tmodulesToHandle.add(dependency);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const { resolution } of module.dynamicImports) {\n\t\t\t\tif (resolution instanceof Module && resolution.includedDynamicImporters.length > 0) {\n\t\t\t\t\tdynamicEntryModules.add(resolution);\n\t\t\t\t\tentriesToHandle.add(resolution);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const dependency of module.implicitlyLoadedBefore) {\n\t\t\t\tdynamicEntryModules.add(dependency);\n\t\t\t\tentriesToHandle.add(dependency);\n\t\t\t}\n\t\t}\n\t}\n\treturn { dependentEntryPointsByModule, dynamicEntryModules };\n}\n\nfunction getDynamicDependentEntryPoints(\n\tdependentEntryPointsByModule: DependentModuleMap,\n\tdynamicEntryModules: ReadonlySet\n): DependentModuleMap {\n\tconst dynamicallyDependentEntryPointsByDynamicEntry: DependentModuleMap = new Map();\n\tfor (const dynamicEntry of dynamicEntryModules) {\n\t\tconst dynamicDependentEntryPoints = getOrCreate(\n\t\t\tdynamicallyDependentEntryPointsByDynamicEntry,\n\t\t\tdynamicEntry,\n\t\t\t() => new Set()\n\t\t);\n\t\tfor (const importer of [\n\t\t\t...dynamicEntry.includedDynamicImporters,\n\t\t\t...dynamicEntry.implicitlyLoadedAfter\n\t\t]) {\n\t\t\tfor (const entryPoint of dependentEntryPointsByModule.get(importer)!) {\n\t\t\t\tdynamicDependentEntryPoints.add(entryPoint);\n\t\t\t}\n\t\t}\n\t}\n\treturn dynamicallyDependentEntryPointsByDynamicEntry;\n}\n\nfunction createChunks(\n\tallEntryPoints: readonly Module[],\n\tassignedEntryPointsByModule: DependentModuleMap\n): ChunkDefinitions {\n\tconst chunkModules: { [chunkSignature: string]: Module[] } = Object.create(null);\n\tfor (const [module, assignedEntryPoints] of assignedEntryPointsByModule) {\n\t\tlet chunkSignature = '';\n\t\tfor (const entry of allEntryPoints) {\n\t\t\tchunkSignature += assignedEntryPoints.has(entry) ? 'X' : '_';\n\t\t}\n\t\tconst chunk = chunkModules[chunkSignature];\n\t\tif (chunk) {\n\t\t\tchunk.push(module);\n\t\t} else {\n\t\t\tchunkModules[chunkSignature] = [module];\n\t\t}\n\t}\n\treturn Object.values(chunkModules).map(modules => ({\n\t\talias: null,\n\t\tmodules\n\t}));\n}\n","import type ExternalModule from '../ExternalModule';\nimport Module from '../Module';\nimport relativeId from './relativeId';\n\ninterface OrderedExecutionUnit {\n\texecIndex: number;\n}\n\nconst compareExecIndex = (unitA: T, unitB: T) =>\n\tunitA.execIndex > unitB.execIndex ? 1 : -1;\n\nexport function sortByExecutionOrder(units: OrderedExecutionUnit[]): void {\n\tunits.sort(compareExecIndex);\n}\n\nexport function analyseModuleExecution(entryModules: readonly Module[]): {\n\tcyclePaths: string[][];\n\torderedModules: Module[];\n} {\n\tlet nextExecIndex = 0;\n\tconst cyclePaths: string[][] = [];\n\tconst analysedModules = new Set();\n\tconst dynamicImports = new Set();\n\tconst parents = new Map();\n\tconst orderedModules: Module[] = [];\n\n\tconst analyseModule = (module: Module | ExternalModule) => {\n\t\tif (module instanceof Module) {\n\t\t\tfor (const dependency of module.dependencies) {\n\t\t\t\tif (parents.has(dependency)) {\n\t\t\t\t\tif (!analysedModules.has(dependency)) {\n\t\t\t\t\t\tcyclePaths.push(getCyclePath(dependency as Module, module, parents));\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tparents.set(dependency, module);\n\t\t\t\tanalyseModule(dependency);\n\t\t\t}\n\n\t\t\tfor (const dependency of module.implicitlyLoadedBefore) {\n\t\t\t\tdynamicImports.add(dependency);\n\t\t\t}\n\t\t\tfor (const { resolution } of module.dynamicImports) {\n\t\t\t\tif (resolution instanceof Module) {\n\t\t\t\t\tdynamicImports.add(resolution);\n\t\t\t\t}\n\t\t\t}\n\t\t\torderedModules.push(module);\n\t\t}\n\n\t\tmodule.execIndex = nextExecIndex++;\n\t\tanalysedModules.add(module);\n\t};\n\n\tfor (const curEntry of entryModules) {\n\t\tif (!parents.has(curEntry)) {\n\t\t\tparents.set(curEntry, null);\n\t\t\tanalyseModule(curEntry);\n\t\t}\n\t}\n\tfor (const curEntry of dynamicImports) {\n\t\tif (!parents.has(curEntry)) {\n\t\t\tparents.set(curEntry, null);\n\t\t\tanalyseModule(curEntry);\n\t\t}\n\t}\n\n\treturn { cyclePaths, orderedModules };\n}\n\nfunction getCyclePath(\n\tmodule: Module,\n\tparent: Module,\n\tparents: ReadonlyMap\n): string[] {\n\tconst cycleSymbol = Symbol(module.id);\n\tconst path = [relativeId(module.id)];\n\tlet nextModule = parent;\n\tmodule.cycles.add(cycleSymbol);\n\twhile (nextModule !== module) {\n\t\tnextModule.cycles.add(cycleSymbol);\n\t\tpath.push(relativeId(nextModule.id));\n\t\tnextModule = parents.get(nextModule)!;\n\t}\n\tpath.push(path[0]);\n\tpath.reverse();\n\treturn path;\n}\n","import type { NormalizedOutputOptions } from '../rollup/types';\nimport RESERVED_NAMES from './RESERVED_NAMES';\n\nexport interface GenerateCodeSnippets {\n\t_: string;\n\tcnst: string;\n\tn: string;\n\ts: string;\n\tgetDirectReturnFunction(\n\t\tparams: string[],\n\t\toptions: {\n\t\t\tfunctionReturn: boolean;\n\t\t\tlineBreakIndent: { base: string; t: string } | null;\n\t\t\tname: string | null;\n\t\t}\n\t): [left: string, right: string];\n\tgetDirectReturnIifeLeft(\n\t\tparams: string[],\n\t\treturned: string,\n\t\toptions: {\n\t\t\tneedsArrowReturnParens: boolean | undefined;\n\t\t\tneedsWrappedFunction: boolean | undefined;\n\t\t}\n\t): string;\n\tgetFunctionIntro(params: string[], options: { isAsync: boolean; name: string | null }): string;\n\tgetNonArrowFunctionIntro(\n\t\tparams: string[],\n\t\toptions: { isAsync: boolean; name: string | null }\n\t): string;\n\tgetObject(\n\t\tfields: [key: string | null, value: string][],\n\t\toptions: { lineBreakIndent: { base: string; t: string } | null }\n\t): string;\n\tgetPropertyAccess(name: string): string;\n}\n\nexport function getGenerateCodeSnippets({\n\tcompact,\n\tgeneratedCode: { arrowFunctions, constBindings, objectShorthand, reservedNamesAsProps }\n}: NormalizedOutputOptions): GenerateCodeSnippets {\n\tconst { _, n, s } = compact ? { _: '', n: '', s: '' } : { _: ' ', n: '\\n', s: ';' };\n\tconst cnst = constBindings ? 'const' : 'var';\n\tconst getNonArrowFunctionIntro: GenerateCodeSnippets['getNonArrowFunctionIntro'] = (\n\t\tparams,\n\t\t{ isAsync, name }\n\t) =>\n\t\t`${isAsync ? `async ` : ''}function${name ? ` ${name}` : ''}${_}(${params.join(`,${_}`)})${_}`;\n\n\tconst getFunctionIntro: GenerateCodeSnippets['getFunctionIntro'] = arrowFunctions\n\t\t? (params, { isAsync, name }) => {\n\t\t\t\tconst singleParam = params.length === 1;\n\t\t\t\tconst asyncString = isAsync ? `async${singleParam ? ' ' : _}` : '';\n\t\t\t\treturn `${name ? `${cnst} ${name}${_}=${_}` : ''}${asyncString}${\n\t\t\t\t\tsingleParam ? params[0] : `(${params.join(`,${_}`)})`\n\t\t\t\t}${_}=>${_}`;\n\t\t }\n\t\t: getNonArrowFunctionIntro;\n\n\tconst getDirectReturnFunction: GenerateCodeSnippets['getDirectReturnFunction'] = (\n\t\tparams,\n\t\t{ functionReturn, lineBreakIndent, name }\n\t) => [\n\t\t`${getFunctionIntro(params, {\n\t\t\tisAsync: false,\n\t\t\tname\n\t\t})}${\n\t\t\tarrowFunctions\n\t\t\t\t? lineBreakIndent\n\t\t\t\t\t? `${n}${lineBreakIndent.base}${lineBreakIndent.t}`\n\t\t\t\t\t: ''\n\t\t\t\t: `{${lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _}${\n\t\t\t\t\t\tfunctionReturn ? 'return ' : ''\n\t\t\t\t }`\n\t\t}`,\n\t\tarrowFunctions\n\t\t\t? `${name ? ';' : ''}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : ''}`\n\t\t\t: `${s}${lineBreakIndent ? `${n}${lineBreakIndent.base}` : _}}`\n\t];\n\n\tconst isValidPropName = reservedNamesAsProps\n\t\t? (name: string): boolean => validPropName.test(name)\n\t\t: (name: string): boolean => !RESERVED_NAMES.has(name) && validPropName.test(name);\n\n\treturn {\n\t\t_,\n\t\tcnst,\n\t\tgetDirectReturnFunction,\n\t\tgetDirectReturnIifeLeft: (\n\t\t\tparams,\n\t\t\treturned,\n\t\t\t{ needsArrowReturnParens, needsWrappedFunction }\n\t\t) => {\n\t\t\tconst [left, right] = getDirectReturnFunction(params, {\n\t\t\t\tfunctionReturn: true,\n\t\t\t\tlineBreakIndent: null,\n\t\t\t\tname: null\n\t\t\t});\n\t\t\treturn `${wrapIfNeeded(\n\t\t\t\t`${left}${wrapIfNeeded(returned, arrowFunctions && needsArrowReturnParens)}${right}`,\n\t\t\t\tarrowFunctions || needsWrappedFunction\n\t\t\t)}(`;\n\t\t},\n\t\tgetFunctionIntro,\n\t\tgetNonArrowFunctionIntro,\n\t\tgetObject(fields, { lineBreakIndent }) {\n\t\t\tconst prefix = lineBreakIndent ? `${n}${lineBreakIndent.base}${lineBreakIndent.t}` : _;\n\t\t\treturn `{${fields\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tif (key === null) return `${prefix}${value}`;\n\t\t\t\t\tconst needsQuotes = !isValidPropName(key);\n\t\t\t\t\treturn key === value && objectShorthand && !needsQuotes\n\t\t\t\t\t\t? prefix + key\n\t\t\t\t\t\t: `${prefix}${needsQuotes ? `'${key}'` : key}:${_}${value}`;\n\t\t\t\t})\n\t\t\t\t.join(`,`)}${\n\t\t\t\tfields.length === 0 ? '' : lineBreakIndent ? `${n}${lineBreakIndent.base}` : _\n\t\t\t}}`;\n\t\t},\n\t\tgetPropertyAccess: (name: string): string =>\n\t\t\tisValidPropName(name) ? `.${name}` : `[${JSON.stringify(name)}]`,\n\t\tn,\n\t\ts\n\t};\n}\n\nconst wrapIfNeeded = (code: string, needsParens: boolean | undefined): string =>\n\tneedsParens ? `(${code})` : code;\n\nconst validPropName = /^(?!\\d)[\\w$]+$/;\n","import Chunk from './Chunk';\nimport type ExternalModule from './ExternalModule';\nimport type Graph from './Graph';\nimport Module from './Module';\nimport type {\n\tGetManualChunk,\n\tNormalizedInputOptions,\n\tNormalizedOutputOptions,\n\tOutputAsset,\n\tOutputBundle,\n\tOutputChunk,\n\tWarningHandler\n} from './rollup/types';\nimport type { PluginDriver } from './utils/PluginDriver';\nimport { type Addons, createAddons } from './utils/addons';\nimport { getChunkAssignments } from './utils/chunkAssignment';\nimport commondir from './utils/commondir';\nimport {\n\terrCannotAssignModuleToChunk,\n\terrChunkInvalid,\n\terrInvalidOption,\n\terror,\n\twarnDeprecation\n} from './utils/error';\nimport { sortByExecutionOrder } from './utils/executionOrder';\nimport { type GenerateCodeSnippets, getGenerateCodeSnippets } from './utils/generateCodeSnippets';\nimport {\n\tFILE_PLACEHOLDER,\n\tgetOutputBundle,\n\tOutputBundleWithPlaceholders\n} from './utils/outputBundle';\nimport { basename, isAbsolute } from './utils/path';\nimport { timeEnd, timeStart } from './utils/timers';\n\nexport default class Bundle {\n\tprivate readonly facadeChunkByModule = new Map();\n\tprivate readonly includedNamespaces = new Set();\n\n\tconstructor(\n\t\tprivate readonly outputOptions: NormalizedOutputOptions,\n\t\tprivate readonly unsetOptions: ReadonlySet,\n\t\tprivate readonly inputOptions: NormalizedInputOptions,\n\t\tprivate readonly pluginDriver: PluginDriver,\n\t\tprivate readonly graph: Graph\n\t) {}\n\n\tasync generate(isWrite: boolean): Promise {\n\t\ttimeStart('GENERATE', 1);\n\t\tconst outputBundleBase: OutputBundle = Object.create(null);\n\t\tconst outputBundle = getOutputBundle(outputBundleBase);\n\t\tthis.pluginDriver.setOutputBundle(outputBundle, this.outputOptions, this.facadeChunkByModule);\n\t\ttry {\n\t\t\tawait this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]);\n\n\t\t\ttimeStart('generate chunks', 2);\n\t\t\tconst chunks = await this.generateChunks();\n\t\t\tif (chunks.length > 1) {\n\t\t\t\tvalidateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn);\n\t\t\t}\n\t\t\tconst inputBase = commondir(getAbsoluteEntryModulePaths(chunks));\n\t\t\ttimeEnd('generate chunks', 2);\n\n\t\t\ttimeStart('render modules', 2);\n\n\t\t\t// We need to create addons before prerender because at the moment, there\n\t\t\t// can be no async code between prerender and render due to internal state\n\t\t\tconst addons = await createAddons(this.outputOptions, this.pluginDriver);\n\t\t\tconst snippets = getGenerateCodeSnippets(this.outputOptions);\n\t\t\tthis.prerenderChunks(chunks, inputBase, snippets);\n\t\t\ttimeEnd('render modules', 2);\n\n\t\t\tawait this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle, snippets);\n\t\t} catch (err: any) {\n\t\t\tawait this.pluginDriver.hookParallel('renderError', [err]);\n\t\t\tthrow err;\n\t\t}\n\t\tawait this.pluginDriver.hookSeq('generateBundle', [\n\t\t\tthis.outputOptions,\n\t\t\toutputBundle as OutputBundle,\n\t\t\tisWrite\n\t\t]);\n\t\tthis.finaliseAssets(outputBundle);\n\n\t\ttimeEnd('GENERATE', 1);\n\t\treturn outputBundleBase;\n\t}\n\n\tprivate async addFinalizedChunksToBundle(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\taddons: Addons,\n\t\tbundle: OutputBundleWithPlaceholders,\n\t\tsnippets: GenerateCodeSnippets\n\t): Promise {\n\t\tthis.assignChunkIds(chunks, inputBase, addons, bundle);\n\t\tfor (const chunk of chunks) {\n\t\t\tbundle[chunk.id!] = chunk.getChunkInfoWithFileNames() as OutputChunk;\n\t\t}\n\t\tawait Promise.all(\n\t\t\tchunks.map(async chunk => {\n\t\t\t\tconst outputChunk = bundle[chunk.id!] as OutputChunk;\n\t\t\t\tObject.assign(\n\t\t\t\t\toutputChunk,\n\t\t\t\t\tawait chunk.render(this.outputOptions, addons, outputChunk, snippets)\n\t\t\t\t);\n\t\t\t})\n\t\t);\n\t}\n\n\tprivate async addManualChunks(\n\t\tmanualChunks: Record\n\t): Promise> {\n\t\tconst manualChunkAliasByEntry = new Map();\n\t\tconst chunkEntries = await Promise.all(\n\t\t\tObject.entries(manualChunks).map(async ([alias, files]) => ({\n\t\t\t\talias,\n\t\t\t\tentries: await this.graph.moduleLoader.addAdditionalModules(files)\n\t\t\t}))\n\t\t);\n\t\tfor (const { alias, entries } of chunkEntries) {\n\t\t\tfor (const entry of entries) {\n\t\t\t\taddModuleToManualChunk(alias, entry, manualChunkAliasByEntry);\n\t\t\t}\n\t\t}\n\t\treturn manualChunkAliasByEntry;\n\t}\n\n\tprivate assignChunkIds(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\taddons: Addons,\n\t\tbundle: OutputBundleWithPlaceholders\n\t): void {\n\t\tconst entryChunks: Chunk[] = [];\n\t\tconst otherChunks: Chunk[] = [];\n\t\tfor (const chunk of chunks) {\n\t\t\t(chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint\n\t\t\t\t? entryChunks\n\t\t\t\t: otherChunks\n\t\t\t).push(chunk);\n\t\t}\n\n\t\t// make sure entry chunk names take precedence with regard to deconflicting\n\t\tconst chunksForNaming = entryChunks.concat(otherChunks);\n\t\tfor (const chunk of chunksForNaming) {\n\t\t\tif (this.outputOptions.file) {\n\t\t\t\tchunk.id = basename(this.outputOptions.file);\n\t\t\t} else if (this.outputOptions.preserveModules) {\n\t\t\t\tchunk.id = chunk.generateIdPreserveModules(\n\t\t\t\t\tinputBase,\n\t\t\t\t\tthis.outputOptions,\n\t\t\t\t\tbundle,\n\t\t\t\t\tthis.unsetOptions\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tchunk.id = chunk.generateId(addons, this.outputOptions, bundle, true);\n\t\t\t}\n\t\t\tbundle[chunk.id] = FILE_PLACEHOLDER;\n\t\t}\n\t}\n\n\tprivate assignManualChunks(getManualChunk: GetManualChunk): Map {\n\t\tconst manualChunkAliasesWithEntry: [alias: string, module: Module][] = [];\n\t\tconst manualChunksApi = {\n\t\t\tgetModuleIds: () => this.graph.modulesById.keys(),\n\t\t\tgetModuleInfo: this.graph.getModuleInfo\n\t\t};\n\t\tfor (const module of this.graph.modulesById.values()) {\n\t\t\tif (module instanceof Module) {\n\t\t\t\tconst manualChunkAlias = getManualChunk(module.id, manualChunksApi);\n\t\t\t\tif (typeof manualChunkAlias === 'string') {\n\t\t\t\t\tmanualChunkAliasesWithEntry.push([manualChunkAlias, module]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmanualChunkAliasesWithEntry.sort(([aliasA], [aliasB]) =>\n\t\t\taliasA > aliasB ? 1 : aliasA < aliasB ? -1 : 0\n\t\t);\n\t\tconst manualChunkAliasByEntry = new Map();\n\t\tfor (const [alias, module] of manualChunkAliasesWithEntry) {\n\t\t\taddModuleToManualChunk(alias, module, manualChunkAliasByEntry);\n\t\t}\n\t\treturn manualChunkAliasByEntry;\n\t}\n\n\tprivate finaliseAssets(outputBundle: OutputBundleWithPlaceholders): void {\n\t\tfor (const file of Object.values(outputBundle)) {\n\t\t\tif (!file.type) {\n\t\t\t\twarnDeprecation(\n\t\t\t\t\t'A plugin is directly adding properties to the bundle object in the \"generateBundle\" hook. This is deprecated and will be removed in a future Rollup version, please use \"this.emitFile\" instead.',\n\t\t\t\t\ttrue,\n\t\t\t\t\tthis.inputOptions\n\t\t\t\t);\n\t\t\t\t(file as OutputAsset).type = 'asset';\n\t\t\t}\n\t\t\tif (this.outputOptions.validate && 'code' in file) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.graph.contextParse(file.code, {\n\t\t\t\t\t\tallowHashBang: true,\n\t\t\t\t\t\tecmaVersion: 'latest'\n\t\t\t\t\t});\n\t\t\t\t} catch (err: any) {\n\t\t\t\t\tthis.inputOptions.onwarn(errChunkInvalid(file, err));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.pluginDriver.finaliseAssets();\n\t}\n\n\tprivate async generateChunks(): Promise {\n\t\tconst { manualChunks } = this.outputOptions;\n\t\tconst manualChunkAliasByEntry =\n\t\t\ttypeof manualChunks === 'object'\n\t\t\t\t? await this.addManualChunks(manualChunks)\n\t\t\t\t: this.assignManualChunks(manualChunks);\n\t\tconst chunks: Chunk[] = [];\n\t\tconst chunkByModule = new Map();\n\t\tfor (const { alias, modules } of this.outputOptions.inlineDynamicImports\n\t\t\t? [{ alias: null, modules: getIncludedModules(this.graph.modulesById) }]\n\t\t\t: this.outputOptions.preserveModules\n\t\t\t? getIncludedModules(this.graph.modulesById).map(module => ({\n\t\t\t\t\talias: null,\n\t\t\t\t\tmodules: [module]\n\t\t\t }))\n\t\t\t: getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {\n\t\t\tsortByExecutionOrder(modules);\n\t\t\tconst chunk = new Chunk(\n\t\t\t\tmodules,\n\t\t\t\tthis.inputOptions,\n\t\t\t\tthis.outputOptions,\n\t\t\t\tthis.unsetOptions,\n\t\t\t\tthis.pluginDriver,\n\t\t\t\tthis.graph.modulesById,\n\t\t\t\tchunkByModule,\n\t\t\t\tthis.facadeChunkByModule,\n\t\t\t\tthis.includedNamespaces,\n\t\t\t\talias\n\t\t\t);\n\t\t\tchunks.push(chunk);\n\t\t\tfor (const module of modules) {\n\t\t\t\tchunkByModule.set(module, chunk);\n\t\t\t}\n\t\t}\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.link();\n\t\t}\n\t\tconst facades: Chunk[] = [];\n\t\tfor (const chunk of chunks) {\n\t\t\tfacades.push(...chunk.generateFacades());\n\t\t}\n\t\treturn [...chunks, ...facades];\n\t}\n\n\tprivate prerenderChunks(\n\t\tchunks: readonly Chunk[],\n\t\tinputBase: string,\n\t\tsnippets: GenerateCodeSnippets\n\t): void {\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.generateExports();\n\t\t}\n\t\tfor (const chunk of chunks) {\n\t\t\tchunk.preRender(this.outputOptions, inputBase, snippets);\n\t\t}\n\t}\n}\n\nfunction getAbsoluteEntryModulePaths(chunks: readonly Chunk[]): string[] {\n\tconst absoluteEntryModulePaths: string[] = [];\n\tfor (const chunk of chunks) {\n\t\tfor (const entryModule of chunk.entryModules) {\n\t\t\tif (isAbsolute(entryModule.id)) {\n\t\t\t\tabsoluteEntryModulePaths.push(entryModule.id);\n\t\t\t}\n\t\t}\n\t}\n\treturn absoluteEntryModulePaths;\n}\n\nfunction validateOptionsForMultiChunkOutput(\n\toutputOptions: NormalizedOutputOptions,\n\tonWarn: WarningHandler\n) {\n\tif (outputOptions.format === 'umd' || outputOptions.format === 'iife')\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.format',\n\t\t\t\t'outputformat',\n\t\t\t\t'UMD and IIFE output formats are not supported for code-splitting builds',\n\t\t\t\toutputOptions.format\n\t\t\t)\n\t\t);\n\tif (typeof outputOptions.file === 'string')\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.file',\n\t\t\t\t'outputdir',\n\t\t\t\t'when building multiple chunks, the \"output.dir\" option must be used, not \"output.file\". To inline dynamic imports, set the \"inlineDynamicImports\" option'\n\t\t\t)\n\t\t);\n\tif (outputOptions.sourcemapFile)\n\t\treturn error(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.sourcemapFile',\n\t\t\t\t'outputsourcemapfile',\n\t\t\t\t'\"output.sourcemapFile\" is only supported for single-file builds'\n\t\t\t)\n\t\t);\n\tif (!outputOptions.amd.autoId && outputOptions.amd.id)\n\t\tonWarn(\n\t\t\terrInvalidOption(\n\t\t\t\t'output.amd.id',\n\t\t\t\t'outputamd',\n\t\t\t\t'this option is only properly supported for single-file builds. Use \"output.amd.autoId\" and \"output.amd.basePath\" instead'\n\t\t\t)\n\t\t);\n}\n\nfunction getIncludedModules(modulesById: ReadonlyMap): Module[] {\n\treturn [...modulesById.values()].filter(\n\t\t(module): module is Module =>\n\t\t\tmodule instanceof Module &&\n\t\t\t(module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0)\n\t);\n}\n\nfunction addModuleToManualChunk(\n\talias: string,\n\tmodule: Module,\n\tmanualChunkAliasByEntry: Map\n): void {\n\tconst existingAlias = manualChunkAliasByEntry.get(module);\n\tif (typeof existingAlias === 'string' && existingAlias !== alias) {\n\t\treturn error(errCannotAssignModuleToChunk(module.id, alias, existingAlias));\n\t}\n\tmanualChunkAliasByEntry.set(module, alias);\n}\n","import { dirname } from './path';\n\n// ported from https://github.com/substack/node-commondir\nexport default function commondir(files: readonly string[]): string {\n\tif (files.length === 0) return '/';\n\tif (files.length === 1) return dirname(files[0]);\n\tconst commonSegments = files.slice(1).reduce((commonSegments, file) => {\n\t\tconst pathSegements = file.split(/\\/+|\\\\+/);\n\t\tlet i;\n\t\tfor (\n\t\t\ti = 0;\n\t\t\tcommonSegments[i] === pathSegements[i] &&\n\t\t\ti < Math.min(commonSegments.length, pathSegements.length);\n\t\t\ti++\n\t\t);\n\t\treturn commonSegments.slice(0, i);\n\t}, files[0].split(/\\/+|\\\\+/));\n\n\t// Windows correctly handles paths with forward-slashes\n\treturn commonSegments.length > 1 ? commonSegments.join('/') : '/';\n}\n","// This file was generated. Do not modify manually!\nvar astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];\n\n// This file was generated. Do not modify manually!\nvar astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0898-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1ace\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\n// This file was generated. Do not modify manually!\nvar nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088e\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7ca\\ua7d0\\ua7d1\\ua7d3\\ua7d5-\\ua7d9\\ua7f2-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n\n// These are a run-length and offset encoded representation of the\n\n// Reserved word lists for various dialects of the language\n\nvar reservedWords = {\n 3: \"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile\",\n 5: \"class enum extends super const export import\",\n 6: \"enum\",\n strict: \"implements interface let package private protected public static yield\",\n strictBind: \"eval arguments\"\n};\n\n// And the keywords\n\nvar ecma5AndLessKeywords = \"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this\";\n\nvar keywords$1 = {\n 5: ecma5AndLessKeywords,\n \"5module\": ecma5AndLessKeywords + \" export import\",\n 6: ecma5AndLessKeywords + \" const class extends export import super\"\n};\n\nvar keywordRelationalOperator = /^in(stanceof)?$/;\n\n// ## Character categories\n\nvar nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\nvar nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code, set) {\n var pos = 0x10000;\n for (var i = 0; i < set.length; i += 2) {\n pos += set[i];\n if (pos > code) { return false }\n pos += set[i + 1];\n if (pos >= code) { return true }\n }\n}\n\n// Test whether a given character code starts an identifier.\n\nfunction isIdentifierStart(code, astral) {\n if (code < 65) { return code === 36 }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes)\n}\n\n// Test whether a given character is part of an identifier.\n\nfunction isIdentifierChar(code, astral) {\n if (code < 48) { return code === 36 }\n if (code < 58) { return true }\n if (code < 65) { return false }\n if (code < 91) { return true }\n if (code < 97) { return code === 95 }\n if (code < 123) { return true }\n if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }\n if (astral === false) { return false }\n return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)\n}\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n//\n// The `startsExpr` property is used to check if the token ends a\n// `yield` expression. It is set on all token types that either can\n// directly start an expression (like a quotation mark) or can\n// continue an expression (like the body of a string).\n//\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nvar TokenType = function TokenType(label, conf) {\n if ( conf === void 0 ) conf = {};\n\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop || null;\n this.updateContext = null;\n};\n\nfunction binop(name, prec) {\n return new TokenType(name, {beforeExpr: true, binop: prec})\n}\nvar beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};\n\n// Map keyword names to token types.\n\nvar keywords = {};\n\n// Succinct definitions of keyword token types\nfunction kw(name, options) {\n if ( options === void 0 ) options = {};\n\n options.keyword = name;\n return keywords[name] = new TokenType(name, options)\n}\n\nvar types$1 = {\n num: new TokenType(\"num\", startsExpr),\n regexp: new TokenType(\"regexp\", startsExpr),\n string: new TokenType(\"string\", startsExpr),\n name: new TokenType(\"name\", startsExpr),\n privateId: new TokenType(\"privateId\", startsExpr),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", {beforeExpr: true, startsExpr: true}),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", {beforeExpr: true, startsExpr: true}),\n braceR: new TokenType(\"}\"),\n parenL: new TokenType(\"(\", {beforeExpr: true, startsExpr: true}),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", beforeExpr),\n semi: new TokenType(\";\", beforeExpr),\n colon: new TokenType(\":\", beforeExpr),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", beforeExpr),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", beforeExpr),\n template: new TokenType(\"template\"),\n invalidTemplate: new TokenType(\"invalidTemplate\"),\n ellipsis: new TokenType(\"...\", beforeExpr),\n backQuote: new TokenType(\"`\", startsExpr),\n dollarBraceL: new TokenType(\"${\", {beforeExpr: true, startsExpr: true}),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", {beforeExpr: true, isAssign: true}),\n assign: new TokenType(\"_=\", {beforeExpr: true, isAssign: true}),\n incDec: new TokenType(\"++/--\", {prefix: true, postfix: true, startsExpr: true}),\n prefix: new TokenType(\"!/~\", {beforeExpr: true, prefix: true, startsExpr: true}),\n logicalOR: binop(\"||\", 1),\n logicalAND: binop(\"&&\", 2),\n bitwiseOR: binop(\"|\", 3),\n bitwiseXOR: binop(\"^\", 4),\n bitwiseAND: binop(\"&\", 5),\n equality: binop(\"==/!=/===/!==\", 6),\n relational: binop(\"/<=/>=\", 7),\n bitShift: binop(\"<>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),\n modulo: binop(\"%\", 10),\n star: binop(\"*\", 10),\n slash: binop(\"/\", 10),\n starstar: new TokenType(\"**\", {beforeExpr: true}),\n coalesce: binop(\"??\", 1),\n\n // Keyword token types.\n _break: kw(\"break\"),\n _case: kw(\"case\", beforeExpr),\n _catch: kw(\"catch\"),\n _continue: kw(\"continue\"),\n _debugger: kw(\"debugger\"),\n _default: kw(\"default\", beforeExpr),\n _do: kw(\"do\", {isLoop: true, beforeExpr: true}),\n _else: kw(\"else\", beforeExpr),\n _finally: kw(\"finally\"),\n _for: kw(\"for\", {isLoop: true}),\n _function: kw(\"function\", startsExpr),\n _if: kw(\"if\"),\n _return: kw(\"return\", beforeExpr),\n _switch: kw(\"switch\"),\n _throw: kw(\"throw\", beforeExpr),\n _try: kw(\"try\"),\n _var: kw(\"var\"),\n _const: kw(\"const\"),\n _while: kw(\"while\", {isLoop: true}),\n _with: kw(\"with\"),\n _new: kw(\"new\", {beforeExpr: true, startsExpr: true}),\n _this: kw(\"this\", startsExpr),\n _super: kw(\"super\", startsExpr),\n _class: kw(\"class\", startsExpr),\n _extends: kw(\"extends\", beforeExpr),\n _export: kw(\"export\"),\n _import: kw(\"import\", startsExpr),\n _null: kw(\"null\", startsExpr),\n _true: kw(\"true\", startsExpr),\n _false: kw(\"false\", startsExpr),\n _in: kw(\"in\", {beforeExpr: true, binop: 7}),\n _instanceof: kw(\"instanceof\", {beforeExpr: true, binop: 7}),\n _typeof: kw(\"typeof\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _void: kw(\"void\", {beforeExpr: true, prefix: true, startsExpr: true}),\n _delete: kw(\"delete\", {beforeExpr: true, prefix: true, startsExpr: true})\n};\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\nvar lineBreak = /\\r\\n?|\\n|\\u2028|\\u2029/;\nvar lineBreakG = new RegExp(lineBreak.source, \"g\");\n\nfunction isNewLine(code) {\n return code === 10 || code === 13 || code === 0x2028 || code === 0x2029\n}\n\nfunction nextLineBreak(code, from, end) {\n if ( end === void 0 ) end = code.length;\n\n for (var i = from; i < end; i++) {\n var next = code.charCodeAt(i);\n if (isNewLine(next))\n { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }\n }\n return -1\n}\n\nvar nonASCIIwhitespace = /[\\u1680\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/;\n\nvar skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nvar ref = Object.prototype;\nvar hasOwnProperty = ref.hasOwnProperty;\nvar toString = ref.toString;\n\nvar hasOwn = Object.hasOwn || (function (obj, propName) { return (\n hasOwnProperty.call(obj, propName)\n); });\n\nvar isArray = Array.isArray || (function (obj) { return (\n toString.call(obj) === \"[object Array]\"\n); });\n\nfunction wordsRegexp(words) {\n return new RegExp(\"^(?:\" + words.replace(/ /g, \"|\") + \")$\")\n}\n\nfunction codePointToString(code) {\n // UTF-16 Decoding\n if (code <= 0xFFFF) { return String.fromCharCode(code) }\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)\n}\n\nvar loneSurrogate = /(?:[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/;\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nvar Position = function Position(line, col) {\n this.line = line;\n this.column = col;\n};\n\nPosition.prototype.offset = function offset (n) {\n return new Position(this.line, this.column + n)\n};\n\nvar SourceLocation = function SourceLocation(p, start, end) {\n this.start = start;\n this.end = end;\n if (p.sourceFile !== null) { this.source = p.sourceFile; }\n};\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nfunction getLineInfo(input, offset) {\n for (var line = 1, cur = 0;;) {\n var nextBreak = nextLineBreak(input, cur, offset);\n if (nextBreak < 0) { return new Position(line, offset - cur) }\n ++line;\n cur = nextBreak;\n }\n}\n\n// A second argument must be given to configure the parser process.\n// These options are recognized (only `ecmaVersion` is required):\n\nvar defaultOptions = {\n // `ecmaVersion` indicates the ECMAScript version to parse. Must be\n // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10\n // (2019), 11 (2020), 12 (2021), 13 (2022), or `\"latest\"` (the\n // latest version the library supports). This influences support\n // for strict mode, the set of reserved words, and support for\n // new syntax features.\n ecmaVersion: null,\n // `sourceType` indicates the mode the code should be parsed in.\n // Can be either `\"script\"` or `\"module\"`. This influences global\n // strict mode and parsing of `import` and `export` declarations.\n sourceType: \"script\",\n // `onInsertedSemicolon` can be a callback that will be called\n // when a semicolon is automatically inserted. It will be passed\n // the position of the comma as an offset, and if `locations` is\n // enabled, it is given the location as a `{line, column}` object\n // as second argument.\n onInsertedSemicolon: null,\n // `onTrailingComma` is similar to `onInsertedSemicolon`, but for\n // trailing commas.\n onTrailingComma: null,\n // By default, reserved words are only enforced if ecmaVersion >= 5.\n // Set `allowReserved` to a boolean value to explicitly turn this on\n // an off. When this option has the value \"never\", reserved words\n // and keywords can also not be used as property names.\n allowReserved: null,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program, and an import.meta expression\n // in a script isn't considered an error.\n allowImportExportEverywhere: false,\n // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.\n // When enabled, await identifiers are allowed to appear at the top-level scope,\n // but they are still not allowed in non-async functions.\n allowAwaitOutsideFunction: null,\n // When enabled, super identifiers are not constrained to\n // appearing in methods and do not raise an error when they appear elsewhere.\n allowSuperOutsideMethod: null,\n // When enabled, hashbang directive in the beginning of file\n // is allowed and treated as a line comment.\n allowHashBang: false,\n // When `locations` is on, `loc` properties holding objects with\n // `start` and `end` properties in `{line, column}` form (with\n // line being 1-based and column 0-based) will be attached to the\n // nodes.\n locations: false,\n // A function can be passed as `onToken` option, which will\n // cause Acorn to call that function with object in the same\n // format as tokens returned from `tokenizer().getToken()`. Note\n // that you are not allowed to call the parser from the\n // callback—that will corrupt its internal state.\n onToken: null,\n // A function can be passed as `onComment` option, which will\n // cause Acorn to call that function with `(block, text, start,\n // end)` parameters whenever a comment is skipped. `block` is a\n // boolean indicating whether this is a block (`/* */`) comment,\n // `text` is the content of the comment, and `start` and `end` are\n // character offsets that denote the start and end of the comment.\n // When the `locations` option is on, two more parameters are\n // passed, the full `{line, column}` locations of the start and\n // end of the comments. Note that you are not allowed to call the\n // parser from the callback—that will corrupt its internal state.\n onComment: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // It is possible to parse multiple files into a single AST by\n // passing the tree produced by parsing the first file as\n // `program` option in subsequent parses. This will add the\n // toplevel forms of the parsed file to the `Program` (top) node\n // of an existing parse tree.\n program: null,\n // When `locations` is on, you can pass this to record the source\n // file in every node's `loc` object.\n sourceFile: null,\n // This value, if given, is stored in every node, whether\n // `locations` is on or off.\n directSourceFile: null,\n // When enabled, parenthesized expressions are represented by\n // (non-standard) ParenthesizedExpression nodes\n preserveParens: false\n};\n\n// Interpret and default an options object\n\nvar warnedAboutEcmaVersion = false;\n\nfunction getOptions(opts) {\n var options = {};\n\n for (var opt in defaultOptions)\n { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }\n\n if (options.ecmaVersion === \"latest\") {\n options.ecmaVersion = 1e8;\n } else if (options.ecmaVersion == null) {\n if (!warnedAboutEcmaVersion && typeof console === \"object\" && console.warn) {\n warnedAboutEcmaVersion = true;\n console.warn(\"Since Acorn 8.0.0, options.ecmaVersion is required.\\nDefaulting to 2020, but this will stop working in the future.\");\n }\n options.ecmaVersion = 11;\n } else if (options.ecmaVersion >= 2015) {\n options.ecmaVersion -= 2009;\n }\n\n if (options.allowReserved == null)\n { options.allowReserved = options.ecmaVersion < 5; }\n\n if (isArray(options.onToken)) {\n var tokens = options.onToken;\n options.onToken = function (token) { return tokens.push(token); };\n }\n if (isArray(options.onComment))\n { options.onComment = pushComment(options, options.onComment); }\n\n return options\n}\n\nfunction pushComment(options, array) {\n return function(block, text, start, end, startLoc, endLoc) {\n var comment = {\n type: block ? \"Block\" : \"Line\",\n value: text,\n start: start,\n end: end\n };\n if (options.locations)\n { comment.loc = new SourceLocation(this, startLoc, endLoc); }\n if (options.ranges)\n { comment.range = [start, end]; }\n array.push(comment);\n }\n}\n\n// Each scope gets a bitset that may contain these flags\nvar\n SCOPE_TOP = 1,\n SCOPE_FUNCTION = 2,\n SCOPE_ASYNC = 4,\n SCOPE_GENERATOR = 8,\n SCOPE_ARROW = 16,\n SCOPE_SIMPLE_CATCH = 32,\n SCOPE_SUPER = 64,\n SCOPE_DIRECT_SUPER = 128,\n SCOPE_CLASS_STATIC_BLOCK = 256,\n SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;\n\nfunction functionFlags(async, generator) {\n return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)\n}\n\n// Used in checkLVal* and declareName to determine the type of a binding\nvar\n BIND_NONE = 0, // Not a binding\n BIND_VAR = 1, // Var-style binding\n BIND_LEXICAL = 2, // Let- or const-style binding\n BIND_FUNCTION = 3, // Function declaration\n BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding\n BIND_OUTSIDE = 5; // Special case for function names as bound inside the function\n\nvar Parser = function Parser(options, input, startPos) {\n this.options = options = getOptions(options);\n this.sourceFile = options.sourceFile;\n this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === \"module\" ? \"5module\" : 5]);\n var reserved = \"\";\n if (options.allowReserved !== true) {\n reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];\n if (options.sourceType === \"module\") { reserved += \" await\"; }\n }\n this.reservedWords = wordsRegexp(reserved);\n var reservedStrict = (reserved ? reserved + \" \" : \"\") + reservedWords.strict;\n this.reservedWordsStrict = wordsRegexp(reservedStrict);\n this.reservedWordsStrictBind = wordsRegexp(reservedStrict + \" \" + reservedWords.strictBind);\n this.input = String(input);\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n this.containsEsc = false;\n\n // Set up token state\n\n // The current position of the tokenizer in the input.\n if (startPos) {\n this.pos = startPos;\n this.lineStart = this.input.lastIndexOf(\"\\n\", startPos - 1) + 1;\n this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;\n } else {\n this.pos = this.lineStart = 0;\n this.curLine = 1;\n }\n\n // Properties of the current token:\n // Its type\n this.type = types$1.eof;\n // For tokens that include more information than their type, the value\n this.value = null;\n // Its start and end offset\n this.start = this.end = this.pos;\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n this.startLoc = this.endLoc = this.curPosition();\n\n // Position information for the previous token\n this.lastTokEndLoc = this.lastTokStartLoc = null;\n this.lastTokStart = this.lastTokEnd = this.pos;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n this.context = this.initialContext();\n this.exprAllowed = true;\n\n // Figure out if it's a module code.\n this.inModule = options.sourceType === \"module\";\n this.strict = this.inModule || this.strictDirective(this.pos);\n\n // Used to signify the start of a potential arrow function\n this.potentialArrowAt = -1;\n this.potentialArrowInForAwait = false;\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;\n // Labels in scope.\n this.labels = [];\n // Thus-far undefined exports.\n this.undefinedExports = Object.create(null);\n\n // If enabled, skip leading hashbang line.\n if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === \"#!\")\n { this.skipLineComment(2); }\n\n // Scope tracking for duplicate variable names (see scope.js)\n this.scopeStack = [];\n this.enterScope(SCOPE_TOP);\n\n // For RegExp validation\n this.regexpState = null;\n\n // The stack of private names.\n // Each element has two properties: 'declared' and 'used'.\n // When it exited from the outermost class definition, all used private names must be declared.\n this.privateNameStack = [];\n};\n\nvar prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },inClassStaticBlock: { configurable: true } };\n\nParser.prototype.parse = function parse () {\n var node = this.options.program || this.startNode();\n this.nextToken();\n return this.parseTopLevel(node)\n};\n\nprototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };\n\nprototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit };\n\nprototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit };\n\nprototypeAccessors.canAwait.get = function () {\n for (var i = this.scopeStack.length - 1; i >= 0; i--) {\n var scope = this.scopeStack[i];\n if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) { return false }\n if (scope.flags & SCOPE_FUNCTION) { return (scope.flags & SCOPE_ASYNC) > 0 }\n }\n return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction\n};\n\nprototypeAccessors.allowSuper.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n var inClassFieldInit = ref.inClassFieldInit;\n return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod\n};\n\nprototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };\n\nprototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };\n\nprototypeAccessors.allowNewDotTarget.get = function () {\n var ref = this.currentThisScope();\n var flags = ref.flags;\n var inClassFieldInit = ref.inClassFieldInit;\n return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit\n};\n\nprototypeAccessors.inClassStaticBlock.get = function () {\n return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0\n};\n\nParser.extend = function extend () {\n var plugins = [], len = arguments.length;\n while ( len-- ) plugins[ len ] = arguments[ len ];\n\n var cls = this;\n for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }\n return cls\n};\n\nParser.parse = function parse (input, options) {\n return new this(options, input).parse()\n};\n\nParser.parseExpressionAt = function parseExpressionAt (input, pos, options) {\n var parser = new this(options, input, pos);\n parser.nextToken();\n return parser.parseExpression()\n};\n\nParser.tokenizer = function tokenizer (input, options) {\n return new this(options, input)\n};\n\nObject.defineProperties( Parser.prototype, prototypeAccessors );\n\nvar pp$9 = Parser.prototype;\n\n// ## Parser utilities\n\nvar literal = /^(?:'((?:\\\\.|[^'\\\\])*?)'|\"((?:\\\\.|[^\"\\\\])*?)\")/;\npp$9.strictDirective = function(start) {\n if (this.options.ecmaVersion < 5) { return false }\n for (;;) {\n // Try to find string literal.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n var match = literal.exec(this.input.slice(start));\n if (!match) { return false }\n if ((match[1] || match[2]) === \"use strict\") {\n skipWhiteSpace.lastIndex = start + match[0].length;\n var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;\n var next = this.input.charAt(end);\n return next === \";\" || next === \"}\" ||\n (lineBreak.test(spaceAfter[0]) &&\n !(/[(`.[+\\-/*%<>=,?^&]/.test(next) || next === \"!\" && this.input.charAt(end + 1) === \"=\"))\n }\n start += match[0].length;\n\n // Skip semicolon, if any.\n skipWhiteSpace.lastIndex = start;\n start += skipWhiteSpace.exec(this.input)[0].length;\n if (this.input[start] === \";\")\n { start++; }\n }\n};\n\n// Predicate that tests whether the next token is of the given\n// type, and if yes, consumes it as a side effect.\n\npp$9.eat = function(type) {\n if (this.type === type) {\n this.next();\n return true\n } else {\n return false\n }\n};\n\n// Tests whether parsed token is a contextual keyword.\n\npp$9.isContextual = function(name) {\n return this.type === types$1.name && this.value === name && !this.containsEsc\n};\n\n// Consumes contextual keyword if possible.\n\npp$9.eatContextual = function(name) {\n if (!this.isContextual(name)) { return false }\n this.next();\n return true\n};\n\n// Asserts that following token is given contextual keyword.\n\npp$9.expectContextual = function(name) {\n if (!this.eatContextual(name)) { this.unexpected(); }\n};\n\n// Test whether a semicolon can be inserted at the current position.\n\npp$9.canInsertSemicolon = function() {\n return this.type === types$1.eof ||\n this.type === types$1.braceR ||\n lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\npp$9.insertSemicolon = function() {\n if (this.canInsertSemicolon()) {\n if (this.options.onInsertedSemicolon)\n { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }\n return true\n }\n};\n\n// Consume a semicolon, or, failing that, see if we are allowed to\n// pretend that there is a semicolon at this position.\n\npp$9.semicolon = function() {\n if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }\n};\n\npp$9.afterTrailingComma = function(tokType, notNext) {\n if (this.type === tokType) {\n if (this.options.onTrailingComma)\n { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }\n if (!notNext)\n { this.next(); }\n return true\n }\n};\n\n// Expect a token of a given type. If found, consume it, otherwise,\n// raise an unexpected token error.\n\npp$9.expect = function(type) {\n this.eat(type) || this.unexpected();\n};\n\n// Raise an unexpected token error.\n\npp$9.unexpected = function(pos) {\n this.raise(pos != null ? pos : this.start, \"Unexpected token\");\n};\n\nvar DestructuringErrors = function DestructuringErrors() {\n this.shorthandAssign =\n this.trailingComma =\n this.parenthesizedAssign =\n this.parenthesizedBind =\n this.doubleProto =\n -1;\n};\n\npp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {\n if (!refDestructuringErrors) { return }\n if (refDestructuringErrors.trailingComma > -1)\n { this.raiseRecoverable(refDestructuringErrors.trailingComma, \"Comma is not permitted after the rest element\"); }\n var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;\n if (parens > -1) { this.raiseRecoverable(parens, \"Parenthesized pattern\"); }\n};\n\npp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {\n if (!refDestructuringErrors) { return false }\n var shorthandAssign = refDestructuringErrors.shorthandAssign;\n var doubleProto = refDestructuringErrors.doubleProto;\n if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }\n if (shorthandAssign >= 0)\n { this.raise(shorthandAssign, \"Shorthand property assignments are valid only in destructuring patterns\"); }\n if (doubleProto >= 0)\n { this.raiseRecoverable(doubleProto, \"Redefinition of __proto__ property\"); }\n};\n\npp$9.checkYieldAwaitInDefaultParams = function() {\n if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))\n { this.raise(this.yieldPos, \"Yield expression cannot be a default value\"); }\n if (this.awaitPos)\n { this.raise(this.awaitPos, \"Await expression cannot be a default value\"); }\n};\n\npp$9.isSimpleAssignTarget = function(expr) {\n if (expr.type === \"ParenthesizedExpression\")\n { return this.isSimpleAssignTarget(expr.expression) }\n return expr.type === \"Identifier\" || expr.type === \"MemberExpression\"\n};\n\nvar pp$8 = Parser.prototype;\n\n// ### Statement parsing\n\n// Parse a program. Initializes the parser, reads any number of\n// statements, and wraps them in a Program node. Optionally takes a\n// `program` argument. If present, the statements will be appended\n// to its body instead of creating a new node.\n\npp$8.parseTopLevel = function(node) {\n var exports = Object.create(null);\n if (!node.body) { node.body = []; }\n while (this.type !== types$1.eof) {\n var stmt = this.parseStatement(null, true, exports);\n node.body.push(stmt);\n }\n if (this.inModule)\n { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)\n {\n var name = list[i];\n\n this.raiseRecoverable(this.undefinedExports[name].start, (\"Export '\" + name + \"' is not defined\"));\n } }\n this.adaptDirectivePrologue(node.body);\n this.next();\n node.sourceType = this.options.sourceType;\n return this.finishNode(node, \"Program\")\n};\n\nvar loopLabel = {kind: \"loop\"}, switchLabel = {kind: \"switch\"};\n\npp$8.isLet = function(context) {\n if (this.options.ecmaVersion < 6 || !this.isContextual(\"let\")) { return false }\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n // For ambiguous cases, determine if a LexicalDeclaration (or only a\n // Statement) is allowed here. If context is not empty then only a Statement\n // is allowed. However, `let [` is an explicit negative lookahead for\n // ExpressionStatement, so special-case it first.\n if (nextCh === 91 || nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral\n if (context) { return false }\n\n if (nextCh === 123) { return true } // '{'\n if (isIdentifierStart(nextCh, true)) {\n var pos = next + 1;\n while (isIdentifierChar(nextCh = this.input.charCodeAt(pos), true)) { ++pos; }\n if (nextCh === 92 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true }\n var ident = this.input.slice(next, pos);\n if (!keywordRelationalOperator.test(ident)) { return true }\n }\n return false\n};\n\n// check 'async [no LineTerminator here] function'\n// - 'async /*foo*/ function' is OK.\n// - 'async /*\\n*/ function' is invalid.\npp$8.isAsyncFunction = function() {\n if (this.options.ecmaVersion < 8 || !this.isContextual(\"async\"))\n { return false }\n\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, after;\n return !lineBreak.test(this.input.slice(this.pos, next)) &&\n this.input.slice(next, next + 8) === \"function\" &&\n (next + 8 === this.input.length ||\n !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 0xd7ff && after < 0xdc00))\n};\n\n// Parse a single statement.\n//\n// If expecting a statement and finding a slash operator, parse a\n// regular expression literal. This is to handle cases like\n// `if (foo) /blah/.exec(foo)`, where looking at the previous token\n// does not help.\n\npp$8.parseStatement = function(context, topLevel, exports) {\n var starttype = this.type, node = this.startNode(), kind;\n\n if (this.isLet(context)) {\n starttype = types$1._var;\n kind = \"let\";\n }\n\n // Most types of statements are recognized by the keyword they\n // start with. Many are trivial to parse, some require a bit of\n // complexity.\n\n switch (starttype) {\n case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)\n case types$1._debugger: return this.parseDebuggerStatement(node)\n case types$1._do: return this.parseDoStatement(node)\n case types$1._for: return this.parseForStatement(node)\n case types$1._function:\n // Function as sole body of either an if statement or a labeled statement\n // works, but not when it is part of a labeled statement that is the sole\n // body of an if statement.\n if ((context && (this.strict || context !== \"if\" && context !== \"label\")) && this.options.ecmaVersion >= 6) { this.unexpected(); }\n return this.parseFunctionStatement(node, false, !context)\n case types$1._class:\n if (context) { this.unexpected(); }\n return this.parseClass(node, true)\n case types$1._if: return this.parseIfStatement(node)\n case types$1._return: return this.parseReturnStatement(node)\n case types$1._switch: return this.parseSwitchStatement(node)\n case types$1._throw: return this.parseThrowStatement(node)\n case types$1._try: return this.parseTryStatement(node)\n case types$1._const: case types$1._var:\n kind = kind || this.value;\n if (context && kind !== \"var\") { this.unexpected(); }\n return this.parseVarStatement(node, kind)\n case types$1._while: return this.parseWhileStatement(node)\n case types$1._with: return this.parseWithStatement(node)\n case types$1.braceL: return this.parseBlock(true, node)\n case types$1.semi: return this.parseEmptyStatement(node)\n case types$1._export:\n case types$1._import:\n if (this.options.ecmaVersion > 10 && starttype === types$1._import) {\n skipWhiteSpace.lastIndex = this.pos;\n var skip = skipWhiteSpace.exec(this.input);\n var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);\n if (nextCh === 40 || nextCh === 46) // '(' or '.'\n { return this.parseExpressionStatement(node, this.parseExpression()) }\n }\n\n if (!this.options.allowImportExportEverywhere) {\n if (!topLevel)\n { this.raise(this.start, \"'import' and 'export' may only appear at the top level\"); }\n if (!this.inModule)\n { this.raise(this.start, \"'import' and 'export' may appear only with 'sourceType: module'\"); }\n }\n return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)\n\n // If the statement does not start with a statement keyword or a\n // brace, it's an ExpressionStatement or LabeledStatement. We\n // simply start parsing an expression, and afterwards, if the\n // next token is a colon and the expression was a simple\n // Identifier node, we switch to interpreting it as a label.\n default:\n if (this.isAsyncFunction()) {\n if (context) { this.unexpected(); }\n this.next();\n return this.parseFunctionStatement(node, true, !context)\n }\n\n var maybeName = this.value, expr = this.parseExpression();\n if (starttype === types$1.name && expr.type === \"Identifier\" && this.eat(types$1.colon))\n { return this.parseLabeledStatement(node, maybeName, expr, context) }\n else { return this.parseExpressionStatement(node, expr) }\n }\n};\n\npp$8.parseBreakContinueStatement = function(node, keyword) {\n var isBreak = keyword === \"break\";\n this.next();\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }\n else if (this.type !== types$1.name) { this.unexpected(); }\n else {\n node.label = this.parseIdent();\n this.semicolon();\n }\n\n // Verify that there is an actual destination to break or\n // continue to.\n var i = 0;\n for (; i < this.labels.length; ++i) {\n var lab = this.labels[i];\n if (node.label == null || lab.name === node.label.name) {\n if (lab.kind != null && (isBreak || lab.kind === \"loop\")) { break }\n if (node.label && isBreak) { break }\n }\n }\n if (i === this.labels.length) { this.raise(node.start, \"Unsyntactic \" + keyword); }\n return this.finishNode(node, isBreak ? \"BreakStatement\" : \"ContinueStatement\")\n};\n\npp$8.parseDebuggerStatement = function(node) {\n this.next();\n this.semicolon();\n return this.finishNode(node, \"DebuggerStatement\")\n};\n\npp$8.parseDoStatement = function(node) {\n this.next();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"do\");\n this.labels.pop();\n this.expect(types$1._while);\n node.test = this.parseParenExpression();\n if (this.options.ecmaVersion >= 6)\n { this.eat(types$1.semi); }\n else\n { this.semicolon(); }\n return this.finishNode(node, \"DoWhileStatement\")\n};\n\n// Disambiguating between a `for` and a `for`/`in` or `for`/`of`\n// loop is non-trivial. Basically, we have to parse the init `var`\n// statement or expression, disallowing the `in` operator (see\n// the second parameter to `parseExpression`), and then check\n// whether the next token is `in` or `of`. When there is no init\n// part (semicolon immediately after the opening parenthesis), it\n// is a regular `for` loop.\n\npp$8.parseForStatement = function(node) {\n this.next();\n var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual(\"await\")) ? this.lastTokStart : -1;\n this.labels.push(loopLabel);\n this.enterScope(0);\n this.expect(types$1.parenL);\n if (this.type === types$1.semi) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, null)\n }\n var isLet = this.isLet();\n if (this.type === types$1._var || this.type === types$1._const || isLet) {\n var init$1 = this.startNode(), kind = isLet ? \"let\" : this.value;\n this.next();\n this.parseVar(init$1, true, kind);\n this.finishNode(init$1, \"VariableDeclaration\");\n if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) && init$1.declarations.length === 1) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n return this.parseForIn(node, init$1)\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init$1)\n }\n var startsWithLet = this.isContextual(\"let\"), isForOf = false;\n var refDestructuringErrors = new DestructuringErrors;\n var init = this.parseExpression(awaitAt > -1 ? \"await\" : true, refDestructuringErrors);\n if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual(\"of\"))) {\n if (this.options.ecmaVersion >= 9) {\n if (this.type === types$1._in) {\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n } else { node.await = awaitAt > -1; }\n }\n if (startsWithLet && isForOf) { this.raise(init.start, \"The left-hand side of a for-of loop may not start with 'let'.\"); }\n this.toAssignable(init, false, refDestructuringErrors);\n this.checkLValPattern(init);\n return this.parseForIn(node, init)\n } else {\n this.checkExpressionErrors(refDestructuringErrors, true);\n }\n if (awaitAt > -1) { this.unexpected(awaitAt); }\n return this.parseFor(node, init)\n};\n\npp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {\n this.next();\n return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)\n};\n\npp$8.parseIfStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n // allow function declarations in branches, but only in non-strict mode\n node.consequent = this.parseStatement(\"if\");\n node.alternate = this.eat(types$1._else) ? this.parseStatement(\"if\") : null;\n return this.finishNode(node, \"IfStatement\")\n};\n\npp$8.parseReturnStatement = function(node) {\n if (!this.inFunction && !this.options.allowReturnOutsideFunction)\n { this.raise(this.start, \"'return' outside of function\"); }\n this.next();\n\n // In `return` (and `break`/`continue`), the keywords with\n // optional arguments, we eagerly look for a semicolon or the\n // possibility to insert one.\n\n if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }\n else { node.argument = this.parseExpression(); this.semicolon(); }\n return this.finishNode(node, \"ReturnStatement\")\n};\n\npp$8.parseSwitchStatement = function(node) {\n this.next();\n node.discriminant = this.parseParenExpression();\n node.cases = [];\n this.expect(types$1.braceL);\n this.labels.push(switchLabel);\n this.enterScope(0);\n\n // Statements under must be grouped (by label) in SwitchCase\n // nodes. `cur` is used to keep the node that we are currently\n // adding statements to.\n\n var cur;\n for (var sawDefault = false; this.type !== types$1.braceR;) {\n if (this.type === types$1._case || this.type === types$1._default) {\n var isCase = this.type === types$1._case;\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n node.cases.push(cur = this.startNode());\n cur.consequent = [];\n this.next();\n if (isCase) {\n cur.test = this.parseExpression();\n } else {\n if (sawDefault) { this.raiseRecoverable(this.lastTokStart, \"Multiple default clauses\"); }\n sawDefault = true;\n cur.test = null;\n }\n this.expect(types$1.colon);\n } else {\n if (!cur) { this.unexpected(); }\n cur.consequent.push(this.parseStatement(null));\n }\n }\n this.exitScope();\n if (cur) { this.finishNode(cur, \"SwitchCase\"); }\n this.next(); // Closing brace\n this.labels.pop();\n return this.finishNode(node, \"SwitchStatement\")\n};\n\npp$8.parseThrowStatement = function(node) {\n this.next();\n if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))\n { this.raise(this.lastTokEnd, \"Illegal newline after throw\"); }\n node.argument = this.parseExpression();\n this.semicolon();\n return this.finishNode(node, \"ThrowStatement\")\n};\n\n// Reused empty array added for node fields that are always empty.\n\nvar empty$1 = [];\n\npp$8.parseTryStatement = function(node) {\n this.next();\n node.block = this.parseBlock();\n node.handler = null;\n if (this.type === types$1._catch) {\n var clause = this.startNode();\n this.next();\n if (this.eat(types$1.parenL)) {\n clause.param = this.parseBindingAtom();\n var simple = clause.param.type === \"Identifier\";\n this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);\n this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);\n this.expect(types$1.parenR);\n } else {\n if (this.options.ecmaVersion < 10) { this.unexpected(); }\n clause.param = null;\n this.enterScope(0);\n }\n clause.body = this.parseBlock(false);\n this.exitScope();\n node.handler = this.finishNode(clause, \"CatchClause\");\n }\n node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;\n if (!node.handler && !node.finalizer)\n { this.raise(node.start, \"Missing catch or finally clause\"); }\n return this.finishNode(node, \"TryStatement\")\n};\n\npp$8.parseVarStatement = function(node, kind) {\n this.next();\n this.parseVar(node, false, kind);\n this.semicolon();\n return this.finishNode(node, \"VariableDeclaration\")\n};\n\npp$8.parseWhileStatement = function(node) {\n this.next();\n node.test = this.parseParenExpression();\n this.labels.push(loopLabel);\n node.body = this.parseStatement(\"while\");\n this.labels.pop();\n return this.finishNode(node, \"WhileStatement\")\n};\n\npp$8.parseWithStatement = function(node) {\n if (this.strict) { this.raise(this.start, \"'with' in strict mode\"); }\n this.next();\n node.object = this.parseParenExpression();\n node.body = this.parseStatement(\"with\");\n return this.finishNode(node, \"WithStatement\")\n};\n\npp$8.parseEmptyStatement = function(node) {\n this.next();\n return this.finishNode(node, \"EmptyStatement\")\n};\n\npp$8.parseLabeledStatement = function(node, maybeName, expr, context) {\n for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)\n {\n var label = list[i$1];\n\n if (label.name === maybeName)\n { this.raise(expr.start, \"Label '\" + maybeName + \"' is already declared\");\n } }\n var kind = this.type.isLoop ? \"loop\" : this.type === types$1._switch ? \"switch\" : null;\n for (var i = this.labels.length - 1; i >= 0; i--) {\n var label$1 = this.labels[i];\n if (label$1.statementStart === node.start) {\n // Update information about previous labels on this node\n label$1.statementStart = this.start;\n label$1.kind = kind;\n } else { break }\n }\n this.labels.push({name: maybeName, kind: kind, statementStart: this.start});\n node.body = this.parseStatement(context ? context.indexOf(\"label\") === -1 ? context + \"label\" : context : \"label\");\n this.labels.pop();\n node.label = expr;\n return this.finishNode(node, \"LabeledStatement\")\n};\n\npp$8.parseExpressionStatement = function(node, expr) {\n node.expression = expr;\n this.semicolon();\n return this.finishNode(node, \"ExpressionStatement\")\n};\n\n// Parse a semicolon-enclosed block of statements, handling `\"use\n// strict\"` declarations when `allowStrict` is true (used for\n// function bodies).\n\npp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {\n if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;\n if ( node === void 0 ) node = this.startNode();\n\n node.body = [];\n this.expect(types$1.braceL);\n if (createNewLexicalScope) { this.enterScope(0); }\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n if (exitStrict) { this.strict = false; }\n this.next();\n if (createNewLexicalScope) { this.exitScope(); }\n return this.finishNode(node, \"BlockStatement\")\n};\n\n// Parse a regular `for` loop. The disambiguation code in\n// `parseStatement` will already have parsed the init statement or\n// expression.\n\npp$8.parseFor = function(node, init) {\n node.init = init;\n this.expect(types$1.semi);\n node.test = this.type === types$1.semi ? null : this.parseExpression();\n this.expect(types$1.semi);\n node.update = this.type === types$1.parenR ? null : this.parseExpression();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, \"ForStatement\")\n};\n\n// Parse a `for`/`in` and `for`/`of` loop, which are almost\n// same from parser's perspective.\n\npp$8.parseForIn = function(node, init) {\n var isForIn = this.type === types$1._in;\n this.next();\n\n if (\n init.type === \"VariableDeclaration\" &&\n init.declarations[0].init != null &&\n (\n !isForIn ||\n this.options.ecmaVersion < 8 ||\n this.strict ||\n init.kind !== \"var\" ||\n init.declarations[0].id.type !== \"Identifier\"\n )\n ) {\n this.raise(\n init.start,\n ((isForIn ? \"for-in\" : \"for-of\") + \" loop variable declaration may not have an initializer\")\n );\n }\n node.left = init;\n node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();\n this.expect(types$1.parenR);\n node.body = this.parseStatement(\"for\");\n this.exitScope();\n this.labels.pop();\n return this.finishNode(node, isForIn ? \"ForInStatement\" : \"ForOfStatement\")\n};\n\n// Parse a list of variable declarations.\n\npp$8.parseVar = function(node, isFor, kind) {\n node.declarations = [];\n node.kind = kind;\n for (;;) {\n var decl = this.startNode();\n this.parseVarId(decl, kind);\n if (this.eat(types$1.eq)) {\n decl.init = this.parseMaybeAssign(isFor);\n } else if (kind === \"const\" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual(\"of\")))) {\n this.unexpected();\n } else if (decl.id.type !== \"Identifier\" && !(isFor && (this.type === types$1._in || this.isContextual(\"of\")))) {\n this.raise(this.lastTokEnd, \"Complex binding patterns require an initialization value\");\n } else {\n decl.init = null;\n }\n node.declarations.push(this.finishNode(decl, \"VariableDeclarator\"));\n if (!this.eat(types$1.comma)) { break }\n }\n return node\n};\n\npp$8.parseVarId = function(decl, kind) {\n decl.id = this.parseBindingAtom();\n this.checkLValPattern(decl.id, kind === \"var\" ? BIND_VAR : BIND_LEXICAL, false);\n};\n\nvar FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;\n\n// Parse a function declaration or literal (depending on the\n// `statement & FUNC_STATEMENT`).\n\n// Remove `allowExpressionBody` for 7.0.0, as it is only called with false\npp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {\n this.initFunction(node);\n if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {\n if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))\n { this.unexpected(); }\n node.generator = this.eat(types$1.star);\n }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n if (statement & FUNC_STATEMENT) {\n node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();\n if (node.id && !(statement & FUNC_HANGING_STATEMENT))\n // If it is a regular function declaration in sloppy mode, then it is\n // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding\n // mode depends on properties of the current scope (see\n // treatFunctionsAsVar).\n { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }\n }\n\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(node.async, node.generator));\n\n if (!(statement & FUNC_STATEMENT))\n { node.id = this.type === types$1.name ? this.parseIdent() : null; }\n\n this.parseFunctionParams(node);\n this.parseFunctionBody(node, allowExpressionBody, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, (statement & FUNC_STATEMENT) ? \"FunctionDeclaration\" : \"FunctionExpression\")\n};\n\npp$8.parseFunctionParams = function(node) {\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n};\n\n// Parse a class declaration or literal (depending on the\n// `isStatement` parameter).\n\npp$8.parseClass = function(node, isStatement) {\n this.next();\n\n // ecma-262 14.6 Class Definitions\n // A class definition is always strict mode code.\n var oldStrict = this.strict;\n this.strict = true;\n\n this.parseClassId(node, isStatement);\n this.parseClassSuper(node);\n var privateNameMap = this.enterClassBody();\n var classBody = this.startNode();\n var hadConstructor = false;\n classBody.body = [];\n this.expect(types$1.braceL);\n while (this.type !== types$1.braceR) {\n var element = this.parseClassElement(node.superClass !== null);\n if (element) {\n classBody.body.push(element);\n if (element.type === \"MethodDefinition\" && element.kind === \"constructor\") {\n if (hadConstructor) { this.raise(element.start, \"Duplicate constructor in the same class\"); }\n hadConstructor = true;\n } else if (element.key && element.key.type === \"PrivateIdentifier\" && isPrivateNameConflicted(privateNameMap, element)) {\n this.raiseRecoverable(element.key.start, (\"Identifier '#\" + (element.key.name) + \"' has already been declared\"));\n }\n }\n }\n this.strict = oldStrict;\n this.next();\n node.body = this.finishNode(classBody, \"ClassBody\");\n this.exitClassBody();\n return this.finishNode(node, isStatement ? \"ClassDeclaration\" : \"ClassExpression\")\n};\n\npp$8.parseClassElement = function(constructorAllowsSuper) {\n if (this.eat(types$1.semi)) { return null }\n\n var ecmaVersion = this.options.ecmaVersion;\n var node = this.startNode();\n var keyName = \"\";\n var isGenerator = false;\n var isAsync = false;\n var kind = \"method\";\n var isStatic = false;\n\n if (this.eatContextual(\"static\")) {\n // Parse static init block\n if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {\n this.parseClassStaticBlock(node);\n return node\n }\n if (this.isClassElementNameStart() || this.type === types$1.star) {\n isStatic = true;\n } else {\n keyName = \"static\";\n }\n }\n node.static = isStatic;\n if (!keyName && ecmaVersion >= 8 && this.eatContextual(\"async\")) {\n if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {\n isAsync = true;\n } else {\n keyName = \"async\";\n }\n }\n if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {\n isGenerator = true;\n }\n if (!keyName && !isAsync && !isGenerator) {\n var lastValue = this.value;\n if (this.eatContextual(\"get\") || this.eatContextual(\"set\")) {\n if (this.isClassElementNameStart()) {\n kind = lastValue;\n } else {\n keyName = lastValue;\n }\n }\n }\n\n // Parse element name\n if (keyName) {\n // 'async', 'get', 'set', or 'static' were not a keyword contextually.\n // The last token is any of those. Make it the element name.\n node.computed = false;\n node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);\n node.key.name = keyName;\n this.finishNode(node.key, \"Identifier\");\n } else {\n this.parseClassElementName(node);\n }\n\n // Parse element value\n if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== \"method\" || isGenerator || isAsync) {\n var isConstructor = !node.static && checkKeyName(node, \"constructor\");\n var allowsDirectSuper = isConstructor && constructorAllowsSuper;\n // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.\n if (isConstructor && kind !== \"method\") { this.raise(node.key.start, \"Constructor can't have get/set modifier\"); }\n node.kind = isConstructor ? \"constructor\" : kind;\n this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);\n } else {\n this.parseClassField(node);\n }\n\n return node\n};\n\npp$8.isClassElementNameStart = function() {\n return (\n this.type === types$1.name ||\n this.type === types$1.privateId ||\n this.type === types$1.num ||\n this.type === types$1.string ||\n this.type === types$1.bracketL ||\n this.type.keyword\n )\n};\n\npp$8.parseClassElementName = function(element) {\n if (this.type === types$1.privateId) {\n if (this.value === \"constructor\") {\n this.raise(this.start, \"Classes can't have an element named '#constructor'\");\n }\n element.computed = false;\n element.key = this.parsePrivateIdent();\n } else {\n this.parsePropertyName(element);\n }\n};\n\npp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {\n // Check key and flags\n var key = method.key;\n if (method.kind === \"constructor\") {\n if (isGenerator) { this.raise(key.start, \"Constructor can't be a generator\"); }\n if (isAsync) { this.raise(key.start, \"Constructor can't be an async method\"); }\n } else if (method.static && checkKeyName(method, \"prototype\")) {\n this.raise(key.start, \"Classes may not have a static property named prototype\");\n }\n\n // Parse value\n var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);\n\n // Check value\n if (method.kind === \"get\" && value.params.length !== 0)\n { this.raiseRecoverable(value.start, \"getter should have no params\"); }\n if (method.kind === \"set\" && value.params.length !== 1)\n { this.raiseRecoverable(value.start, \"setter should have exactly one param\"); }\n if (method.kind === \"set\" && value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(value.params[0].start, \"Setter cannot use rest params\"); }\n\n return this.finishNode(method, \"MethodDefinition\")\n};\n\npp$8.parseClassField = function(field) {\n if (checkKeyName(field, \"constructor\")) {\n this.raise(field.key.start, \"Classes can't have a field named 'constructor'\");\n } else if (field.static && checkKeyName(field, \"prototype\")) {\n this.raise(field.key.start, \"Classes can't have a static field named 'prototype'\");\n }\n\n if (this.eat(types$1.eq)) {\n // To raise SyntaxError if 'arguments' exists in the initializer.\n var scope = this.currentThisScope();\n var inClassFieldInit = scope.inClassFieldInit;\n scope.inClassFieldInit = true;\n field.value = this.parseMaybeAssign();\n scope.inClassFieldInit = inClassFieldInit;\n } else {\n field.value = null;\n }\n this.semicolon();\n\n return this.finishNode(field, \"PropertyDefinition\")\n};\n\npp$8.parseClassStaticBlock = function(node) {\n node.body = [];\n\n var oldLabels = this.labels;\n this.labels = [];\n this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);\n while (this.type !== types$1.braceR) {\n var stmt = this.parseStatement(null);\n node.body.push(stmt);\n }\n this.next();\n this.exitScope();\n this.labels = oldLabels;\n\n return this.finishNode(node, \"StaticBlock\")\n};\n\npp$8.parseClassId = function(node, isStatement) {\n if (this.type === types$1.name) {\n node.id = this.parseIdent();\n if (isStatement)\n { this.checkLValSimple(node.id, BIND_LEXICAL, false); }\n } else {\n if (isStatement === true)\n { this.unexpected(); }\n node.id = null;\n }\n};\n\npp$8.parseClassSuper = function(node) {\n node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null;\n};\n\npp$8.enterClassBody = function() {\n var element = {declared: Object.create(null), used: []};\n this.privateNameStack.push(element);\n return element.declared\n};\n\npp$8.exitClassBody = function() {\n var ref = this.privateNameStack.pop();\n var declared = ref.declared;\n var used = ref.used;\n var len = this.privateNameStack.length;\n var parent = len === 0 ? null : this.privateNameStack[len - 1];\n for (var i = 0; i < used.length; ++i) {\n var id = used[i];\n if (!hasOwn(declared, id.name)) {\n if (parent) {\n parent.used.push(id);\n } else {\n this.raiseRecoverable(id.start, (\"Private field '#\" + (id.name) + \"' must be declared in an enclosing class\"));\n }\n }\n }\n};\n\nfunction isPrivateNameConflicted(privateNameMap, element) {\n var name = element.key.name;\n var curr = privateNameMap[name];\n\n var next = \"true\";\n if (element.type === \"MethodDefinition\" && (element.kind === \"get\" || element.kind === \"set\")) {\n next = (element.static ? \"s\" : \"i\") + element.kind;\n }\n\n // `class { get #a(){}; static set #a(_){} }` is also conflict.\n if (\n curr === \"iget\" && next === \"iset\" ||\n curr === \"iset\" && next === \"iget\" ||\n curr === \"sget\" && next === \"sset\" ||\n curr === \"sset\" && next === \"sget\"\n ) {\n privateNameMap[name] = \"true\";\n return false\n } else if (!curr) {\n privateNameMap[name] = next;\n return false\n } else {\n return true\n }\n}\n\nfunction checkKeyName(node, name) {\n var computed = node.computed;\n var key = node.key;\n return !computed && (\n key.type === \"Identifier\" && key.name === name ||\n key.type === \"Literal\" && key.value === name\n )\n}\n\n// Parses module export declaration.\n\npp$8.parseExport = function(node, exports) {\n this.next();\n // export * from '...'\n if (this.eat(types$1.star)) {\n if (this.options.ecmaVersion >= 11) {\n if (this.eatContextual(\"as\")) {\n node.exported = this.parseModuleExportName();\n this.checkExport(exports, node.exported, this.lastTokStart);\n } else {\n node.exported = null;\n }\n }\n this.expectContextual(\"from\");\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n this.semicolon();\n return this.finishNode(node, \"ExportAllDeclaration\")\n }\n if (this.eat(types$1._default)) { // export default ...\n this.checkExport(exports, \"default\", this.lastTokStart);\n var isAsync;\n if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {\n var fNode = this.startNode();\n this.next();\n if (isAsync) { this.next(); }\n node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);\n } else if (this.type === types$1._class) {\n var cNode = this.startNode();\n node.declaration = this.parseClass(cNode, \"nullableID\");\n } else {\n node.declaration = this.parseMaybeAssign();\n this.semicolon();\n }\n return this.finishNode(node, \"ExportDefaultDeclaration\")\n }\n // export var|const|let|function|class ...\n if (this.shouldParseExportStatement()) {\n node.declaration = this.parseStatement(null);\n if (node.declaration.type === \"VariableDeclaration\")\n { this.checkVariableExport(exports, node.declaration.declarations); }\n else\n { this.checkExport(exports, node.declaration.id, node.declaration.id.start); }\n node.specifiers = [];\n node.source = null;\n } else { // export { x, y as z } [from '...']\n node.declaration = null;\n node.specifiers = this.parseExportSpecifiers(exports);\n if (this.eatContextual(\"from\")) {\n if (this.type !== types$1.string) { this.unexpected(); }\n node.source = this.parseExprAtom();\n } else {\n for (var i = 0, list = node.specifiers; i < list.length; i += 1) {\n // check for keywords used as local names\n var spec = list[i];\n\n this.checkUnreserved(spec.local);\n // check if export is defined\n this.checkLocalExport(spec.local);\n\n if (spec.local.type === \"Literal\") {\n this.raise(spec.local.start, \"A string literal cannot be used as an exported binding without `from`.\");\n }\n }\n\n node.source = null;\n }\n this.semicolon();\n }\n return this.finishNode(node, \"ExportNamedDeclaration\")\n};\n\npp$8.checkExport = function(exports, name, pos) {\n if (!exports) { return }\n if (typeof name !== \"string\")\n { name = name.type === \"Identifier\" ? name.name : name.value; }\n if (hasOwn(exports, name))\n { this.raiseRecoverable(pos, \"Duplicate export '\" + name + \"'\"); }\n exports[name] = true;\n};\n\npp$8.checkPatternExport = function(exports, pat) {\n var type = pat.type;\n if (type === \"Identifier\")\n { this.checkExport(exports, pat, pat.start); }\n else if (type === \"ObjectPattern\")\n { for (var i = 0, list = pat.properties; i < list.length; i += 1)\n {\n var prop = list[i];\n\n this.checkPatternExport(exports, prop);\n } }\n else if (type === \"ArrayPattern\")\n { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {\n var elt = list$1[i$1];\n\n if (elt) { this.checkPatternExport(exports, elt); }\n } }\n else if (type === \"Property\")\n { this.checkPatternExport(exports, pat.value); }\n else if (type === \"AssignmentPattern\")\n { this.checkPatternExport(exports, pat.left); }\n else if (type === \"RestElement\")\n { this.checkPatternExport(exports, pat.argument); }\n else if (type === \"ParenthesizedExpression\")\n { this.checkPatternExport(exports, pat.expression); }\n};\n\npp$8.checkVariableExport = function(exports, decls) {\n if (!exports) { return }\n for (var i = 0, list = decls; i < list.length; i += 1)\n {\n var decl = list[i];\n\n this.checkPatternExport(exports, decl.id);\n }\n};\n\npp$8.shouldParseExportStatement = function() {\n return this.type.keyword === \"var\" ||\n this.type.keyword === \"const\" ||\n this.type.keyword === \"class\" ||\n this.type.keyword === \"function\" ||\n this.isLet() ||\n this.isAsyncFunction()\n};\n\n// Parses a comma-separated list of module exports.\n\npp$8.parseExportSpecifiers = function(exports) {\n var nodes = [], first = true;\n // export { x, y as z } [from '...']\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var node = this.startNode();\n node.local = this.parseModuleExportName();\n node.exported = this.eatContextual(\"as\") ? this.parseModuleExportName() : node.local;\n this.checkExport(\n exports,\n node.exported,\n node.exported.start\n );\n nodes.push(this.finishNode(node, \"ExportSpecifier\"));\n }\n return nodes\n};\n\n// Parses import declaration.\n\npp$8.parseImport = function(node) {\n this.next();\n // import '...'\n if (this.type === types$1.string) {\n node.specifiers = empty$1;\n node.source = this.parseExprAtom();\n } else {\n node.specifiers = this.parseImportSpecifiers();\n this.expectContextual(\"from\");\n node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();\n }\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\")\n};\n\n// Parses a comma-separated list of module imports.\n\npp$8.parseImportSpecifiers = function() {\n var nodes = [], first = true;\n if (this.type === types$1.name) {\n // import defaultObj, { x, y as z } from '...'\n var node = this.startNode();\n node.local = this.parseIdent();\n this.checkLValSimple(node.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node, \"ImportDefaultSpecifier\"));\n if (!this.eat(types$1.comma)) { return nodes }\n }\n if (this.type === types$1.star) {\n var node$1 = this.startNode();\n this.next();\n this.expectContextual(\"as\");\n node$1.local = this.parseIdent();\n this.checkLValSimple(node$1.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node$1, \"ImportNamespaceSpecifier\"));\n return nodes\n }\n this.expect(types$1.braceL);\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var node$2 = this.startNode();\n node$2.imported = this.parseModuleExportName();\n if (this.eatContextual(\"as\")) {\n node$2.local = this.parseIdent();\n } else {\n this.checkUnreserved(node$2.imported);\n node$2.local = node$2.imported;\n }\n this.checkLValSimple(node$2.local, BIND_LEXICAL);\n nodes.push(this.finishNode(node$2, \"ImportSpecifier\"));\n }\n return nodes\n};\n\npp$8.parseModuleExportName = function() {\n if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {\n var stringLiteral = this.parseLiteral(this.value);\n if (loneSurrogate.test(stringLiteral.value)) {\n this.raise(stringLiteral.start, \"An export name cannot include a lone surrogate.\");\n }\n return stringLiteral\n }\n return this.parseIdent(true)\n};\n\n// Set `ExpressionStatement#directive` property for directive prologues.\npp$8.adaptDirectivePrologue = function(statements) {\n for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {\n statements[i].directive = statements[i].expression.raw.slice(1, -1);\n }\n};\npp$8.isDirectiveCandidate = function(statement) {\n return (\n statement.type === \"ExpressionStatement\" &&\n statement.expression.type === \"Literal\" &&\n typeof statement.expression.value === \"string\" &&\n // Reject parenthesized strings.\n (this.input[statement.start] === \"\\\"\" || this.input[statement.start] === \"'\")\n )\n};\n\nvar pp$7 = Parser.prototype;\n\n// Convert existing expression atom to assignable pattern\n// if possible.\n\npp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 6 && node) {\n switch (node.type) {\n case \"Identifier\":\n if (this.inAsync && node.name === \"await\")\n { this.raise(node.start, \"Cannot use 'await' as identifier inside an async function\"); }\n break\n\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n case \"RestElement\":\n break\n\n case \"ObjectExpression\":\n node.type = \"ObjectPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n for (var i = 0, list = node.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.toAssignable(prop, isBinding);\n // Early error:\n // AssignmentRestProperty[Yield, Await] :\n // `...` DestructuringAssignmentTarget[Yield, Await]\n //\n // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.\n if (\n prop.type === \"RestElement\" &&\n (prop.argument.type === \"ArrayPattern\" || prop.argument.type === \"ObjectPattern\")\n ) {\n this.raise(prop.argument.start, \"Unexpected token\");\n }\n }\n break\n\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n if (node.kind !== \"init\") { this.raise(node.key.start, \"Object pattern can't contain getter or setter\"); }\n this.toAssignable(node.value, isBinding);\n break\n\n case \"ArrayExpression\":\n node.type = \"ArrayPattern\";\n if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n this.toAssignableList(node.elements, isBinding);\n break\n\n case \"SpreadElement\":\n node.type = \"RestElement\";\n this.toAssignable(node.argument, isBinding);\n if (node.argument.type === \"AssignmentPattern\")\n { this.raise(node.argument.start, \"Rest elements cannot have a default value\"); }\n break\n\n case \"AssignmentExpression\":\n if (node.operator !== \"=\") { this.raise(node.left.end, \"Only '=' operator can be used for specifying default value.\"); }\n node.type = \"AssignmentPattern\";\n delete node.operator;\n this.toAssignable(node.left, isBinding);\n break\n\n case \"ParenthesizedExpression\":\n this.toAssignable(node.expression, isBinding, refDestructuringErrors);\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(node.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (!isBinding) { break }\n\n default:\n this.raise(node.start, \"Assigning to rvalue\");\n }\n } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }\n return node\n};\n\n// Convert list of expression atoms to binding list.\n\npp$7.toAssignableList = function(exprList, isBinding) {\n var end = exprList.length;\n for (var i = 0; i < end; i++) {\n var elt = exprList[i];\n if (elt) { this.toAssignable(elt, isBinding); }\n }\n if (end) {\n var last = exprList[end - 1];\n if (this.options.ecmaVersion === 6 && isBinding && last && last.type === \"RestElement\" && last.argument.type !== \"Identifier\")\n { this.unexpected(last.argument.start); }\n }\n return exprList\n};\n\n// Parses spread element.\n\npp$7.parseSpread = function(refDestructuringErrors) {\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n return this.finishNode(node, \"SpreadElement\")\n};\n\npp$7.parseRestBinding = function() {\n var node = this.startNode();\n this.next();\n\n // RestElement inside of a function parameter must be an identifier\n if (this.options.ecmaVersion === 6 && this.type !== types$1.name)\n { this.unexpected(); }\n\n node.argument = this.parseBindingAtom();\n\n return this.finishNode(node, \"RestElement\")\n};\n\n// Parses lvalue (assignable) atom.\n\npp$7.parseBindingAtom = function() {\n if (this.options.ecmaVersion >= 6) {\n switch (this.type) {\n case types$1.bracketL:\n var node = this.startNode();\n this.next();\n node.elements = this.parseBindingList(types$1.bracketR, true, true);\n return this.finishNode(node, \"ArrayPattern\")\n\n case types$1.braceL:\n return this.parseObj(true)\n }\n }\n return this.parseIdent()\n};\n\npp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (first) { first = false; }\n else { this.expect(types$1.comma); }\n if (allowEmpty && this.type === types$1.comma) {\n elts.push(null);\n } else if (allowTrailingComma && this.afterTrailingComma(close)) {\n break\n } else if (this.type === types$1.ellipsis) {\n var rest = this.parseRestBinding();\n this.parseBindingListItem(rest);\n elts.push(rest);\n if (this.type === types$1.comma) { this.raise(this.start, \"Comma is not permitted after the rest element\"); }\n this.expect(close);\n break\n } else {\n var elem = this.parseMaybeDefault(this.start, this.startLoc);\n this.parseBindingListItem(elem);\n elts.push(elem);\n }\n }\n return elts\n};\n\npp$7.parseBindingListItem = function(param) {\n return param\n};\n\n// Parses assignment pattern around given atom if possible.\n\npp$7.parseMaybeDefault = function(startPos, startLoc, left) {\n left = left || this.parseBindingAtom();\n if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.right = this.parseMaybeAssign();\n return this.finishNode(node, \"AssignmentPattern\")\n};\n\n// The following three functions all verify that a node is an lvalue —\n// something that can be bound, or assigned to. In order to do so, they perform\n// a variety of checks:\n//\n// - Check that none of the bound/assigned-to identifiers are reserved words.\n// - Record name declarations for bindings in the appropriate scope.\n// - Check duplicate argument names, if checkClashes is set.\n//\n// If a complex binding pattern is encountered (e.g., object and array\n// destructuring), the entire pattern is recursively checked.\n//\n// There are three versions of checkLVal*() appropriate for different\n// circumstances:\n//\n// - checkLValSimple() shall be used if the syntactic construct supports\n// nothing other than identifiers and member expressions. Parenthesized\n// expressions are also correctly handled. This is generally appropriate for\n// constructs for which the spec says\n//\n// > It is a Syntax Error if AssignmentTargetType of [the production] is not\n// > simple.\n//\n// It is also appropriate for checking if an identifier is valid and not\n// defined elsewhere, like import declarations or function/class identifiers.\n//\n// Examples where this is used include:\n// a += …;\n// import a from '…';\n// where a is the node to be checked.\n//\n// - checkLValPattern() shall be used if the syntactic construct supports\n// anything checkLValSimple() supports, as well as object and array\n// destructuring patterns. This is generally appropriate for constructs for\n// which the spec says\n//\n// > It is a Syntax Error if [the production] is neither an ObjectLiteral nor\n// > an ArrayLiteral and AssignmentTargetType of [the production] is not\n// > simple.\n//\n// Examples where this is used include:\n// (a = …);\n// const a = …;\n// try { … } catch (a) { … }\n// where a is the node to be checked.\n//\n// - checkLValInnerPattern() shall be used if the syntactic construct supports\n// anything checkLValPattern() supports, as well as default assignment\n// patterns, rest elements, and other constructs that may appear within an\n// object or array destructuring pattern.\n//\n// As a special case, function parameters also use checkLValInnerPattern(),\n// as they also support defaults and rest constructs.\n//\n// These functions deliberately support both assignment and binding constructs,\n// as the logic for both is exceedingly similar. If the node is the target of\n// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it\n// should be set to the appropriate BIND_* constant, like BIND_VAR or\n// BIND_LEXICAL.\n//\n// If the function is called with a non-BIND_NONE bindingType, then\n// additionally a checkClashes object may be specified to allow checking for\n// duplicate argument names. checkClashes is ignored if the provided construct\n// is an assignment (i.e., bindingType is BIND_NONE).\n\npp$7.checkLValSimple = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n var isBind = bindingType !== BIND_NONE;\n\n switch (expr.type) {\n case \"Identifier\":\n if (this.strict && this.reservedWordsStrictBind.test(expr.name))\n { this.raiseRecoverable(expr.start, (isBind ? \"Binding \" : \"Assigning to \") + expr.name + \" in strict mode\"); }\n if (isBind) {\n if (bindingType === BIND_LEXICAL && expr.name === \"let\")\n { this.raiseRecoverable(expr.start, \"let is disallowed as a lexically bound name\"); }\n if (checkClashes) {\n if (hasOwn(checkClashes, expr.name))\n { this.raiseRecoverable(expr.start, \"Argument name clash\"); }\n checkClashes[expr.name] = true;\n }\n if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }\n }\n break\n\n case \"ChainExpression\":\n this.raiseRecoverable(expr.start, \"Optional chaining cannot appear in left-hand side\");\n break\n\n case \"MemberExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding member expression\"); }\n break\n\n case \"ParenthesizedExpression\":\n if (isBind) { this.raiseRecoverable(expr.start, \"Binding parenthesized expression\"); }\n return this.checkLValSimple(expr.expression, bindingType, checkClashes)\n\n default:\n this.raise(expr.start, (isBind ? \"Binding\" : \"Assigning to\") + \" rvalue\");\n }\n};\n\npp$7.checkLValPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"ObjectPattern\":\n for (var i = 0, list = expr.properties; i < list.length; i += 1) {\n var prop = list[i];\n\n this.checkLValInnerPattern(prop, bindingType, checkClashes);\n }\n break\n\n case \"ArrayPattern\":\n for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {\n var elem = list$1[i$1];\n\n if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }\n }\n break\n\n default:\n this.checkLValSimple(expr, bindingType, checkClashes);\n }\n};\n\npp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {\n if ( bindingType === void 0 ) bindingType = BIND_NONE;\n\n switch (expr.type) {\n case \"Property\":\n // AssignmentProperty has type === \"Property\"\n this.checkLValInnerPattern(expr.value, bindingType, checkClashes);\n break\n\n case \"AssignmentPattern\":\n this.checkLValPattern(expr.left, bindingType, checkClashes);\n break\n\n case \"RestElement\":\n this.checkLValPattern(expr.argument, bindingType, checkClashes);\n break\n\n default:\n this.checkLValPattern(expr, bindingType, checkClashes);\n }\n};\n\n// The algorithm used to determine whether a regexp can appear at a\n\nvar TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n this.generator = !!generator;\n};\n\nvar types = {\n b_stat: new TokContext(\"{\", false),\n b_expr: new TokContext(\"{\", true),\n b_tmpl: new TokContext(\"${\", false),\n p_stat: new TokContext(\"(\", false),\n p_expr: new TokContext(\"(\", true),\n q_tmpl: new TokContext(\"`\", true, true, function (p) { return p.tryReadTemplateToken(); }),\n f_stat: new TokContext(\"function\", false),\n f_expr: new TokContext(\"function\", true),\n f_expr_gen: new TokContext(\"function\", true, false, null, true),\n f_gen: new TokContext(\"function\", false, false, null, true)\n};\n\nvar pp$6 = Parser.prototype;\n\npp$6.initialContext = function() {\n return [types.b_stat]\n};\n\npp$6.curContext = function() {\n return this.context[this.context.length - 1]\n};\n\npp$6.braceIsBlock = function(prevType) {\n var parent = this.curContext();\n if (parent === types.f_expr || parent === types.f_stat)\n { return true }\n if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))\n { return !parent.isExpr }\n\n // The check for `tt.name && exprAllowed` detects whether we are\n // after a `yield` or `of` construct. See the `updateContext` for\n // `tt.name`.\n if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)\n { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }\n if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)\n { return true }\n if (prevType === types$1.braceL)\n { return parent === types.b_stat }\n if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)\n { return false }\n return !this.exprAllowed\n};\n\npp$6.inGeneratorContext = function() {\n for (var i = this.context.length - 1; i >= 1; i--) {\n var context = this.context[i];\n if (context.token === \"function\")\n { return context.generator }\n }\n return false\n};\n\npp$6.updateContext = function(prevType) {\n var update, type = this.type;\n if (type.keyword && prevType === types$1.dot)\n { this.exprAllowed = false; }\n else if (update = type.updateContext)\n { update.call(this, prevType); }\n else\n { this.exprAllowed = type.beforeExpr; }\n};\n\n// Used to handle egde case when token context could not be inferred correctly in tokenize phase\npp$6.overrideContext = function(tokenCtx) {\n if (this.curContext() !== tokenCtx) {\n this.context[this.context.length - 1] = tokenCtx;\n }\n};\n\n// Token-specific context update code\n\ntypes$1.parenR.updateContext = types$1.braceR.updateContext = function() {\n if (this.context.length === 1) {\n this.exprAllowed = true;\n return\n }\n var out = this.context.pop();\n if (out === types.b_stat && this.curContext().token === \"function\") {\n out = this.context.pop();\n }\n this.exprAllowed = !out.isExpr;\n};\n\ntypes$1.braceL.updateContext = function(prevType) {\n this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.dollarBraceL.updateContext = function() {\n this.context.push(types.b_tmpl);\n this.exprAllowed = true;\n};\n\ntypes$1.parenL.updateContext = function(prevType) {\n var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;\n this.context.push(statementParens ? types.p_stat : types.p_expr);\n this.exprAllowed = true;\n};\n\ntypes$1.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n};\n\ntypes$1._function.updateContext = types$1._class.updateContext = function(prevType) {\n if (prevType.beforeExpr && prevType !== types$1._else &&\n !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&\n !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&\n !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))\n { this.context.push(types.f_expr); }\n else\n { this.context.push(types.f_stat); }\n this.exprAllowed = false;\n};\n\ntypes$1.backQuote.updateContext = function() {\n if (this.curContext() === types.q_tmpl)\n { this.context.pop(); }\n else\n { this.context.push(types.q_tmpl); }\n this.exprAllowed = false;\n};\n\ntypes$1.star.updateContext = function(prevType) {\n if (prevType === types$1._function) {\n var index = this.context.length - 1;\n if (this.context[index] === types.f_expr)\n { this.context[index] = types.f_expr_gen; }\n else\n { this.context[index] = types.f_gen; }\n }\n this.exprAllowed = true;\n};\n\ntypes$1.name.updateContext = function(prevType) {\n var allowed = false;\n if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {\n if (this.value === \"of\" && !this.exprAllowed ||\n this.value === \"yield\" && this.inGeneratorContext())\n { allowed = true; }\n }\n this.exprAllowed = allowed;\n};\n\n// A recursive descent parser operates by defining functions for all\n\nvar pp$5 = Parser.prototype;\n\n// Check if property name clashes with already added.\n// Object/class getters and setters are not allowed to clash —\n// either with each other or with an init property — and in\n// strict mode, init properties are also not allowed to be repeated.\n\npp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {\n if (this.options.ecmaVersion >= 9 && prop.type === \"SpreadElement\")\n { return }\n if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))\n { return }\n var key = prop.key;\n var name;\n switch (key.type) {\n case \"Identifier\": name = key.name; break\n case \"Literal\": name = String(key.value); break\n default: return\n }\n var kind = prop.kind;\n if (this.options.ecmaVersion >= 6) {\n if (name === \"__proto__\" && kind === \"init\") {\n if (propHash.proto) {\n if (refDestructuringErrors) {\n if (refDestructuringErrors.doubleProto < 0) {\n refDestructuringErrors.doubleProto = key.start;\n }\n } else {\n this.raiseRecoverable(key.start, \"Redefinition of __proto__ property\");\n }\n }\n propHash.proto = true;\n }\n return\n }\n name = \"$\" + name;\n var other = propHash[name];\n if (other) {\n var redefinition;\n if (kind === \"init\") {\n redefinition = this.strict && other.init || other.get || other.set;\n } else {\n redefinition = other.init || other[kind];\n }\n if (redefinition)\n { this.raiseRecoverable(key.start, \"Redefinition of property\"); }\n } else {\n other = propHash[name] = {\n init: false,\n get: false,\n set: false\n };\n }\n other[kind] = true;\n};\n\n// ### Expression parsing\n\n// These nest, from the most general expression type at the top to\n// 'atomic', nondivisible expression types at the bottom. Most of\n// the functions will simply let the function(s) below them parse,\n// and, *if* the syntactic construct they handle is present, wrap\n// the AST node that the inner parser gave them in another node.\n\n// Parse a full expression. The optional arguments are used to\n// forbid the `in` operator (in for loops initalization expressions)\n// and provide reference for storing '=' operator inside shorthand\n// property assignment in contexts where both object expression\n// and object pattern might appear (so it's possible to raise\n// delayed syntax error at correct position).\n\npp$5.parseExpression = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);\n if (this.type === types$1.comma) {\n var node = this.startNodeAt(startPos, startLoc);\n node.expressions = [expr];\n while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }\n return this.finishNode(node, \"SequenceExpression\")\n }\n return expr\n};\n\n// Parse an assignment expression. This includes applications of\n// operators like `+=`.\n\npp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {\n if (this.isContextual(\"yield\")) {\n if (this.inGenerator) { return this.parseYield(forInit) }\n // The tokenizer will assume an expression is allowed after\n // `yield`, but this isn't that kind of yield\n else { this.exprAllowed = false; }\n }\n\n var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;\n if (refDestructuringErrors) {\n oldParenAssign = refDestructuringErrors.parenthesizedAssign;\n oldTrailingComma = refDestructuringErrors.trailingComma;\n oldDoubleProto = refDestructuringErrors.doubleProto;\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;\n } else {\n refDestructuringErrors = new DestructuringErrors;\n ownDestructuringErrors = true;\n }\n\n var startPos = this.start, startLoc = this.startLoc;\n if (this.type === types$1.parenL || this.type === types$1.name) {\n this.potentialArrowAt = this.start;\n this.potentialArrowInForAwait = forInit === \"await\";\n }\n var left = this.parseMaybeConditional(forInit, refDestructuringErrors);\n if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }\n if (this.type.isAssign) {\n var node = this.startNodeAt(startPos, startLoc);\n node.operator = this.value;\n if (this.type === types$1.eq)\n { left = this.toAssignable(left, false, refDestructuringErrors); }\n if (!ownDestructuringErrors) {\n refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;\n }\n if (refDestructuringErrors.shorthandAssign >= left.start)\n { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly\n if (this.type === types$1.eq)\n { this.checkLValPattern(left); }\n else\n { this.checkLValSimple(left); }\n node.left = left;\n this.next();\n node.right = this.parseMaybeAssign(forInit);\n if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }\n return this.finishNode(node, \"AssignmentExpression\")\n } else {\n if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }\n }\n if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }\n if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }\n return left\n};\n\n// Parse a ternary conditional (`?:`) operator.\n\npp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprOps(forInit, refDestructuringErrors);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n if (this.eat(types$1.question)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.test = expr;\n node.consequent = this.parseMaybeAssign();\n this.expect(types$1.colon);\n node.alternate = this.parseMaybeAssign(forInit);\n return this.finishNode(node, \"ConditionalExpression\")\n }\n return expr\n};\n\n// Start the precedence parser.\n\npp$5.parseExprOps = function(forInit, refDestructuringErrors) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n return expr.start === startPos && expr.type === \"ArrowFunctionExpression\" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)\n};\n\n// Parse binary operators with the operator precedence parsing\n// algorithm. `left` is the left-hand side of the operator.\n// `minPrec` provides context that allows the function to stop and\n// defer further parser to one of its callers when it encounters an\n// operator that has a lower precedence than the set it is parsing.\n\npp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {\n var prec = this.type.binop;\n if (prec != null && (!forInit || this.type !== types$1._in)) {\n if (prec > minPrec) {\n var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;\n var coalesce = this.type === types$1.coalesce;\n if (coalesce) {\n // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.\n // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.\n prec = types$1.logicalAND.binop;\n }\n var op = this.value;\n this.next();\n var startPos = this.start, startLoc = this.startLoc;\n var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);\n var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);\n if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {\n this.raiseRecoverable(this.start, \"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses\");\n }\n return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)\n }\n }\n return left\n};\n\npp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {\n if (right.type === \"PrivateIdentifier\") { this.raise(right.start, \"Private identifier can only be left side of binary expression\"); }\n var node = this.startNodeAt(startPos, startLoc);\n node.left = left;\n node.operator = op;\n node.right = right;\n return this.finishNode(node, logical ? \"LogicalExpression\" : \"BinaryExpression\")\n};\n\n// Parse unary operators, both prefix and postfix.\n\npp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {\n var startPos = this.start, startLoc = this.startLoc, expr;\n if (this.isContextual(\"await\") && this.canAwait) {\n expr = this.parseAwait(forInit);\n sawUnary = true;\n } else if (this.type.prefix) {\n var node = this.startNode(), update = this.type === types$1.incDec;\n node.operator = this.value;\n node.prefix = true;\n this.next();\n node.argument = this.parseMaybeUnary(null, true, update, forInit);\n this.checkExpressionErrors(refDestructuringErrors, true);\n if (update) { this.checkLValSimple(node.argument); }\n else if (this.strict && node.operator === \"delete\" &&\n node.argument.type === \"Identifier\")\n { this.raiseRecoverable(node.start, \"Deleting local variable in strict mode\"); }\n else if (node.operator === \"delete\" && isPrivateFieldAccess(node.argument))\n { this.raiseRecoverable(node.start, \"Private fields can not be deleted\"); }\n else { sawUnary = true; }\n expr = this.finishNode(node, update ? \"UpdateExpression\" : \"UnaryExpression\");\n } else if (!sawUnary && this.type === types$1.privateId) {\n if (forInit || this.privateNameStack.length === 0) { this.unexpected(); }\n expr = this.parsePrivateIdent();\n // only could be private fields in 'in', such as #x in obj\n if (this.type !== types$1._in) { this.unexpected(); }\n } else {\n expr = this.parseExprSubscripts(refDestructuringErrors, forInit);\n if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }\n while (this.type.postfix && !this.canInsertSemicolon()) {\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.operator = this.value;\n node$1.prefix = false;\n node$1.argument = expr;\n this.checkLValSimple(expr);\n this.next();\n expr = this.finishNode(node$1, \"UpdateExpression\");\n }\n }\n\n if (!incDec && this.eat(types$1.starstar)) {\n if (sawUnary)\n { this.unexpected(this.lastTokStart); }\n else\n { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), \"**\", false) }\n } else {\n return expr\n }\n};\n\nfunction isPrivateFieldAccess(node) {\n return (\n node.type === \"MemberExpression\" && node.property.type === \"PrivateIdentifier\" ||\n node.type === \"ChainExpression\" && isPrivateFieldAccess(node.expression)\n )\n}\n\n// Parse call, dot, and `[]`-subscript expressions.\n\npp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {\n var startPos = this.start, startLoc = this.startLoc;\n var expr = this.parseExprAtom(refDestructuringErrors, forInit);\n if (expr.type === \"ArrowFunctionExpression\" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== \")\")\n { return expr }\n var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);\n if (refDestructuringErrors && result.type === \"MemberExpression\") {\n if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }\n if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }\n if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }\n }\n return result\n};\n\npp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {\n var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === \"Identifier\" && base.name === \"async\" &&\n this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&\n this.potentialArrowAt === base.start;\n var optionalChained = false;\n\n while (true) {\n var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);\n\n if (element.optional) { optionalChained = true; }\n if (element === base || element.type === \"ArrowFunctionExpression\") {\n if (optionalChained) {\n var chainNode = this.startNodeAt(startPos, startLoc);\n chainNode.expression = element;\n element = this.finishNode(chainNode, \"ChainExpression\");\n }\n return element\n }\n\n base = element;\n }\n};\n\npp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {\n var optionalSupported = this.options.ecmaVersion >= 11;\n var optional = optionalSupported && this.eat(types$1.questionDot);\n if (noCalls && optional) { this.raise(this.lastTokStart, \"Optional chaining cannot appear in the callee of new expressions\"); }\n\n var computed = this.eat(types$1.bracketL);\n if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {\n var node = this.startNodeAt(startPos, startLoc);\n node.object = base;\n if (computed) {\n node.property = this.parseExpression();\n this.expect(types$1.bracketR);\n } else if (this.type === types$1.privateId && base.type !== \"Super\") {\n node.property = this.parsePrivateIdent();\n } else {\n node.property = this.parseIdent(this.options.allowReserved !== \"never\");\n }\n node.computed = !!computed;\n if (optionalSupported) {\n node.optional = optional;\n }\n base = this.finishNode(node, \"MemberExpression\");\n } else if (!noCalls && this.eat(types$1.parenL)) {\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);\n if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n if (this.awaitIdentPos > 0)\n { this.raise(this.awaitIdentPos, \"Cannot use 'await' as identifier inside an async function\"); }\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)\n }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;\n var node$1 = this.startNodeAt(startPos, startLoc);\n node$1.callee = base;\n node$1.arguments = exprList;\n if (optionalSupported) {\n node$1.optional = optional;\n }\n base = this.finishNode(node$1, \"CallExpression\");\n } else if (this.type === types$1.backQuote) {\n if (optional || optionalChained) {\n this.raise(this.start, \"Optional chaining cannot appear in the tag of tagged template expressions\");\n }\n var node$2 = this.startNodeAt(startPos, startLoc);\n node$2.tag = base;\n node$2.quasi = this.parseTemplate({isTagged: true});\n base = this.finishNode(node$2, \"TaggedTemplateExpression\");\n }\n return base\n};\n\n// Parse an atomic expression — either a single token that is an\n// expression, an expression started by a keyword like `function` or\n// `new`, or an expression wrapped in punctuation like `()`, `[]`,\n// or `{}`.\n\npp$5.parseExprAtom = function(refDestructuringErrors, forInit) {\n // If a division operator appears in an expression position, the\n // tokenizer got confused, and we force it to read a regexp instead.\n if (this.type === types$1.slash) { this.readRegexp(); }\n\n var node, canBeArrow = this.potentialArrowAt === this.start;\n switch (this.type) {\n case types$1._super:\n if (!this.allowSuper)\n { this.raise(this.start, \"'super' keyword outside a method\"); }\n node = this.startNode();\n this.next();\n if (this.type === types$1.parenL && !this.allowDirectSuper)\n { this.raise(node.start, \"super() call outside constructor of a subclass\"); }\n // The `super` keyword can appear at below:\n // SuperProperty:\n // super [ Expression ]\n // super . IdentifierName\n // SuperCall:\n // super ( Arguments )\n if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)\n { this.unexpected(); }\n return this.finishNode(node, \"Super\")\n\n case types$1._this:\n node = this.startNode();\n this.next();\n return this.finishNode(node, \"ThisExpression\")\n\n case types$1.name:\n var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;\n var id = this.parseIdent(false);\n if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === \"async\" && !this.canInsertSemicolon() && this.eat(types$1._function)) {\n this.overrideContext(types.f_expr);\n return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)\n }\n if (canBeArrow && !this.canInsertSemicolon()) {\n if (this.eat(types$1.arrow))\n { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }\n if (this.options.ecmaVersion >= 8 && id.name === \"async\" && this.type === types$1.name && !containsEsc &&\n (!this.potentialArrowInForAwait || this.value !== \"of\" || this.containsEsc)) {\n id = this.parseIdent(false);\n if (this.canInsertSemicolon() || !this.eat(types$1.arrow))\n { this.unexpected(); }\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)\n }\n }\n return id\n\n case types$1.regexp:\n var value = this.value;\n node = this.parseLiteral(value.value);\n node.regex = {pattern: value.pattern, flags: value.flags};\n return node\n\n case types$1.num: case types$1.string:\n return this.parseLiteral(this.value)\n\n case types$1._null: case types$1._true: case types$1._false:\n node = this.startNode();\n node.value = this.type === types$1._null ? null : this.type === types$1._true;\n node.raw = this.type.keyword;\n this.next();\n return this.finishNode(node, \"Literal\")\n\n case types$1.parenL:\n var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);\n if (refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))\n { refDestructuringErrors.parenthesizedAssign = start; }\n if (refDestructuringErrors.parenthesizedBind < 0)\n { refDestructuringErrors.parenthesizedBind = start; }\n }\n return expr\n\n case types$1.bracketL:\n node = this.startNode();\n this.next();\n node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);\n return this.finishNode(node, \"ArrayExpression\")\n\n case types$1.braceL:\n this.overrideContext(types.b_expr);\n return this.parseObj(false, refDestructuringErrors)\n\n case types$1._function:\n node = this.startNode();\n this.next();\n return this.parseFunction(node, 0)\n\n case types$1._class:\n return this.parseClass(this.startNode(), false)\n\n case types$1._new:\n return this.parseNew()\n\n case types$1.backQuote:\n return this.parseTemplate()\n\n case types$1._import:\n if (this.options.ecmaVersion >= 11) {\n return this.parseExprImport()\n } else {\n return this.unexpected()\n }\n\n default:\n this.unexpected();\n }\n};\n\npp$5.parseExprImport = function() {\n var node = this.startNode();\n\n // Consume `import` as an identifier for `import.meta`.\n // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword import\"); }\n var meta = this.parseIdent(true);\n\n switch (this.type) {\n case types$1.parenL:\n return this.parseDynamicImport(node)\n case types$1.dot:\n node.meta = meta;\n return this.parseImportMeta(node)\n default:\n this.unexpected();\n }\n};\n\npp$5.parseDynamicImport = function(node) {\n this.next(); // skip `(`\n\n // Parse node.source.\n node.source = this.parseMaybeAssign();\n\n // Verify ending.\n if (!this.eat(types$1.parenR)) {\n var errorPos = this.start;\n if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {\n this.raiseRecoverable(errorPos, \"Trailing comma is not allowed in import()\");\n } else {\n this.unexpected(errorPos);\n }\n }\n\n return this.finishNode(node, \"ImportExpression\")\n};\n\npp$5.parseImportMeta = function(node) {\n this.next(); // skip `.`\n\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n\n if (node.property.name !== \"meta\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for import is 'import.meta'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'import.meta' must not contain escaped characters\"); }\n if (this.options.sourceType !== \"module\" && !this.options.allowImportExportEverywhere)\n { this.raiseRecoverable(node.start, \"Cannot use 'import.meta' outside a module\"); }\n\n return this.finishNode(node, \"MetaProperty\")\n};\n\npp$5.parseLiteral = function(value) {\n var node = this.startNode();\n node.value = value;\n node.raw = this.input.slice(this.start, this.end);\n if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, \"\"); }\n this.next();\n return this.finishNode(node, \"Literal\")\n};\n\npp$5.parseParenExpression = function() {\n this.expect(types$1.parenL);\n var val = this.parseExpression();\n this.expect(types$1.parenR);\n return val\n};\n\npp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {\n var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;\n if (this.options.ecmaVersion >= 6) {\n this.next();\n\n var innerStartPos = this.start, innerStartLoc = this.startLoc;\n var exprList = [], first = true, lastIsComma = false;\n var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;\n this.yieldPos = 0;\n this.awaitPos = 0;\n // Do not save awaitIdentPos to allow checking awaits nested in parameters\n while (this.type !== types$1.parenR) {\n first ? first = false : this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {\n lastIsComma = true;\n break\n } else if (this.type === types$1.ellipsis) {\n spreadStart = this.start;\n exprList.push(this.parseParenItem(this.parseRestBinding()));\n if (this.type === types$1.comma) { this.raise(this.start, \"Comma is not permitted after the rest element\"); }\n break\n } else {\n exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));\n }\n }\n var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;\n this.expect(types$1.parenR);\n\n if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) {\n this.checkPatternErrors(refDestructuringErrors, false);\n this.checkYieldAwaitInDefaultParams();\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n return this.parseParenArrowList(startPos, startLoc, exprList, forInit)\n }\n\n if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }\n if (spreadStart) { this.unexpected(spreadStart); }\n this.checkExpressionErrors(refDestructuringErrors, true);\n this.yieldPos = oldYieldPos || this.yieldPos;\n this.awaitPos = oldAwaitPos || this.awaitPos;\n\n if (exprList.length > 1) {\n val = this.startNodeAt(innerStartPos, innerStartLoc);\n val.expressions = exprList;\n this.finishNodeAt(val, \"SequenceExpression\", innerEndPos, innerEndLoc);\n } else {\n val = exprList[0];\n }\n } else {\n val = this.parseParenExpression();\n }\n\n if (this.options.preserveParens) {\n var par = this.startNodeAt(startPos, startLoc);\n par.expression = val;\n return this.finishNode(par, \"ParenthesizedExpression\")\n } else {\n return val\n }\n};\n\npp$5.parseParenItem = function(item) {\n return item\n};\n\npp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {\n return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)\n};\n\n// New's precedence is slightly tricky. It must allow its argument to\n// be a `[]` or dot subscript expression, but not a call — at least,\n// not without wrapping it in parentheses. Thus, it uses the noCalls\n// argument to parseSubscripts to prevent it from consuming the\n// argument list.\n\nvar empty = [];\n\npp$5.parseNew = function() {\n if (this.containsEsc) { this.raiseRecoverable(this.start, \"Escape sequence in keyword new\"); }\n var node = this.startNode();\n var meta = this.parseIdent(true);\n if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) {\n node.meta = meta;\n var containsEsc = this.containsEsc;\n node.property = this.parseIdent(true);\n if (node.property.name !== \"target\")\n { this.raiseRecoverable(node.property.start, \"The only valid meta property for new is 'new.target'\"); }\n if (containsEsc)\n { this.raiseRecoverable(node.start, \"'new.target' must not contain escaped characters\"); }\n if (!this.allowNewDotTarget)\n { this.raiseRecoverable(node.start, \"'new.target' can only be used in functions and class static block\"); }\n return this.finishNode(node, \"MetaProperty\")\n }\n var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import;\n node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);\n if (isImport && node.callee.type === \"ImportExpression\") {\n this.raise(startPos, \"Cannot use new with import()\");\n }\n if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }\n else { node.arguments = empty; }\n return this.finishNode(node, \"NewExpression\")\n};\n\n// Parse template expression.\n\npp$5.parseTemplateElement = function(ref) {\n var isTagged = ref.isTagged;\n\n var elem = this.startNode();\n if (this.type === types$1.invalidTemplate) {\n if (!isTagged) {\n this.raiseRecoverable(this.start, \"Bad escape sequence in untagged template literal\");\n }\n elem.value = {\n raw: this.value,\n cooked: null\n };\n } else {\n elem.value = {\n raw: this.input.slice(this.start, this.end).replace(/\\r\\n?/g, \"\\n\"),\n cooked: this.value\n };\n }\n this.next();\n elem.tail = this.type === types$1.backQuote;\n return this.finishNode(elem, \"TemplateElement\")\n};\n\npp$5.parseTemplate = function(ref) {\n if ( ref === void 0 ) ref = {};\n var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;\n\n var node = this.startNode();\n this.next();\n node.expressions = [];\n var curElt = this.parseTemplateElement({isTagged: isTagged});\n node.quasis = [curElt];\n while (!curElt.tail) {\n if (this.type === types$1.eof) { this.raise(this.pos, \"Unterminated template literal\"); }\n this.expect(types$1.dollarBraceL);\n node.expressions.push(this.parseExpression());\n this.expect(types$1.braceR);\n node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));\n }\n this.next();\n return this.finishNode(node, \"TemplateLiteral\")\n};\n\npp$5.isAsyncProp = function(prop) {\n return !prop.computed && prop.key.type === \"Identifier\" && prop.key.name === \"async\" &&\n (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&\n !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))\n};\n\n// Parse an object literal or binding pattern.\n\npp$5.parseObj = function(isPattern, refDestructuringErrors) {\n var node = this.startNode(), first = true, propHash = {};\n node.properties = [];\n this.next();\n while (!this.eat(types$1.braceR)) {\n if (!first) {\n this.expect(types$1.comma);\n if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }\n } else { first = false; }\n\n var prop = this.parseProperty(isPattern, refDestructuringErrors);\n if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }\n node.properties.push(prop);\n }\n return this.finishNode(node, isPattern ? \"ObjectPattern\" : \"ObjectExpression\")\n};\n\npp$5.parseProperty = function(isPattern, refDestructuringErrors) {\n var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;\n if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {\n if (isPattern) {\n prop.argument = this.parseIdent(false);\n if (this.type === types$1.comma) {\n this.raise(this.start, \"Comma is not permitted after the rest element\");\n }\n return this.finishNode(prop, \"RestElement\")\n }\n // To disallow parenthesized identifier via `this.toAssignable()`.\n if (this.type === types$1.parenL && refDestructuringErrors) {\n if (refDestructuringErrors.parenthesizedAssign < 0) {\n refDestructuringErrors.parenthesizedAssign = this.start;\n }\n if (refDestructuringErrors.parenthesizedBind < 0) {\n refDestructuringErrors.parenthesizedBind = this.start;\n }\n }\n // Parse argument.\n prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);\n // To disallow trailing comma via `this.toAssignable()`.\n if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {\n refDestructuringErrors.trailingComma = this.start;\n }\n // Finish\n return this.finishNode(prop, \"SpreadElement\")\n }\n if (this.options.ecmaVersion >= 6) {\n prop.method = false;\n prop.shorthand = false;\n if (isPattern || refDestructuringErrors) {\n startPos = this.start;\n startLoc = this.startLoc;\n }\n if (!isPattern)\n { isGenerator = this.eat(types$1.star); }\n }\n var containsEsc = this.containsEsc;\n this.parsePropertyName(prop);\n if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {\n isAsync = true;\n isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);\n this.parsePropertyName(prop, refDestructuringErrors);\n } else {\n isAsync = false;\n }\n this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);\n return this.finishNode(prop, \"Property\")\n};\n\npp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {\n if ((isGenerator || isAsync) && this.type === types$1.colon)\n { this.unexpected(); }\n\n if (this.eat(types$1.colon)) {\n prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);\n prop.kind = \"init\";\n } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {\n if (isPattern) { this.unexpected(); }\n prop.kind = \"init\";\n prop.method = true;\n prop.value = this.parseMethod(isGenerator, isAsync);\n } else if (!isPattern && !containsEsc &&\n this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === \"Identifier\" &&\n (prop.key.name === \"get\" || prop.key.name === \"set\") &&\n (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {\n if (isGenerator || isAsync) { this.unexpected(); }\n prop.kind = prop.key.name;\n this.parsePropertyName(prop);\n prop.value = this.parseMethod(false);\n var paramCount = prop.kind === \"get\" ? 0 : 1;\n if (prop.value.params.length !== paramCount) {\n var start = prop.value.start;\n if (prop.kind === \"get\")\n { this.raiseRecoverable(start, \"getter should have no params\"); }\n else\n { this.raiseRecoverable(start, \"setter should have exactly one param\"); }\n } else {\n if (prop.kind === \"set\" && prop.value.params[0].type === \"RestElement\")\n { this.raiseRecoverable(prop.value.params[0].start, \"Setter cannot use rest params\"); }\n }\n } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === \"Identifier\") {\n if (isGenerator || isAsync) { this.unexpected(); }\n this.checkUnreserved(prop.key);\n if (prop.key.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = startPos; }\n prop.kind = \"init\";\n if (isPattern) {\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else if (this.type === types$1.eq && refDestructuringErrors) {\n if (refDestructuringErrors.shorthandAssign < 0)\n { refDestructuringErrors.shorthandAssign = this.start; }\n prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));\n } else {\n prop.value = this.copyNode(prop.key);\n }\n prop.shorthand = true;\n } else { this.unexpected(); }\n};\n\npp$5.parsePropertyName = function(prop) {\n if (this.options.ecmaVersion >= 6) {\n if (this.eat(types$1.bracketL)) {\n prop.computed = true;\n prop.key = this.parseMaybeAssign();\n this.expect(types$1.bracketR);\n return prop.key\n } else {\n prop.computed = false;\n }\n }\n return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== \"never\")\n};\n\n// Initialize empty function node.\n\npp$5.initFunction = function(node) {\n node.id = null;\n if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }\n if (this.options.ecmaVersion >= 8) { node.async = false; }\n};\n\n// Parse object or class method.\n\npp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {\n var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.initFunction(node);\n if (this.options.ecmaVersion >= 6)\n { node.generator = isGenerator; }\n if (this.options.ecmaVersion >= 8)\n { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));\n\n this.expect(types$1.parenL);\n node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);\n this.checkYieldAwaitInDefaultParams();\n this.parseFunctionBody(node, false, true, false);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"FunctionExpression\")\n};\n\n// Parse arrow function expression with given parameters.\n\npp$5.parseArrowExpression = function(node, params, isAsync, forInit) {\n var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;\n\n this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);\n this.initFunction(node);\n if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }\n\n this.yieldPos = 0;\n this.awaitPos = 0;\n this.awaitIdentPos = 0;\n\n node.params = this.toAssignableList(params, true);\n this.parseFunctionBody(node, true, false, forInit);\n\n this.yieldPos = oldYieldPos;\n this.awaitPos = oldAwaitPos;\n this.awaitIdentPos = oldAwaitIdentPos;\n return this.finishNode(node, \"ArrowFunctionExpression\")\n};\n\n// Parse function body and check parameters.\n\npp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {\n var isExpression = isArrowFunction && this.type !== types$1.braceL;\n var oldStrict = this.strict, useStrict = false;\n\n if (isExpression) {\n node.body = this.parseMaybeAssign(forInit);\n node.expression = true;\n this.checkParams(node, false);\n } else {\n var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);\n if (!oldStrict || nonSimple) {\n useStrict = this.strictDirective(this.end);\n // If this is a strict mode function, verify that argument names\n // are not repeated, and it does not try to bind the words `eval`\n // or `arguments`.\n if (useStrict && nonSimple)\n { this.raiseRecoverable(node.start, \"Illegal 'use strict' directive in function with non-simple parameter list\"); }\n }\n // Start a new scope with regard to labels and the `inFunction`\n // flag (restore them to their old value afterwards).\n var oldLabels = this.labels;\n this.labels = [];\n if (useStrict) { this.strict = true; }\n\n // Add the params to varDeclaredNames to ensure that an error is thrown\n // if a let/const declaration in the function clashes with one of the params.\n this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));\n // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'\n if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }\n node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);\n node.expression = false;\n this.adaptDirectivePrologue(node.body.body);\n this.labels = oldLabels;\n }\n this.exitScope();\n};\n\npp$5.isSimpleParamList = function(params) {\n for (var i = 0, list = params; i < list.length; i += 1)\n {\n var param = list[i];\n\n if (param.type !== \"Identifier\") { return false\n } }\n return true\n};\n\n// Checks function params for various disallowed patterns such as using \"eval\"\n// or \"arguments\" and duplicate parameters.\n\npp$5.checkParams = function(node, allowDuplicates) {\n var nameHash = Object.create(null);\n for (var i = 0, list = node.params; i < list.length; i += 1)\n {\n var param = list[i];\n\n this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);\n }\n};\n\n// Parses a comma-separated list of expressions, and returns them as\n// an array. `close` is the token type that ends the list, and\n// `allowEmpty` can be turned on to allow subsequent commas with\n// nothing in between them to be parsed as `null` (which is needed\n// for array literals).\n\npp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {\n var elts = [], first = true;\n while (!this.eat(close)) {\n if (!first) {\n this.expect(types$1.comma);\n if (allowTrailingComma && this.afterTrailingComma(close)) { break }\n } else { first = false; }\n\n var elt = (void 0);\n if (allowEmpty && this.type === types$1.comma)\n { elt = null; }\n else if (this.type === types$1.ellipsis) {\n elt = this.parseSpread(refDestructuringErrors);\n if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)\n { refDestructuringErrors.trailingComma = this.start; }\n } else {\n elt = this.parseMaybeAssign(false, refDestructuringErrors);\n }\n elts.push(elt);\n }\n return elts\n};\n\npp$5.checkUnreserved = function(ref) {\n var start = ref.start;\n var end = ref.end;\n var name = ref.name;\n\n if (this.inGenerator && name === \"yield\")\n { this.raiseRecoverable(start, \"Cannot use 'yield' as identifier inside a generator\"); }\n if (this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use 'await' as identifier inside an async function\"); }\n if (this.currentThisScope().inClassFieldInit && name === \"arguments\")\n { this.raiseRecoverable(start, \"Cannot use 'arguments' in class field initializer\"); }\n if (this.inClassStaticBlock && (name === \"arguments\" || name === \"await\"))\n { this.raise(start, (\"Cannot use \" + name + \" in class static initialization block\")); }\n if (this.keywords.test(name))\n { this.raise(start, (\"Unexpected keyword '\" + name + \"'\")); }\n if (this.options.ecmaVersion < 6 &&\n this.input.slice(start, end).indexOf(\"\\\\\") !== -1) { return }\n var re = this.strict ? this.reservedWordsStrict : this.reservedWords;\n if (re.test(name)) {\n if (!this.inAsync && name === \"await\")\n { this.raiseRecoverable(start, \"Cannot use keyword 'await' outside an async function\"); }\n this.raiseRecoverable(start, (\"The keyword '\" + name + \"' is reserved\"));\n }\n};\n\n// Parse the next token as an identifier. If `liberal` is true (used\n// when parsing properties), it will also convert keywords into\n// identifiers.\n\npp$5.parseIdent = function(liberal, isBinding) {\n var node = this.startNode();\n if (this.type === types$1.name) {\n node.name = this.value;\n } else if (this.type.keyword) {\n node.name = this.type.keyword;\n\n // To fix https://github.com/acornjs/acorn/issues/575\n // `class` and `function` keywords push new context into this.context.\n // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.\n // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword\n if ((node.name === \"class\" || node.name === \"function\") &&\n (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {\n this.context.pop();\n }\n } else {\n this.unexpected();\n }\n this.next(!!liberal);\n this.finishNode(node, \"Identifier\");\n if (!liberal) {\n this.checkUnreserved(node);\n if (node.name === \"await\" && !this.awaitIdentPos)\n { this.awaitIdentPos = node.start; }\n }\n return node\n};\n\npp$5.parsePrivateIdent = function() {\n var node = this.startNode();\n if (this.type === types$1.privateId) {\n node.name = this.value;\n } else {\n this.unexpected();\n }\n this.next();\n this.finishNode(node, \"PrivateIdentifier\");\n\n // For validating existence\n if (this.privateNameStack.length === 0) {\n this.raise(node.start, (\"Private field '#\" + (node.name) + \"' must be declared in an enclosing class\"));\n } else {\n this.privateNameStack[this.privateNameStack.length - 1].used.push(node);\n }\n\n return node\n};\n\n// Parses yield expression inside generator.\n\npp$5.parseYield = function(forInit) {\n if (!this.yieldPos) { this.yieldPos = this.start; }\n\n var node = this.startNode();\n this.next();\n if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {\n node.delegate = false;\n node.argument = null;\n } else {\n node.delegate = this.eat(types$1.star);\n node.argument = this.parseMaybeAssign(forInit);\n }\n return this.finishNode(node, \"YieldExpression\")\n};\n\npp$5.parseAwait = function(forInit) {\n if (!this.awaitPos) { this.awaitPos = this.start; }\n\n var node = this.startNode();\n this.next();\n node.argument = this.parseMaybeUnary(null, true, false, forInit);\n return this.finishNode(node, \"AwaitExpression\")\n};\n\nvar pp$4 = Parser.prototype;\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\npp$4.raise = function(pos, message) {\n var loc = getLineInfo(this.input, pos);\n message += \" (\" + loc.line + \":\" + loc.column + \")\";\n var err = new SyntaxError(message);\n err.pos = pos; err.loc = loc; err.raisedAt = this.pos;\n throw err\n};\n\npp$4.raiseRecoverable = pp$4.raise;\n\npp$4.curPosition = function() {\n if (this.options.locations) {\n return new Position(this.curLine, this.pos - this.lineStart)\n }\n};\n\nvar pp$3 = Parser.prototype;\n\nvar Scope = function Scope(flags) {\n this.flags = flags;\n // A list of var-declared names in the current lexical scope\n this.var = [];\n // A list of lexically-declared names in the current lexical scope\n this.lexical = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n this.functions = [];\n // A switch to disallow the identifier reference 'arguments'\n this.inClassFieldInit = false;\n};\n\n// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.\n\npp$3.enterScope = function(flags) {\n this.scopeStack.push(new Scope(flags));\n};\n\npp$3.exitScope = function() {\n this.scopeStack.pop();\n};\n\n// The spec says:\n// > At the top level of a function, or script, function declarations are\n// > treated like var declarations rather than like lexical declarations.\npp$3.treatFunctionsAsVarInScope = function(scope) {\n return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)\n};\n\npp$3.declareName = function(name, bindingType, pos) {\n var redeclared = false;\n if (bindingType === BIND_LEXICAL) {\n var scope = this.currentScope();\n redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;\n scope.lexical.push(name);\n if (this.inModule && (scope.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n } else if (bindingType === BIND_SIMPLE_CATCH) {\n var scope$1 = this.currentScope();\n scope$1.lexical.push(name);\n } else if (bindingType === BIND_FUNCTION) {\n var scope$2 = this.currentScope();\n if (this.treatFunctionsAsVar)\n { redeclared = scope$2.lexical.indexOf(name) > -1; }\n else\n { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }\n scope$2.functions.push(name);\n } else {\n for (var i = this.scopeStack.length - 1; i >= 0; --i) {\n var scope$3 = this.scopeStack[i];\n if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||\n !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {\n redeclared = true;\n break\n }\n scope$3.var.push(name);\n if (this.inModule && (scope$3.flags & SCOPE_TOP))\n { delete this.undefinedExports[name]; }\n if (scope$3.flags & SCOPE_VAR) { break }\n }\n }\n if (redeclared) { this.raiseRecoverable(pos, (\"Identifier '\" + name + \"' has already been declared\")); }\n};\n\npp$3.checkLocalExport = function(id) {\n // scope.functions must be empty as Module code is always strict.\n if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1) {\n this.undefinedExports[id.name] = id;\n }\n};\n\npp$3.currentScope = function() {\n return this.scopeStack[this.scopeStack.length - 1]\n};\n\npp$3.currentVarScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR) { return scope }\n }\n};\n\n// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\npp$3.currentThisScope = function() {\n for (var i = this.scopeStack.length - 1;; i--) {\n var scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }\n }\n};\n\nvar Node = function Node(parser, pos, loc) {\n this.type = \"\";\n this.start = pos;\n this.end = 0;\n if (parser.options.locations)\n { this.loc = new SourceLocation(parser, loc); }\n if (parser.options.directSourceFile)\n { this.sourceFile = parser.options.directSourceFile; }\n if (parser.options.ranges)\n { this.range = [pos, 0]; }\n};\n\n// Start an AST node, attaching a start offset.\n\nvar pp$2 = Parser.prototype;\n\npp$2.startNode = function() {\n return new Node(this, this.start, this.startLoc)\n};\n\npp$2.startNodeAt = function(pos, loc) {\n return new Node(this, pos, loc)\n};\n\n// Finish an AST node, adding `type` and `end` properties.\n\nfunction finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n}\n\npp$2.finishNode = function(node, type) {\n return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)\n};\n\n// Finish node at given position\n\npp$2.finishNodeAt = function(node, type, pos, loc) {\n return finishNodeAt.call(this, node, type, pos, loc)\n};\n\npp$2.copyNode = function(node) {\n var newNode = new Node(this, node.start, this.startLoc);\n for (var prop in node) { newNode[prop] = node[prop]; }\n return newNode\n};\n\n// This file contains Unicode properties extracted from the ECMAScript\n// specification. The lists are extracted like so:\n// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)\n\n// #table-binary-unicode-properties\nvar ecma9BinaryProperties = \"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS\";\nvar ecma10BinaryProperties = ecma9BinaryProperties + \" Extended_Pictographic\";\nvar ecma11BinaryProperties = ecma10BinaryProperties;\nvar ecma12BinaryProperties = ecma11BinaryProperties + \" EBase EComp EMod EPres ExtPict\";\nvar ecma13BinaryProperties = ecma12BinaryProperties;\nvar unicodeBinaryProperties = {\n 9: ecma9BinaryProperties,\n 10: ecma10BinaryProperties,\n 11: ecma11BinaryProperties,\n 12: ecma12BinaryProperties,\n 13: ecma13BinaryProperties\n};\n\n// #table-unicode-general-category-values\nvar unicodeGeneralCategoryValues = \"Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu\";\n\n// #table-unicode-script-values\nvar ecma9ScriptValues = \"Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb\";\nvar ecma10ScriptValues = ecma9ScriptValues + \" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd\";\nvar ecma11ScriptValues = ecma10ScriptValues + \" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho\";\nvar ecma12ScriptValues = ecma11ScriptValues + \" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi\";\nvar ecma13ScriptValues = ecma12ScriptValues + \" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith\";\nvar unicodeScriptValues = {\n 9: ecma9ScriptValues,\n 10: ecma10ScriptValues,\n 11: ecma11ScriptValues,\n 12: ecma12ScriptValues,\n 13: ecma13ScriptValues\n};\n\nvar data = {};\nfunction buildUnicodeData(ecmaVersion) {\n var d = data[ecmaVersion] = {\n binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + \" \" + unicodeGeneralCategoryValues),\n nonBinary: {\n General_Category: wordsRegexp(unicodeGeneralCategoryValues),\n Script: wordsRegexp(unicodeScriptValues[ecmaVersion])\n }\n };\n d.nonBinary.Script_Extensions = d.nonBinary.Script;\n\n d.nonBinary.gc = d.nonBinary.General_Category;\n d.nonBinary.sc = d.nonBinary.Script;\n d.nonBinary.scx = d.nonBinary.Script_Extensions;\n}\n\nfor (var i = 0, list = [9, 10, 11, 12, 13]; i < list.length; i += 1) {\n var ecmaVersion = list[i];\n\n buildUnicodeData(ecmaVersion);\n}\n\nvar pp$1 = Parser.prototype;\n\nvar RegExpValidationState = function RegExpValidationState(parser) {\n this.parser = parser;\n this.validFlags = \"gim\" + (parser.options.ecmaVersion >= 6 ? \"uy\" : \"\") + (parser.options.ecmaVersion >= 9 ? \"s\" : \"\") + (parser.options.ecmaVersion >= 13 ? \"d\" : \"\");\n this.unicodeProperties = data[parser.options.ecmaVersion >= 13 ? 13 : parser.options.ecmaVersion];\n this.source = \"\";\n this.flags = \"\";\n this.start = 0;\n this.switchU = false;\n this.switchN = false;\n this.pos = 0;\n this.lastIntValue = 0;\n this.lastStringValue = \"\";\n this.lastAssertionIsQuantifiable = false;\n this.numCapturingParens = 0;\n this.maxBackReference = 0;\n this.groupNames = [];\n this.backReferenceNames = [];\n};\n\nRegExpValidationState.prototype.reset = function reset (start, pattern, flags) {\n var unicode = flags.indexOf(\"u\") !== -1;\n this.start = start | 0;\n this.source = pattern + \"\";\n this.flags = flags;\n this.switchU = unicode && this.parser.options.ecmaVersion >= 6;\n this.switchN = unicode && this.parser.options.ecmaVersion >= 9;\n};\n\nRegExpValidationState.prototype.raise = function raise (message) {\n this.parser.raiseRecoverable(this.start, (\"Invalid regular expression: /\" + (this.source) + \"/: \" + message));\n};\n\n// If u flag is given, this returns the code point at the index (it combines a surrogate pair).\n// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).\nRegExpValidationState.prototype.at = function at (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return -1\n }\n var c = s.charCodeAt(i);\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {\n return c\n }\n var next = s.charCodeAt(i + 1);\n return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c\n};\n\nRegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var s = this.source;\n var l = s.length;\n if (i >= l) {\n return l\n }\n var c = s.charCodeAt(i), next;\n if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||\n (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {\n return i + 1\n }\n return i + 2\n};\n\nRegExpValidationState.prototype.current = function current (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.pos, forceU)\n};\n\nRegExpValidationState.prototype.lookahead = function lookahead (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n return this.at(this.nextIndex(this.pos, forceU), forceU)\n};\n\nRegExpValidationState.prototype.advance = function advance (forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n this.pos = this.nextIndex(this.pos, forceU);\n};\n\nRegExpValidationState.prototype.eat = function eat (ch, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n if (this.current(forceU) === ch) {\n this.advance(forceU);\n return true\n }\n return false\n};\n\n/**\n * Validate the flags part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpFlags = function(state) {\n var validFlags = state.validFlags;\n var flags = state.flags;\n\n for (var i = 0; i < flags.length; i++) {\n var flag = flags.charAt(i);\n if (validFlags.indexOf(flag) === -1) {\n this.raise(state.start, \"Invalid regular expression flag\");\n }\n if (flags.indexOf(flag, i + 1) > -1) {\n this.raise(state.start, \"Duplicate regular expression flag\");\n }\n }\n};\n\n/**\n * Validate the pattern part of a given RegExpLiteral.\n *\n * @param {RegExpValidationState} state The state to validate RegExp.\n * @returns {void}\n */\npp$1.validateRegExpPattern = function(state) {\n this.regexp_pattern(state);\n\n // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of\n // parsing contains a |GroupName|, reparse with the goal symbol\n // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*\n // exception if _P_ did not conform to the grammar, if any elements of _P_\n // were not matched by the parse, or if any Early Error conditions exist.\n if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {\n state.switchN = true;\n this.regexp_pattern(state);\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern\npp$1.regexp_pattern = function(state) {\n state.pos = 0;\n state.lastIntValue = 0;\n state.lastStringValue = \"\";\n state.lastAssertionIsQuantifiable = false;\n state.numCapturingParens = 0;\n state.maxBackReference = 0;\n state.groupNames.length = 0;\n state.backReferenceNames.length = 0;\n\n this.regexp_disjunction(state);\n\n if (state.pos !== state.source.length) {\n // Make the same messages as V8.\n if (state.eat(0x29 /* ) */)) {\n state.raise(\"Unmatched ')'\");\n }\n if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n }\n if (state.maxBackReference > state.numCapturingParens) {\n state.raise(\"Invalid escape\");\n }\n for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {\n var name = list[i];\n\n if (state.groupNames.indexOf(name) === -1) {\n state.raise(\"Invalid named capture referenced\");\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction\npp$1.regexp_disjunction = function(state) {\n this.regexp_alternative(state);\n while (state.eat(0x7C /* | */)) {\n this.regexp_alternative(state);\n }\n\n // Make the same message as V8.\n if (this.regexp_eatQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n if (state.eat(0x7B /* { */)) {\n state.raise(\"Lone quantifier brackets\");\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative\npp$1.regexp_alternative = function(state) {\n while (state.pos < state.source.length && this.regexp_eatTerm(state))\n { }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term\npp$1.regexp_eatTerm = function(state) {\n if (this.regexp_eatAssertion(state)) {\n // Handle `QuantifiableAssertion Quantifier` alternative.\n // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion\n // is a QuantifiableAssertion.\n if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {\n // Make the same message as V8.\n if (state.switchU) {\n state.raise(\"Invalid quantifier\");\n }\n }\n return true\n }\n\n if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {\n this.regexp_eatQuantifier(state);\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion\npp$1.regexp_eatAssertion = function(state) {\n var start = state.pos;\n state.lastAssertionIsQuantifiable = false;\n\n // ^, $\n if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {\n return true\n }\n\n // \\b \\B\n if (state.eat(0x5C /* \\ */)) {\n if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {\n return true\n }\n state.pos = start;\n }\n\n // Lookahead / Lookbehind\n if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {\n var lookbehind = false;\n if (this.options.ecmaVersion >= 9) {\n lookbehind = state.eat(0x3C /* < */);\n }\n if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {\n this.regexp_disjunction(state);\n if (!state.eat(0x29 /* ) */)) {\n state.raise(\"Unterminated group\");\n }\n state.lastAssertionIsQuantifiable = !lookbehind;\n return true\n }\n }\n\n state.pos = start;\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier\npp$1.regexp_eatQuantifier = function(state, noError) {\n if ( noError === void 0 ) noError = false;\n\n if (this.regexp_eatQuantifierPrefix(state, noError)) {\n state.eat(0x3F /* ? */);\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix\npp$1.regexp_eatQuantifierPrefix = function(state, noError) {\n return (\n state.eat(0x2A /* * */) ||\n state.eat(0x2B /* + */) ||\n state.eat(0x3F /* ? */) ||\n this.regexp_eatBracedQuantifier(state, noError)\n )\n};\npp$1.regexp_eatBracedQuantifier = function(state, noError) {\n var start = state.pos;\n if (state.eat(0x7B /* { */)) {\n var min = 0, max = -1;\n if (this.regexp_eatDecimalDigits(state)) {\n min = state.lastIntValue;\n if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {\n max = state.lastIntValue;\n }\n if (state.eat(0x7D /* } */)) {\n // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term\n if (max !== -1 && max < min && !noError) {\n state.raise(\"numbers out of order in {} quantifier\");\n }\n return true\n }\n }\n if (state.switchU && !noError) {\n state.raise(\"Incomplete quantifier\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom\npp$1.regexp_eatAtom = function(state) {\n return (\n this.regexp_eatPatternCharacters(state) ||\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state)\n )\n};\npp$1.regexp_eatReverseSolidusAtomEscape = function(state) {\n var start = state.pos;\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatAtomEscape(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatUncapturingGroup = function(state) {\n var start = state.pos;\n if (state.eat(0x28 /* ( */)) {\n if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n return true\n }\n state.raise(\"Unterminated group\");\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatCapturingGroup = function(state) {\n if (state.eat(0x28 /* ( */)) {\n if (this.options.ecmaVersion >= 9) {\n this.regexp_groupSpecifier(state);\n } else if (state.current() === 0x3F /* ? */) {\n state.raise(\"Invalid group\");\n }\n this.regexp_disjunction(state);\n if (state.eat(0x29 /* ) */)) {\n state.numCapturingParens += 1;\n return true\n }\n state.raise(\"Unterminated group\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom\npp$1.regexp_eatExtendedAtom = function(state) {\n return (\n state.eat(0x2E /* . */) ||\n this.regexp_eatReverseSolidusAtomEscape(state) ||\n this.regexp_eatCharacterClass(state) ||\n this.regexp_eatUncapturingGroup(state) ||\n this.regexp_eatCapturingGroup(state) ||\n this.regexp_eatInvalidBracedQuantifier(state) ||\n this.regexp_eatExtendedPatternCharacter(state)\n )\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier\npp$1.regexp_eatInvalidBracedQuantifier = function(state) {\n if (this.regexp_eatBracedQuantifier(state, true)) {\n state.raise(\"Nothing to repeat\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter\npp$1.regexp_eatSyntaxCharacter = function(state) {\n var ch = state.current();\n if (isSyntaxCharacter(ch)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n return false\n};\nfunction isSyntaxCharacter(ch) {\n return (\n ch === 0x24 /* $ */ ||\n ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||\n ch === 0x2E /* . */ ||\n ch === 0x3F /* ? */ ||\n ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||\n ch >= 0x7B /* { */ && ch <= 0x7D /* } */\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter\n// But eat eager.\npp$1.regexp_eatPatternCharacters = function(state) {\n var start = state.pos;\n var ch = 0;\n while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {\n state.advance();\n }\n return state.pos !== start\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter\npp$1.regexp_eatExtendedPatternCharacter = function(state) {\n var ch = state.current();\n if (\n ch !== -1 &&\n ch !== 0x24 /* $ */ &&\n !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&\n ch !== 0x2E /* . */ &&\n ch !== 0x3F /* ? */ &&\n ch !== 0x5B /* [ */ &&\n ch !== 0x5E /* ^ */ &&\n ch !== 0x7C /* | */\n ) {\n state.advance();\n return true\n }\n return false\n};\n\n// GroupSpecifier ::\n// [empty]\n// `?` GroupName\npp$1.regexp_groupSpecifier = function(state) {\n if (state.eat(0x3F /* ? */)) {\n if (this.regexp_eatGroupName(state)) {\n if (state.groupNames.indexOf(state.lastStringValue) !== -1) {\n state.raise(\"Duplicate capture group name\");\n }\n state.groupNames.push(state.lastStringValue);\n return\n }\n state.raise(\"Invalid group\");\n }\n};\n\n// GroupName ::\n// `<` RegExpIdentifierName `>`\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatGroupName = function(state) {\n state.lastStringValue = \"\";\n if (state.eat(0x3C /* < */)) {\n if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {\n return true\n }\n state.raise(\"Invalid capture group name\");\n }\n return false\n};\n\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierPart\n// Note: this updates `state.lastStringValue` property with the eaten name.\npp$1.regexp_eatRegExpIdentifierName = function(state) {\n state.lastStringValue = \"\";\n if (this.regexp_eatRegExpIdentifierStart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n while (this.regexp_eatRegExpIdentifierPart(state)) {\n state.lastStringValue += codePointToString(state.lastIntValue);\n }\n return true\n }\n return false\n};\n\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\npp$1.regexp_eatRegExpIdentifierStart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierStart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierStart(ch) {\n return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */\n}\n\n// RegExpIdentifierPart ::\n// UnicodeIDContinue\n// `$`\n// `_`\n// `\\` RegExpUnicodeEscapeSequence[+U]\n// \n// \npp$1.regexp_eatRegExpIdentifierPart = function(state) {\n var start = state.pos;\n var forceU = this.options.ecmaVersion >= 11;\n var ch = state.current(forceU);\n state.advance(forceU);\n\n if (ch === 0x5C /* \\ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {\n ch = state.lastIntValue;\n }\n if (isRegExpIdentifierPart(ch)) {\n state.lastIntValue = ch;\n return true\n }\n\n state.pos = start;\n return false\n};\nfunction isRegExpIdentifierPart(ch) {\n return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape\npp$1.regexp_eatAtomEscape = function(state) {\n if (\n this.regexp_eatBackReference(state) ||\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state) ||\n (state.switchN && this.regexp_eatKGroupName(state))\n ) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n if (state.current() === 0x63 /* c */) {\n state.raise(\"Invalid unicode escape\");\n }\n state.raise(\"Invalid escape\");\n }\n return false\n};\npp$1.regexp_eatBackReference = function(state) {\n var start = state.pos;\n if (this.regexp_eatDecimalEscape(state)) {\n var n = state.lastIntValue;\n if (state.switchU) {\n // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape\n if (n > state.maxBackReference) {\n state.maxBackReference = n;\n }\n return true\n }\n if (n <= state.numCapturingParens) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatKGroupName = function(state) {\n if (state.eat(0x6B /* k */)) {\n if (this.regexp_eatGroupName(state)) {\n state.backReferenceNames.push(state.lastStringValue);\n return true\n }\n state.raise(\"Invalid named reference\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape\npp$1.regexp_eatCharacterEscape = function(state) {\n return (\n this.regexp_eatControlEscape(state) ||\n this.regexp_eatCControlLetter(state) ||\n this.regexp_eatZero(state) ||\n this.regexp_eatHexEscapeSequence(state) ||\n this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||\n (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||\n this.regexp_eatIdentityEscape(state)\n )\n};\npp$1.regexp_eatCControlLetter = function(state) {\n var start = state.pos;\n if (state.eat(0x63 /* c */)) {\n if (this.regexp_eatControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n return false\n};\npp$1.regexp_eatZero = function(state) {\n if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {\n state.lastIntValue = 0;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape\npp$1.regexp_eatControlEscape = function(state) {\n var ch = state.current();\n if (ch === 0x74 /* t */) {\n state.lastIntValue = 0x09; /* \\t */\n state.advance();\n return true\n }\n if (ch === 0x6E /* n */) {\n state.lastIntValue = 0x0A; /* \\n */\n state.advance();\n return true\n }\n if (ch === 0x76 /* v */) {\n state.lastIntValue = 0x0B; /* \\v */\n state.advance();\n return true\n }\n if (ch === 0x66 /* f */) {\n state.lastIntValue = 0x0C; /* \\f */\n state.advance();\n return true\n }\n if (ch === 0x72 /* r */) {\n state.lastIntValue = 0x0D; /* \\r */\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter\npp$1.regexp_eatControlLetter = function(state) {\n var ch = state.current();\n if (isControlLetter(ch)) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\nfunction isControlLetter(ch) {\n return (\n (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||\n (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)\n )\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence\npp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {\n if ( forceU === void 0 ) forceU = false;\n\n var start = state.pos;\n var switchU = forceU || state.switchU;\n\n if (state.eat(0x75 /* u */)) {\n if (this.regexp_eatFixedHexDigits(state, 4)) {\n var lead = state.lastIntValue;\n if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {\n var leadSurrogateEnd = state.pos;\n if (state.eat(0x5C /* \\ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {\n var trail = state.lastIntValue;\n if (trail >= 0xDC00 && trail <= 0xDFFF) {\n state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n return true\n }\n }\n state.pos = leadSurrogateEnd;\n state.lastIntValue = lead;\n }\n return true\n }\n if (\n switchU &&\n state.eat(0x7B /* { */) &&\n this.regexp_eatHexDigits(state) &&\n state.eat(0x7D /* } */) &&\n isValidUnicode(state.lastIntValue)\n ) {\n return true\n }\n if (switchU) {\n state.raise(\"Invalid unicode escape\");\n }\n state.pos = start;\n }\n\n return false\n};\nfunction isValidUnicode(ch) {\n return ch >= 0 && ch <= 0x10FFFF\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape\npp$1.regexp_eatIdentityEscape = function(state) {\n if (state.switchU) {\n if (this.regexp_eatSyntaxCharacter(state)) {\n return true\n }\n if (state.eat(0x2F /* / */)) {\n state.lastIntValue = 0x2F; /* / */\n return true\n }\n return false\n }\n\n var ch = state.current();\n if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape\npp$1.regexp_eatDecimalEscape = function(state) {\n state.lastIntValue = 0;\n var ch = state.current();\n if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {\n do {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape\npp$1.regexp_eatCharacterClassEscape = function(state) {\n var ch = state.current();\n\n if (isCharacterClassEscape(ch)) {\n state.lastIntValue = -1;\n state.advance();\n return true\n }\n\n if (\n state.switchU &&\n this.options.ecmaVersion >= 9 &&\n (ch === 0x50 /* P */ || ch === 0x70 /* p */)\n ) {\n state.lastIntValue = -1;\n state.advance();\n if (\n state.eat(0x7B /* { */) &&\n this.regexp_eatUnicodePropertyValueExpression(state) &&\n state.eat(0x7D /* } */)\n ) {\n return true\n }\n state.raise(\"Invalid property name\");\n }\n\n return false\n};\nfunction isCharacterClassEscape(ch) {\n return (\n ch === 0x64 /* d */ ||\n ch === 0x44 /* D */ ||\n ch === 0x73 /* s */ ||\n ch === 0x53 /* S */ ||\n ch === 0x77 /* w */ ||\n ch === 0x57 /* W */\n )\n}\n\n// UnicodePropertyValueExpression ::\n// UnicodePropertyName `=` UnicodePropertyValue\n// LoneUnicodePropertyNameOrValue\npp$1.regexp_eatUnicodePropertyValueExpression = function(state) {\n var start = state.pos;\n\n // UnicodePropertyName `=` UnicodePropertyValue\n if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {\n var name = state.lastStringValue;\n if (this.regexp_eatUnicodePropertyValue(state)) {\n var value = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameAndValue(state, name, value);\n return true\n }\n }\n state.pos = start;\n\n // LoneUnicodePropertyNameOrValue\n if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {\n var nameOrValue = state.lastStringValue;\n this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);\n return true\n }\n return false\n};\npp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {\n if (!hasOwn(state.unicodeProperties.nonBinary, name))\n { state.raise(\"Invalid property name\"); }\n if (!state.unicodeProperties.nonBinary[name].test(value))\n { state.raise(\"Invalid property value\"); }\n};\npp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {\n if (!state.unicodeProperties.binary.test(nameOrValue))\n { state.raise(\"Invalid property name\"); }\n};\n\n// UnicodePropertyName ::\n// UnicodePropertyNameCharacters\npp$1.regexp_eatUnicodePropertyName = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyNameCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\nfunction isUnicodePropertyNameCharacter(ch) {\n return isControlLetter(ch) || ch === 0x5F /* _ */\n}\n\n// UnicodePropertyValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatUnicodePropertyValue = function(state) {\n var ch = 0;\n state.lastStringValue = \"\";\n while (isUnicodePropertyValueCharacter(ch = state.current())) {\n state.lastStringValue += codePointToString(ch);\n state.advance();\n }\n return state.lastStringValue !== \"\"\n};\nfunction isUnicodePropertyValueCharacter(ch) {\n return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)\n}\n\n// LoneUnicodePropertyNameOrValue ::\n// UnicodePropertyValueCharacters\npp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {\n return this.regexp_eatUnicodePropertyValue(state)\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass\npp$1.regexp_eatCharacterClass = function(state) {\n if (state.eat(0x5B /* [ */)) {\n state.eat(0x5E /* ^ */);\n this.regexp_classRanges(state);\n if (state.eat(0x5D /* ] */)) {\n return true\n }\n // Unreachable since it threw \"unterminated regular expression\" error before.\n state.raise(\"Unterminated character class\");\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges\n// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash\npp$1.regexp_classRanges = function(state) {\n while (this.regexp_eatClassAtom(state)) {\n var left = state.lastIntValue;\n if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {\n var right = state.lastIntValue;\n if (state.switchU && (left === -1 || right === -1)) {\n state.raise(\"Invalid character class\");\n }\n if (left !== -1 && right !== -1 && left > right) {\n state.raise(\"Range out of order in character class\");\n }\n }\n }\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom\n// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash\npp$1.regexp_eatClassAtom = function(state) {\n var start = state.pos;\n\n if (state.eat(0x5C /* \\ */)) {\n if (this.regexp_eatClassEscape(state)) {\n return true\n }\n if (state.switchU) {\n // Make the same message as V8.\n var ch$1 = state.current();\n if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {\n state.raise(\"Invalid class escape\");\n }\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n\n var ch = state.current();\n if (ch !== 0x5D /* ] */) {\n state.lastIntValue = ch;\n state.advance();\n return true\n }\n\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape\npp$1.regexp_eatClassEscape = function(state) {\n var start = state.pos;\n\n if (state.eat(0x62 /* b */)) {\n state.lastIntValue = 0x08; /* */\n return true\n }\n\n if (state.switchU && state.eat(0x2D /* - */)) {\n state.lastIntValue = 0x2D; /* - */\n return true\n }\n\n if (!state.switchU && state.eat(0x63 /* c */)) {\n if (this.regexp_eatClassControlLetter(state)) {\n return true\n }\n state.pos = start;\n }\n\n return (\n this.regexp_eatCharacterClassEscape(state) ||\n this.regexp_eatCharacterEscape(state)\n )\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter\npp$1.regexp_eatClassControlLetter = function(state) {\n var ch = state.current();\n if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {\n state.lastIntValue = ch % 0x20;\n state.advance();\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatHexEscapeSequence = function(state) {\n var start = state.pos;\n if (state.eat(0x78 /* x */)) {\n if (this.regexp_eatFixedHexDigits(state, 2)) {\n return true\n }\n if (state.switchU) {\n state.raise(\"Invalid escape\");\n }\n state.pos = start;\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits\npp$1.regexp_eatDecimalDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isDecimalDigit(ch = state.current())) {\n state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isDecimalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits\npp$1.regexp_eatHexDigits = function(state) {\n var start = state.pos;\n var ch = 0;\n state.lastIntValue = 0;\n while (isHexDigit(ch = state.current())) {\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return state.pos !== start\n};\nfunction isHexDigit(ch) {\n return (\n (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||\n (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||\n (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)\n )\n}\nfunction hexToInt(ch) {\n if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {\n return 10 + (ch - 0x41 /* A */)\n }\n if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {\n return 10 + (ch - 0x61 /* a */)\n }\n return ch - 0x30 /* 0 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence\n// Allows only 0-377(octal) i.e. 0-255(decimal).\npp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {\n if (this.regexp_eatOctalDigit(state)) {\n var n1 = state.lastIntValue;\n if (this.regexp_eatOctalDigit(state)) {\n var n2 = state.lastIntValue;\n if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {\n state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;\n } else {\n state.lastIntValue = n1 * 8 + n2;\n }\n } else {\n state.lastIntValue = n1;\n }\n return true\n }\n return false\n};\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit\npp$1.regexp_eatOctalDigit = function(state) {\n var ch = state.current();\n if (isOctalDigit(ch)) {\n state.lastIntValue = ch - 0x30; /* 0 */\n state.advance();\n return true\n }\n state.lastIntValue = 0;\n return false\n};\nfunction isOctalDigit(ch) {\n return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */\n}\n\n// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits\n// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit\n// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence\npp$1.regexp_eatFixedHexDigits = function(state, length) {\n var start = state.pos;\n state.lastIntValue = 0;\n for (var i = 0; i < length; ++i) {\n var ch = state.current();\n if (!isHexDigit(ch)) {\n state.pos = start;\n return false\n }\n state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);\n state.advance();\n }\n return true\n};\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nvar Token = function Token(p) {\n this.type = p.type;\n this.value = p.value;\n this.start = p.start;\n this.end = p.end;\n if (p.options.locations)\n { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }\n if (p.options.ranges)\n { this.range = [p.start, p.end]; }\n};\n\n// ## Tokenizer\n\nvar pp = Parser.prototype;\n\n// Move to the next token\n\npp.next = function(ignoreEscapeSequenceInKeyword) {\n if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)\n { this.raiseRecoverable(this.start, \"Escape sequence in keyword \" + this.type.keyword); }\n if (this.options.onToken)\n { this.options.onToken(new Token(this)); }\n\n this.lastTokEnd = this.end;\n this.lastTokStart = this.start;\n this.lastTokEndLoc = this.endLoc;\n this.lastTokStartLoc = this.startLoc;\n this.nextToken();\n};\n\npp.getToken = function() {\n this.next();\n return new Token(this)\n};\n\n// If we're in an ES6 environment, make parsers iterable\nif (typeof Symbol !== \"undefined\")\n { pp[Symbol.iterator] = function() {\n var this$1$1 = this;\n\n return {\n next: function () {\n var token = this$1$1.getToken();\n return {\n done: token.type === types$1.eof,\n value: token\n }\n }\n }\n }; }\n\n// Toggle strict mode. Re-reads the next number or string to please\n// pedantic tests (`\"use strict\"; 010;` should fail).\n\n// Read a single token, updating the parser object's token-related\n// properties.\n\npp.nextToken = function() {\n var curContext = this.curContext();\n if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }\n\n this.start = this.pos;\n if (this.options.locations) { this.startLoc = this.curPosition(); }\n if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }\n\n if (curContext.override) { return curContext.override(this) }\n else { this.readToken(this.fullCharCodeAtPos()); }\n};\n\npp.readToken = function(code) {\n // Identifier or keyword. '\\uXXXX' sequences are allowed in\n // identifiers, so '\\' also dispatches to that.\n if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\\' */)\n { return this.readWord() }\n\n return this.getTokenFromCode(code)\n};\n\npp.fullCharCodeAtPos = function() {\n var code = this.input.charCodeAt(this.pos);\n if (code <= 0xd7ff || code >= 0xdc00) { return code }\n var next = this.input.charCodeAt(this.pos + 1);\n return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00\n};\n\npp.skipBlockComment = function() {\n var startLoc = this.options.onComment && this.curPosition();\n var start = this.pos, end = this.input.indexOf(\"*/\", this.pos += 2);\n if (end === -1) { this.raise(this.pos - 2, \"Unterminated comment\"); }\n this.pos = end + 2;\n if (this.options.locations) {\n for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {\n ++this.curLine;\n pos = this.lineStart = nextBreak;\n }\n }\n if (this.options.onComment)\n { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\npp.skipLineComment = function(startSkip) {\n var start = this.pos;\n var startLoc = this.options.onComment && this.curPosition();\n var ch = this.input.charCodeAt(this.pos += startSkip);\n while (this.pos < this.input.length && !isNewLine(ch)) {\n ch = this.input.charCodeAt(++this.pos);\n }\n if (this.options.onComment)\n { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,\n startLoc, this.curPosition()); }\n};\n\n// Called at the start of the parse and after every token. Skips\n// whitespace and comments, and.\n\npp.skipSpace = function() {\n loop: while (this.pos < this.input.length) {\n var ch = this.input.charCodeAt(this.pos);\n switch (ch) {\n case 32: case 160: // ' '\n ++this.pos;\n break\n case 13:\n if (this.input.charCodeAt(this.pos + 1) === 10) {\n ++this.pos;\n }\n case 10: case 8232: case 8233:\n ++this.pos;\n if (this.options.locations) {\n ++this.curLine;\n this.lineStart = this.pos;\n }\n break\n case 47: // '/'\n switch (this.input.charCodeAt(this.pos + 1)) {\n case 42: // '*'\n this.skipBlockComment();\n break\n case 47:\n this.skipLineComment(2);\n break\n default:\n break loop\n }\n break\n default:\n if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {\n ++this.pos;\n } else {\n break loop\n }\n }\n }\n};\n\n// Called at the end of every token. Sets `end`, `val`, and\n// maintains `context` and `exprAllowed`, and skips the space after\n// the token, so that the next one's `start` will point at the\n// right position.\n\npp.finishToken = function(type, val) {\n this.end = this.pos;\n if (this.options.locations) { this.endLoc = this.curPosition(); }\n var prevType = this.type;\n this.type = type;\n this.value = val;\n\n this.updateContext(prevType);\n};\n\n// ### Token reading\n\n// This is the function that is called to fetch the next token. It\n// is somewhat obscure, because it works in character codes rather\n// than characters, and because operator parsing has been inlined\n// into it.\n//\n// All in the name of speed.\n//\npp.readToken_dot = function() {\n var next = this.input.charCodeAt(this.pos + 1);\n if (next >= 48 && next <= 57) { return this.readNumber(true) }\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'\n this.pos += 3;\n return this.finishToken(types$1.ellipsis)\n } else {\n ++this.pos;\n return this.finishToken(types$1.dot)\n }\n};\n\npp.readToken_slash = function() { // '/'\n var next = this.input.charCodeAt(this.pos + 1);\n if (this.exprAllowed) { ++this.pos; return this.readRegexp() }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.slash, 1)\n};\n\npp.readToken_mult_modulo_exp = function(code) { // '%*'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n var tokentype = code === 42 ? types$1.star : types$1.modulo;\n\n // exponentiation operator ** and **=\n if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {\n ++size;\n tokentype = types$1.starstar;\n next = this.input.charCodeAt(this.pos + 2);\n }\n\n if (next === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(tokentype, size)\n};\n\npp.readToken_pipe_amp = function(code) { // '|&'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (this.options.ecmaVersion >= 12) {\n var next2 = this.input.charCodeAt(this.pos + 2);\n if (next2 === 61) { return this.finishOp(types$1.assign, 3) }\n }\n return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)\n};\n\npp.readToken_caret = function() { // '^'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.bitwiseXOR, 1)\n};\n\npp.readToken_plus_min = function(code) { // '+-'\n var next = this.input.charCodeAt(this.pos + 1);\n if (next === code) {\n if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&\n (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n return this.nextToken()\n }\n return this.finishOp(types$1.incDec, 2)\n }\n if (next === 61) { return this.finishOp(types$1.assign, 2) }\n return this.finishOp(types$1.plusMin, 1)\n};\n\npp.readToken_lt_gt = function(code) { // '<>'\n var next = this.input.charCodeAt(this.pos + 1);\n var size = 1;\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;\n if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }\n return this.finishOp(types$1.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `