From 12dc022ee19fc1d1ddc51b536c47f39d0396e41e Mon Sep 17 00:00:00 2001 From: patrickkfkan Date: Fri, 2 Aug 2024 18:03:01 +0800 Subject: [PATCH] Backport `Player.ts` up to LuanRT/YouTube.js#713 --- bundle/browser.js | 2342 ++++++++++++++++++----------------- bundle/browser.js.map | 8 +- bundle/browser.min.js | 40 +- bundle/browser.min.js.map | 8 +- bundle/node.cjs | 69 +- bundle/node.cjs.map | 4 +- dist/package.json | 2 +- dist/src/core/Player.d.ts | 12 +- dist/src/core/Player.js | 37 +- dist/src/core/Player.js.map | 2 +- dist/src/utils/Utils.d.ts | 33 + dist/src/utils/Utils.js | 45 + dist/src/utils/Utils.js.map | 2 +- package-lock.json | 14 +- package.json | 2 +- src/core/Player.ts | 54 +- src/utils/Utils.ts | 84 +- 17 files changed, 1498 insertions(+), 1260 deletions(-) diff --git a/bundle/browser.js b/bundle/browser.js index b2f51694..ffedcaaf 100644 --- a/bundle/browser.js +++ b/bundle/browser.js @@ -267,6 +267,7 @@ __export(Utils_exports, { debugFetch: () => debugFetch, deepCompare: () => deepCompare, escapeStringRegexp: () => escapeStringRegexp, + findFunction: () => findFunction, generateRandomString: () => generateRandomString, generateSidAuth: () => generateSidAuth, getRandomUserAgent: () => getRandomUserAgent, @@ -14285,693 +14286,102 @@ var user_agents_default = { ] }; -// dist/src/utils/Utils.js -var _a5; -var _Platform_shim; -var Platform = class { - static load(platform) { - __classPrivateFieldSet(Platform, _a5, platform, "f", _Platform_shim); +// node_modules/jintr/dist/nodes/index.js +var nodes_exports2 = {}; +__export(nodes_exports2, { + ArrayExpression: () => ArrayExpression, + ArrowFunctionExpression: () => ArrowFunctionExpression, + AssignmentExpression: () => AssignmentExpression, + BinaryExpression: () => BinaryExpression, + BlockStatement: () => BlockStatement, + BreakStatement: () => BreakStatement, + CallExpression: () => CallExpression, + ConditionalExpression: () => ConditionalExpression, + ContinueStatement: () => ContinueStatement, + ExpressionStatement: () => ExpressionStatement, + ForOfStatement: () => ForOfStatement, + ForStatement: () => ForStatement, + FunctionDeclaration: () => FunctionDeclaration, + FunctionExpression: () => FunctionExpression, + Identifier: () => Identifier, + IfStatement: () => IfStatement, + Literal: () => Literal, + LogicalExpression: () => LogicalExpression, + MemberExpression: () => MemberExpression, + NewExpression: () => NewExpression, + ObjectExpression: () => ObjectExpression, + Property: () => Property, + ReturnStatement: () => ReturnStatement, + SequenceExpression: () => SequenceExpression, + SwitchCase: () => SwitchCase, + SwitchStatement: () => SwitchStatement, + TemplateLiteral: () => TemplateLiteral, + ThisExpression: () => ThisExpression, + ThrowStatement: () => ThrowStatement, + TryStatement: () => TryStatement, + UnaryExpression: () => UnaryExpression, + UpdateExpression: () => UpdateExpression, + VariableDeclaration: () => VariableDeclaration, + WhileStatement: () => WhileStatement +}); + +// node_modules/jintr/dist/nodes/BaseJSNode.js +var BaseJSNode = class { + constructor(node, visitor) { + this.node = node; + this.visitor = visitor; } - static get shim() { - if (!__classPrivateFieldGet(Platform, _a5, "f", _Platform_shim)) { - throw new Error("Platform is not loaded"); - } - return __classPrivateFieldGet(Platform, _a5, "f", _Platform_shim); + run() { } }; -__name(Platform, "Platform"); -_a5 = Platform; -_Platform_shim = { value: void 0 }; -var InnertubeError = class extends Error { +__name(BaseJSNode, "BaseJSNode"); + +// node_modules/jintr/dist/nodes/ArrayExpression.js +var ArrayExpression = class extends BaseJSNode { + run() { + return this.node.elements.map((el) => this.visitor.visitNode(el)); + } +}; +__name(ArrayExpression, "ArrayExpression"); + +// node_modules/jintr/dist/utils/index.js +var utils_exports = {}; +__export(utils_exports, { + JinterError: () => JinterError, + namedFunction: () => namedFunction +}); +var namedFunction = /* @__PURE__ */ __name((name, fn) => Object.defineProperty(fn, "name", { value: name }), "namedFunction"); +var JinterError = class extends Error { constructor(message, info) { super(message); if (info) { this.info = info; } - this.date = new Date(); - this.version = Platform.shim.info.version; } }; -__name(InnertubeError, "InnertubeError"); -var ParsingError = class extends InnertubeError { -}; -__name(ParsingError, "ParsingError"); -var MissingParamError = class extends InnertubeError { -}; -__name(MissingParamError, "MissingParamError"); -var OAuthError = class extends InnertubeError { -}; -__name(OAuthError, "OAuthError"); -var PlayerError = class extends Error { -}; -__name(PlayerError, "PlayerError"); -var SessionError = class extends Error { -}; -__name(SessionError, "SessionError"); -var ChannelError = class extends Error { -}; -__name(ChannelError, "ChannelError"); -function deepCompare(obj1, obj2) { - const keys = Reflect.ownKeys(obj1); - return keys.some((key) => { - const is_text = obj2[key] instanceof Text; - if (!is_text && typeof obj2[key] === "object") { - return JSON.stringify(obj1[key]) === JSON.stringify(obj2[key]); - } - return obj1[key] === (is_text ? obj2[key].toString() : obj2[key]); - }); -} -__name(deepCompare, "deepCompare"); -function getStringBetweenStrings(data2, start_string, end_string) { - const regex = new RegExp(`${escapeStringRegexp(start_string)}(.*?)${escapeStringRegexp(end_string)}`, "s"); - const match = data2.match(regex); - return match ? match[1] : void 0; -} -__name(getStringBetweenStrings, "getStringBetweenStrings"); -function escapeStringRegexp(input) { - return input.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); -} -__name(escapeStringRegexp, "escapeStringRegexp"); -function getRandomUserAgent(type) { - const available_agents = user_agents_default[type]; - const random_index = Math.floor(Math.random() * available_agents.length); - return available_agents[random_index]; -} -__name(getRandomUserAgent, "getRandomUserAgent"); -function generateSidAuth(sid) { - return __awaiter(this, void 0, void 0, function* () { - const youtube = "https://www.youtube.com"; - const timestamp = Math.floor(new Date().getTime() / 1e3); - const input = [timestamp, sid, youtube].join(" "); - const gen_hash = yield Platform.shim.sha1Hash(input); - return ["SAPISIDHASH", [timestamp, gen_hash].join("_")].join(" "); - }); -} -__name(generateSidAuth, "generateSidAuth"); -function generateRandomString(length) { - const result = []; - const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; - for (let i = 0; i < length; i++) { - result.push(alphabet.charAt(Math.floor(Math.random() * alphabet.length))); - } - return result.join(""); -} -__name(generateRandomString, "generateRandomString"); -function timeToSeconds(time) { - const params = time.split(":").map((param) => parseInt(param.replace(/\D/g, ""))); - switch (params.length) { - case 1: - return params[0]; - case 2: - return params[0] * 60 + params[1]; - case 3: - return params[0] * 3600 + params[1] * 60 + params[2]; - default: - throw new Error("Invalid time string"); - } -} -__name(timeToSeconds, "timeToSeconds"); -function concatMemos(...iterables) { - const memo = new Memo(); - for (const iterable of iterables) { - if (!iterable) - continue; - for (const item of iterable) { - memo.set(...item); - } - } - return memo; -} -__name(concatMemos, "concatMemos"); -function throwIfMissing(params) { - for (const [key, value] of Object.entries(params)) { - if (!value) - throw new MissingParamError(`${key} is missing`); - } -} -__name(throwIfMissing, "throwIfMissing"); -function hasKeys(params, ...keys) { - for (const key of keys) { - if (!Reflect.has(params, key) || params[key] === void 0) - return false; - } - return true; -} -__name(hasKeys, "hasKeys"); -function streamToIterable(stream) { - return __asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* streamToIterable_1() { - const reader = stream.getReader(); - try { - while (true) { - const { done, value } = yield __await(reader.read()); - if (done) { - return yield __await(void 0); +__name(JinterError, "JinterError"); + +// node_modules/jintr/dist/nodes/ArrowFunctionExpression.js +var ArrowFunctionExpression = class extends BaseJSNode { + run() { + const { params, body } = this.node; + const fn = namedFunction("anonymous function", (args) => { + let index = 0; + for (const param of params) { + this.visitor.visitNode(param); + if (param.type === "Identifier") { + this.visitor.scope.set(param.name, args[index]); + } else { + console.warn("Unhandled param type", param.type); } - yield yield __await(value); + index++; } - } finally { - reader.releaseLock(); - } - }, "streamToIterable_1")); -} -__name(streamToIterable, "streamToIterable"); -var debugFetch = /* @__PURE__ */ __name((input, init) => { - const url = typeof input === "string" ? new URL(input) : input instanceof URL ? input : new URL(input.url); - const headers = (init === null || init === void 0 ? void 0 : init.headers) ? new Headers(init.headers) : input instanceof Request ? input.headers : new Headers(); - const arr_headers = [...headers]; - const body_contents = (init === null || init === void 0 ? void 0 : init.body) ? typeof init.body === "string" ? headers.get("content-type") === "application/json" ? JSON.stringify(JSON.parse(init.body), null, 2) : init.body : " " : " (none)"; - const headers_serialized = arr_headers.length > 0 ? `${arr_headers.map(([key, value]) => ` ${key}: ${value}`).join("\n")}` : " (none)"; - console.log(`YouTube.js Fetch: - url: ${url.toString()} - method: ${(init === null || init === void 0 ? void 0 : init.method) || "GET"} - headers: -${headers_serialized} -' + - ' body: -${body_contents}`); - return Platform.shim.fetch(input, init); -}, "debugFetch"); -function u8ToBase64(u8) { - return btoa(String.fromCharCode.apply(null, Array.from(u8))); -} -__name(u8ToBase64, "u8ToBase64"); -function base64ToU8(base64) { - return new Uint8Array(atob(base64).split("").map((char) => char.charCodeAt(0))); -} -__name(base64ToU8, "base64ToU8"); -function isTextRun(run) { - return !("emoji" in run); -} -__name(isTextRun, "isTextRun"); - -// dist/src/platform/polyfills/web-crypto.js -function sha1Hash(str) { - return __awaiter(this, void 0, void 0, function* () { - const byteToHex = [ - "00", - "01", - "02", - "03", - "04", - "05", - "06", - "07", - "08", - "09", - "0a", - "0b", - "0c", - "0d", - "0e", - "0f", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "1a", - "1b", - "1c", - "1d", - "1e", - "1f", - "20", - "21", - "22", - "23", - "24", - "25", - "26", - "27", - "28", - "29", - "2a", - "2b", - "2c", - "2d", - "2e", - "2f", - "30", - "31", - "32", - "33", - "34", - "35", - "36", - "37", - "38", - "39", - "3a", - "3b", - "3c", - "3d", - "3e", - "3f", - "40", - "41", - "42", - "43", - "44", - "45", - "46", - "47", - "48", - "49", - "4a", - "4b", - "4c", - "4d", - "4e", - "4f", - "50", - "51", - "52", - "53", - "54", - "55", - "56", - "57", - "58", - "59", - "5a", - "5b", - "5c", - "5d", - "5e", - "5f", - "60", - "61", - "62", - "63", - "64", - "65", - "66", - "67", - "68", - "69", - "6a", - "6b", - "6c", - "6d", - "6e", - "6f", - "70", - "71", - "72", - "73", - "74", - "75", - "76", - "77", - "78", - "79", - "7a", - "7b", - "7c", - "7d", - "7e", - "7f", - "80", - "81", - "82", - "83", - "84", - "85", - "86", - "87", - "88", - "89", - "8a", - "8b", - "8c", - "8d", - "8e", - "8f", - "90", - "91", - "92", - "93", - "94", - "95", - "96", - "97", - "98", - "99", - "9a", - "9b", - "9c", - "9d", - "9e", - "9f", - "a0", - "a1", - "a2", - "a3", - "a4", - "a5", - "a6", - "a7", - "a8", - "a9", - "aa", - "ab", - "ac", - "ad", - "ae", - "af", - "b0", - "b1", - "b2", - "b3", - "b4", - "b5", - "b6", - "b7", - "b8", - "b9", - "ba", - "bb", - "bc", - "bd", - "be", - "bf", - "c0", - "c1", - "c2", - "c3", - "c4", - "c5", - "c6", - "c7", - "c8", - "c9", - "ca", - "cb", - "cc", - "cd", - "ce", - "cf", - "d0", - "d1", - "d2", - "d3", - "d4", - "d5", - "d6", - "d7", - "d8", - "d9", - "da", - "db", - "dc", - "dd", - "de", - "df", - "e0", - "e1", - "e2", - "e3", - "e4", - "e5", - "e6", - "e7", - "e8", - "e9", - "ea", - "eb", - "ec", - "ed", - "ee", - "ef", - "f0", - "f1", - "f2", - "f3", - "f4", - "f5", - "f6", - "f7", - "f8", - "f9", - "fa", - "fb", - "fc", - "fd", - "fe", - "ff" - ]; - function hex(arrayBuffer) { - const buff = new Uint8Array(arrayBuffer); - const hexOctets = []; - for (let i = 0; i < buff.length; ++i) - hexOctets.push(byteToHex[buff[i]]); - return hexOctets.join(""); - } - __name(hex, "hex"); - return hex(yield crypto.subtle.digest("SHA-1", new TextEncoder().encode(str))); - }); -} -__name(sha1Hash, "sha1Hash"); - -// dist/package.json -var package_default = { - name: "volumio-youtubei.js", - version: "0.3.8", - description: "Modified version of YouTube.js library for use with Volumio's YouTube Music plugin.", - type: "module", - types: "./dist/src/platform/lib.d.ts", - typesVersions: { - "*": { - agnostic: [ - "./dist/src/platform/lib.d.ts" - ], - web: [ - "./dist/src/platform/lib.d.ts" - ], - "web.bundle": [ - "./dist/src/platform/lib.d.ts" - ], - "web.bundle.min": [ - "./dist/src/platform/lib.d.ts" - ] - } - }, - exports: { - ".": { - node: { - import: "./dist/src/platform/node.js", - require: "./bundle/node.cjs" - }, - deno: "./dist/src/platform/deno.js", - types: "./dist/src/platform/lib.d.ts", - browser: "./dist/src/platform/web.js", - default: "./dist/src/platform/web.js" - }, - "./agnostic": { - types: "./dist/src/platform/lib.d.ts", - default: "./dist/src/platform/lib.js" - }, - "./web": { - types: "./dist/src/platform/lib.d.ts", - default: "./dist/src/platform/web.js" - }, - "./web.bundle": { - types: "./dist/src/platform/lib.d.ts", - default: "./bundle/browser.js" - }, - "./web.bundle.min": { - types: "./dist/src/platform/lib.d.ts", - default: "./bundle/browser.min.js" - } - }, - author: "Original author: LuanRT (https://github.com/LuanRT). Modified by Patrick Kan (https://github.com/patrickkfkan).", - funding: [ - "https://github.com/sponsors/LuanRT" - ], - contributors: [ - "Wykerd (https://github.com/wykerd/)", - "MasterOfBob777 (https://github.com/MasterOfBob777)", - "patrickkfkan (https://github.com/patrickkfkan)", - "akkadaska (https://github.com/akkadaska)" - ], - directories: { - test: "./test", - examples: "./examples", - dist: "./dist" - }, - scripts: { - test: "npx jest --verbose", - lint: "npx eslint ./src", - "lint:fix": "npx eslint --fix ./src", - build: "npm run build:parser-map && npm run build:proto && npm run build:esm && npm run bundle:node && npm run bundle:browser && npm run bundle:browser:prod", - "build:parser-map": "node ./scripts/build-parser-map.cjs", - "build:proto": 'npx pb-gen-ts --entry-path="src/proto" --out-dir="src/proto/generated" --ext-in-import=".js"', - "build:esm": "npx tsc", - "build:deno": `npx cpy ./src ./deno && npx cpy ./package.json ./deno && npx replace ".js';" ".ts';" ./deno -r && npx replace '.js";' '.ts";' ./deno -r && npx replace "'linkedom';" "'https://esm.sh/linkedom';" ./deno -r && npx replace "'jintr';" "'https://esm.sh/jintr';" ./deno -r && npx replace "new Jinter.default" "new Jinter" ./deno -r`, - "bundle:node": 'npx esbuild ./dist/src/platform/node.js --bundle --target=node10 --keep-names --format=cjs --platform=node --outfile=./bundle/node.cjs --external:jintr --external:undici --external:linkedom --sourcemap --banner:js="/* eslint-disable */"', - "bundle:browser": 'npx esbuild ./dist/src/platform/web.js --banner:js="/* eslint-disable */" --bundle --target=chrome58 --keep-names --format=esm --sourcemap --define:global=globalThis --conditions=module --outfile=./bundle/browser.js --platform=browser', - "bundle:browser:prod": "npm run bundle:browser -- --outfile=./bundle/browser.min.js --minify", - watch: "npx tsc --watch" - }, - repository: { - type: "git", - url: "git+https://github.com/patrickkfkan/Volumio-YouTube.js.git" - }, - license: "MIT", - dependencies: { - "event-target-polyfill": "0.0.3", - jintr: "^2.0.0", - linkedom: "^0.14.12", - "node-fetch": "^2.6.7", - tslib: "^2.5.0", - uuid: "^9.0.0", - "web-streams-polyfill": "^3.2.1" - }, - devDependencies: { - "@types/jest": "^28.1.7", - "@types/node": "^17.0.45", - "@types/node-fetch": "^2.6.11", - "@types/uuid": "^10.0.0", - "@typescript-eslint/eslint-plugin": "^5.30.6", - "@typescript-eslint/parser": "^5.30.6", - "cpy-cli": "^4.2.0", - esbuild: "^0.14.49", - eslint: "^8.19.0", - "eslint-plugin-tsdoc": "^0.2.16", - glob: "^8.0.3", - jest: "^28.1.3", - pbkit: "^0.0.59", - replace: "^1.2.2", - "ts-jest": "^28.0.8", - typescript: "^5.0.0" - }, - bugs: { - url: "https://github.com/patrickkfkan/Volumio-YouTube.js/issues" - }, - homepage: "https://github.com/patrickkfkan/Volumio-YouTube.js#readme", - keywords: [ - "yt", - "dl", - "ytdl", - "youtube", - "youtubedl", - "youtube-dl", - "youtube-downloader", - "youtube-music", - "youtube-studio", - "innertube", - "unofficial", - "downloader", - "livechat", - "studio", - "upload", - "ytmusic", - "search", - "music", - "api" - ] -}; - -// node_modules/jintr/dist/nodes/index.js -var nodes_exports2 = {}; -__export(nodes_exports2, { - ArrayExpression: () => ArrayExpression, - ArrowFunctionExpression: () => ArrowFunctionExpression, - AssignmentExpression: () => AssignmentExpression, - BinaryExpression: () => BinaryExpression, - BlockStatement: () => BlockStatement, - BreakStatement: () => BreakStatement, - CallExpression: () => CallExpression, - ConditionalExpression: () => ConditionalExpression, - ContinueStatement: () => ContinueStatement, - ExpressionStatement: () => ExpressionStatement, - ForOfStatement: () => ForOfStatement, - ForStatement: () => ForStatement, - FunctionDeclaration: () => FunctionDeclaration, - FunctionExpression: () => FunctionExpression, - Identifier: () => Identifier, - IfStatement: () => IfStatement, - Literal: () => Literal, - LogicalExpression: () => LogicalExpression, - MemberExpression: () => MemberExpression, - NewExpression: () => NewExpression, - ObjectExpression: () => ObjectExpression, - Property: () => Property, - ReturnStatement: () => ReturnStatement, - SequenceExpression: () => SequenceExpression, - SwitchCase: () => SwitchCase, - SwitchStatement: () => SwitchStatement, - ThisExpression: () => ThisExpression, - ThrowStatement: () => ThrowStatement, - TryStatement: () => TryStatement, - UnaryExpression: () => UnaryExpression, - UpdateExpression: () => UpdateExpression, - VariableDeclaration: () => VariableDeclaration, - WhileStatement: () => WhileStatement -}); - -// node_modules/jintr/dist/nodes/BaseJSNode.js -var BaseJSNode = class { - constructor(node, visitor) { - this.node = node; - this.visitor = visitor; - } - run() { - } -}; -__name(BaseJSNode, "BaseJSNode"); - -// node_modules/jintr/dist/nodes/ArrayExpression.js -var ArrayExpression = class extends BaseJSNode { - run() { - return this.node.elements.map((el) => this.visitor.visitNode(el)); - } -}; -__name(ArrayExpression, "ArrayExpression"); - -// node_modules/jintr/dist/utils/index.js -var utils_exports = {}; -__export(utils_exports, { - JinterError: () => JinterError, - namedFunction: () => namedFunction -}); -var namedFunction = /* @__PURE__ */ __name((name, fn) => Object.defineProperty(fn, "name", { value: name }), "namedFunction"); -var JinterError = class extends Error { - constructor(message, info) { - super(message); - if (info) { - this.info = info; - } - } -}; -__name(JinterError, "JinterError"); - -// node_modules/jintr/dist/nodes/ArrowFunctionExpression.js -var ArrowFunctionExpression = class extends BaseJSNode { - run() { - const { params, body } = this.node; - const fn = namedFunction("anonymous function", (args) => { - let index = 0; - for (const param of params) { - this.visitor.visitNode(param); - if (param.type === "Identifier") { - this.visitor.scope.set(param.name, args[index]); - } else { - console.warn("Unhandled param type", param.type); - } - index++; - } - return this.visitor.visitNode(body); - }); - return fn; - } -}; -__name(ArrowFunctionExpression, "ArrowFunctionExpression"); + return this.visitor.visitNode(body); + }); + return fn; + } +}; +__name(ArrowFunctionExpression, "ArrowFunctionExpression"); // node_modules/jintr/dist/nodes/AssignmentExpression.js var AssignmentExpression = class extends BaseJSNode { @@ -15695,6 +15105,36 @@ var SwitchStatement = class extends BaseJSNode { }; __name(SwitchStatement, "SwitchStatement"); +// node_modules/jintr/dist/nodes/TemplateLiteral.js +var TemplateLiteral = class extends BaseJSNode { + run() { + let result = ""; + for (let i = 0; i < this.node.quasis.length; ++i) { + const quasi = this.node.quasis[i]; + if (quasi.type === "TemplateElement") { + if (quasi.value.cooked === null) { + throw new Error(`Invalid template literal: ${quasi.value.raw}`); + } + if (quasi.value.cooked !== void 0) { + result += quasi.value.cooked; + } + if (!quasi.tail) { + const expr = this.node.expressions[i]; + if (expr !== void 0) { + result += this.visitor.visitNode(expr); + } else { + throw new Error(`Expected expression after: ${quasi.value}`); + } + } + } else { + throw new Error(`Unhandled quasi type: ${quasi.type}`); + } + } + return result; + } +}; +__name(TemplateLiteral, "TemplateLiteral"); + // node_modules/jintr/dist/nodes/ThisExpression.js var ThisExpression = class extends BaseJSNode { run() { @@ -20246,503 +19686,1131 @@ pp.getTokenFromCode = function(code) { case 35: return this.readToken_numberSign(); } - this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; +pp.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; + return this.finishToken(type, str); +}; +pp.readRegexp = function() { + var escaped, inClass, start = this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(start, "Unterminated regular expression"); + } + var ch = this.input.charAt(this.pos); + if (lineBreak.test(ch)) { + this.raise(start, "Unterminated regular expression"); + } + if (!escaped) { + if (ch === "[") { + inClass = true; + } else if (ch === "]" && inClass) { + inClass = false; + } else if (ch === "/" && !inClass) { + break; + } + escaped = ch === "\\"; + } else { + escaped = false; + } + ++this.pos; + } + var pattern = this.input.slice(start, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { + this.unexpected(flagsStart); + } + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + } + return this.finishToken(types$1.regexp, { pattern, flags, value }); +}; +pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { + var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; + var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; + var start = this.pos, total = 0, lastCode = 0; + for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { + var code = this.input.charCodeAt(this.pos), val = void 0; + if (allowSeparators && code === 95) { + if (isLegacyOctalNumericLiteral) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); + } + if (lastCode === 95) { + this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); + } + if (i === 0) { + this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + } + lastCode = code; + continue; + } + if (code >= 97) { + val = code - 97 + 10; + } else if (code >= 65) { + val = code - 65 + 10; + } else if (code >= 48 && code <= 57) { + val = code - 48; + } else { + val = Infinity; + } + if (val >= radix) { + break; + } + lastCode = code; + total = total * radix + val; + } + if (allowSeparators && lastCode === 95) { + this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + } + if (this.pos === start || len != null && this.pos - start !== len) { + return null; + } + return total; +}; +function stringToNumber(str, isLegacyOctalNumericLiteral) { + if (isLegacyOctalNumericLiteral) { + return parseInt(str, 8); + } + return parseFloat(str.replace(/_/g, "")); +} +__name(stringToNumber, "stringToNumber"); +function stringToBigInt(str) { + if (typeof BigInt !== "function") { + return null; + } + return BigInt(str.replace(/_/g, "")); +} +__name(stringToBigInt, "stringToBigInt"); +pp.readRadixNumber = function(radix) { + var start = this.pos; + this.pos += 2; + var val = this.readInt(radix); + if (val == null) { + this.raise(this.start + 2, "Expected number in radix " + radix); + } + if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { + val = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val); +}; +pp.readNumber = function(startsWithDot) { + var start = this.pos; + if (!startsWithDot && this.readInt(10, void 0, true) === null) { + this.raise(start, "Invalid number"); + } + var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (octal && this.strict) { + this.raise(start, "Invalid number"); + } + var next = this.input.charCodeAt(this.pos); + if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { + var val$1 = stringToBigInt(this.input.slice(start, this.pos)); + ++this.pos; + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + return this.finishToken(types$1.num, val$1); + } + if (octal && /[89]/.test(this.input.slice(start, this.pos))) { + octal = false; + } + if (next === 46 && !octal) { + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); + } + if ((next === 69 || next === 101) && !octal) { + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { + ++this.pos; + } + if (this.readInt(10) === null) { + this.raise(start, "Invalid number"); + } + } + if (isIdentifierStart(this.fullCharCodeAtPos())) { + this.raise(this.pos, "Identifier directly after number"); + } + var val = stringToNumber(this.input.slice(start, this.pos), octal); + return this.finishToken(types$1.num, val); +}; +pp.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; + if (ch === 123) { + if (this.options.ecmaVersion < 6) { + this.unexpected(); + } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 1114111) { + this.invalidStringToken(codePos, "Code point out of bounds"); + } + } else { + code = this.readHexChar(4); + } + return code; +}; +pp.readString = function(quote) { + var out = "", chunkStart = ++this.pos; + for (; ; ) { + if (this.pos >= this.input.length) { + this.raise(this.start, "Unterminated string constant"); + } + var ch = this.input.charCodeAt(this.pos); + if (ch === quote) { + break; + } + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(false); + chunkStart = this.pos; + } else if (ch === 8232 || ch === 8233) { + if (this.options.ecmaVersion < 10) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + if (this.options.locations) { + this.curLine++; + this.lineStart = this.pos; + } + } else { + if (isNewLine(ch)) { + this.raise(this.start, "Unterminated string constant"); + } + ++this.pos; + } + } + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types$1.string, out); +}; +var INVALID_TEMPLATE_ESCAPE_ERROR = {}; +pp.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); + } else { + throw err; + } + } + this.inTemplateElement = false; }; -pp.finishOp = function(type, size) { - var str = this.input.slice(this.pos, this.pos + size); - this.pos += size; - return this.finishToken(type, str); +pp.invalidStringToken = function(position, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR; + } else { + this.raise(position, message); + } }; -pp.readRegexp = function() { - var escaped, inClass, start = this.pos; +pp.readTmplToken = function() { + var out = "", chunkStart = this.pos; for (; ; ) { if (this.pos >= this.input.length) { - this.raise(start, "Unterminated regular expression"); + this.raise(this.start, "Unterminated template"); } - var ch = this.input.charAt(this.pos); - if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); + var ch = this.input.charCodeAt(this.pos); + if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { + if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { + if (ch === 36) { + this.pos += 2; + return this.finishToken(types$1.dollarBraceL); + } else { + ++this.pos; + return this.finishToken(types$1.backQuote); + } + } + out += this.input.slice(chunkStart, this.pos); + return this.finishToken(types$1.template, out); } - if (!escaped) { - if (ch === "[") { - inClass = true; - } else if (ch === "]" && inClass) { - inClass = false; - } else if (ch === "/" && !inClass) { - break; + if (ch === 92) { + out += this.input.slice(chunkStart, this.pos); + out += this.readEscapedChar(true); + chunkStart = this.pos; + } else if (isNewLine(ch)) { + out += this.input.slice(chunkStart, this.pos); + ++this.pos; + switch (ch) { + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + out += "\n"; + break; + default: + out += String.fromCharCode(ch); + break; } - escaped = ch === "\\"; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + chunkStart = this.pos; } else { - escaped = false; + ++this.pos; } - ++this.pos; } - var pattern = this.input.slice(start, this.pos); +}; +pp.readInvalidTemplateToken = function() { + for (; this.pos < this.input.length; this.pos++) { + switch (this.input[this.pos]) { + case "\\": + ++this.pos; + break; + case "$": + if (this.input[this.pos + 1] !== "{") { + break; + } + case "`": + return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); + } + } + this.raise(this.start, "Unterminated template"); +}; +pp.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); ++this.pos; - var flagsStart = this.pos; - var flags = this.readWord1(); - if (this.containsEsc) { - this.unexpected(flagsStart); + switch (ch) { + case 110: + return "\n"; + case 114: + return "\r"; + case 120: + return String.fromCharCode(this.readHexChar(2)); + case 117: + return codePointToString(this.readCodePoint()); + case 116: + return " "; + case 98: + return "\b"; + case 118: + return "\v"; + case 102: + return "\f"; + case 13: + if (this.input.charCodeAt(this.pos) === 10) { + ++this.pos; + } + case 10: + if (this.options.locations) { + this.lineStart = this.pos; + ++this.curLine; + } + return ""; + case 56: + case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } + if (inTemplate) { + var codePos = this.pos - 1; + this.invalidStringToken( + codePos, + "Invalid escape sequence in template string" + ); + return null; + } + default: + if (ch >= 48 && ch <= 55) { + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); + if (octal > 255) { + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); + } + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" + ); + } + return String.fromCharCode(octal); + } + if (isNewLine(ch)) { + return ""; + } + return String.fromCharCode(ch); } - var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); - state.reset(start, pattern, flags); - this.validateRegExpFlags(state); - this.validateRegExpPattern(state); - var value = null; - try { - value = new RegExp(pattern, flags); - } catch (e) { +}; +pp.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { + this.invalidStringToken(codePos, "Bad character escape sequence"); } - return this.finishToken(types$1.regexp, { pattern, flags, value }); + return n; }; -pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { - var allowSeparators = this.options.ecmaVersion >= 12 && len === void 0; - var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48; - var start = this.pos, total = 0, lastCode = 0; - for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) { - var code = this.input.charCodeAt(this.pos), val = void 0; - if (allowSeparators && code === 95) { - if (isLegacyOctalNumericLiteral) { - this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); - } - if (lastCode === 95) { - this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); +pp.readWord1 = function() { + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; + while (this.pos < this.input.length) { + var ch = this.fullCharCodeAtPos(); + if (isIdentifierChar(ch, astral)) { + this.pos += ch <= 65535 ? 1 : 2; + } else if (ch === 92) { + this.containsEsc = true; + word += this.input.slice(chunkStart, this.pos); + var escStart = this.pos; + if (this.input.charCodeAt(++this.pos) !== 117) { + this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); } - if (i === 0) { - this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); + ++this.pos; + var esc = this.readCodePoint(); + if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { + this.invalidStringToken(escStart, "Invalid Unicode escape"); } - lastCode = code; - continue; - } - if (code >= 97) { - val = code - 97 + 10; - } else if (code >= 65) { - val = code - 65 + 10; - } else if (code >= 48 && code <= 57) { - val = code - 48; + word += codePointToString(esc); + chunkStart = this.pos; } else { - val = Infinity; - } - if (val >= radix) { break; } - lastCode = code; - total = total * radix + val; - } - if (allowSeparators && lastCode === 95) { - this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); + first = false; } - if (this.pos === start || len != null && this.pos - start !== len) { - return null; + return word + this.input.slice(chunkStart, this.pos); +}; +pp.readWord = function() { + var word = this.readWord1(); + var type = types$1.name; + if (this.keywords.test(word)) { + type = keywords[word]; } - return total; + return this.finishToken(type, word); +}; +var version = "8.8.1"; +Parser2.acorn = { + Parser: Parser2, + version, + defaultOptions, + Position, + SourceLocation, + getLineInfo, + Node, + TokenType, + tokTypes: types$1, + keywordTypes: keywords, + TokContext, + tokContexts: types, + isIdentifierChar, + isIdentifierStart, + Token, + isNewLine, + lineBreak, + lineBreakG, + nonASCIIwhitespace }; -function stringToNumber(str, isLegacyOctalNumericLiteral) { - if (isLegacyOctalNumericLiteral) { - return parseInt(str, 8); - } - return parseFloat(str.replace(/_/g, "")); -} -__name(stringToNumber, "stringToNumber"); -function stringToBigInt(str) { - if (typeof BigInt !== "function") { - return null; - } - return BigInt(str.replace(/_/g, "")); +function parse3(input, options) { + return Parser2.parse(input, options); } -__name(stringToBigInt, "stringToBigInt"); -pp.readRadixNumber = function(radix) { - var start = this.pos; - this.pos += 2; - var val = this.readInt(radix); - if (val == null) { - this.raise(this.start + 2, "Expected number in radix " + radix); - } - if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) { - val = stringToBigInt(this.input.slice(start, this.pos)); - ++this.pos; - } else if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); - } - return this.finishToken(types$1.num, val); +__name(parse3, "parse"); + +// node_modules/jintr/dist/main.js +var __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; }; -pp.readNumber = function(startsWithDot) { - var start = this.pos; - if (!startsWithDot && this.readInt(10, void 0, true) === null) { - this.raise(start, "Invalid number"); +var __classPrivateFieldGet5 = function(receiver, state, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +}; +var _Jinter_ast; +var Jinter = class { + constructor() { + _Jinter_ast.set(this, []); + this.visitor = new Visitor(); + this.scope = this.visitor.scope; + this.scope.set("print", (args) => console.log(...args)); + this.defineObject("console", console); + this.defineObject("Math", Math); + this.defineObject("String", String); + this.defineObject("Array", Array); + this.defineObject("Date", Date); } - var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; - if (octal && this.strict) { - this.raise(start, "Invalid number"); + defineObject(name, obj) { + this.visitor.on(name, (node, visitor) => { + if (node.type === "Identifier") + return obj; + if (node.type === "CallExpression" && node.callee.type === "MemberExpression") { + const prop = visitor.visitNode(node.callee.property); + const args = node.arguments.map((arg) => visitor.visitNode(arg)); + const callable = obj[prop]; + if (!callable) + return "__continue_exec"; + return callable.apply(obj, args); + } + return "__continue_exec"; + }); } - var next = this.input.charCodeAt(this.pos); - if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) { - var val$1 = stringToBigInt(this.input.slice(start, this.pos)); - ++this.pos; - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); + evaluate(input) { + try { + const program = parse3(input, { ecmaVersion: 2020 }); + __classPrivateFieldSet2(this, _Jinter_ast, program.body, "f"); + } catch (e) { + throw new JinterError(e.message); } - return this.finishToken(types$1.num, val$1); + this.visitor.setAST(__classPrivateFieldGet5(this, _Jinter_ast, "f")); + return this.visitor.run(); } - if (octal && /[89]/.test(this.input.slice(start, this.pos))) { - octal = false; + static parseScript(input) { + try { + return parse3(input, { ecmaVersion: 2020 }); + } catch (e) { + throw new JinterError(e.message); + } } - if (next === 46 && !octal) { - ++this.pos; - this.readInt(10); - next = this.input.charCodeAt(this.pos); +}; +__name(Jinter, "Jinter"); +_Jinter_ast = /* @__PURE__ */ new WeakMap(); + +// dist/src/utils/Utils.js +var _a5; +var _Platform_shim; +var Platform = class { + static load(platform) { + __classPrivateFieldSet(Platform, _a5, platform, "f", _Platform_shim); } - if ((next === 69 || next === 101) && !octal) { - next = this.input.charCodeAt(++this.pos); - if (next === 43 || next === 45) { - ++this.pos; - } - if (this.readInt(10) === null) { - this.raise(start, "Invalid number"); + static get shim() { + if (!__classPrivateFieldGet(Platform, _a5, "f", _Platform_shim)) { + throw new Error("Platform is not loaded"); } + return __classPrivateFieldGet(Platform, _a5, "f", _Platform_shim); } - if (isIdentifierStart(this.fullCharCodeAtPos())) { - this.raise(this.pos, "Identifier directly after number"); - } - var val = stringToNumber(this.input.slice(start, this.pos), octal); - return this.finishToken(types$1.num, val); }; -pp.readCodePoint = function() { - var ch = this.input.charCodeAt(this.pos), code; - if (ch === 123) { - if (this.options.ecmaVersion < 6) { - this.unexpected(); - } - var codePos = ++this.pos; - code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); - ++this.pos; - if (code > 1114111) { - this.invalidStringToken(codePos, "Code point out of bounds"); +__name(Platform, "Platform"); +_a5 = Platform; +_Platform_shim = { value: void 0 }; +var InnertubeError = class extends Error { + constructor(message, info) { + super(message); + if (info) { + this.info = info; } - } else { - code = this.readHexChar(4); + this.date = new Date(); + this.version = Platform.shim.info.version; } - return code; }; -pp.readString = function(quote) { - var out = "", chunkStart = ++this.pos; - for (; ; ) { - if (this.pos >= this.input.length) { - this.raise(this.start, "Unterminated string constant"); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === quote) { - break; - } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(false); - chunkStart = this.pos; - } else if (ch === 8232 || ch === 8233) { - if (this.options.ecmaVersion < 10) { - this.raise(this.start, "Unterminated string constant"); - } - ++this.pos; - if (this.options.locations) { - this.curLine++; - this.lineStart = this.pos; - } - } else { - if (isNewLine(ch)) { - this.raise(this.start, "Unterminated string constant"); - } - ++this.pos; +__name(InnertubeError, "InnertubeError"); +var ParsingError = class extends InnertubeError { +}; +__name(ParsingError, "ParsingError"); +var MissingParamError = class extends InnertubeError { +}; +__name(MissingParamError, "MissingParamError"); +var OAuthError = class extends InnertubeError { +}; +__name(OAuthError, "OAuthError"); +var PlayerError = class extends Error { +}; +__name(PlayerError, "PlayerError"); +var SessionError = class extends Error { +}; +__name(SessionError, "SessionError"); +var ChannelError = class extends Error { +}; +__name(ChannelError, "ChannelError"); +function deepCompare(obj1, obj2) { + const keys = Reflect.ownKeys(obj1); + return keys.some((key) => { + const is_text = obj2[key] instanceof Text; + if (!is_text && typeof obj2[key] === "object") { + return JSON.stringify(obj1[key]) === JSON.stringify(obj2[key]); } + return obj1[key] === (is_text ? obj2[key].toString() : obj2[key]); + }); +} +__name(deepCompare, "deepCompare"); +function getStringBetweenStrings(data2, start_string, end_string) { + const regex = new RegExp(`${escapeStringRegexp(start_string)}(.*?)${escapeStringRegexp(end_string)}`, "s"); + const match = data2.match(regex); + return match ? match[1] : void 0; +} +__name(getStringBetweenStrings, "getStringBetweenStrings"); +function escapeStringRegexp(input) { + return input.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} +__name(escapeStringRegexp, "escapeStringRegexp"); +function getRandomUserAgent(type) { + const available_agents = user_agents_default[type]; + const random_index = Math.floor(Math.random() * available_agents.length); + return available_agents[random_index]; +} +__name(getRandomUserAgent, "getRandomUserAgent"); +function generateSidAuth(sid) { + return __awaiter(this, void 0, void 0, function* () { + const youtube = "https://www.youtube.com"; + const timestamp = Math.floor(new Date().getTime() / 1e3); + const input = [timestamp, sid, youtube].join(" "); + const gen_hash = yield Platform.shim.sha1Hash(input); + return ["SAPISIDHASH", [timestamp, gen_hash].join("_")].join(" "); + }); +} +__name(generateSidAuth, "generateSidAuth"); +function generateRandomString(length) { + const result = []; + const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; + for (let i = 0; i < length; i++) { + result.push(alphabet.charAt(Math.floor(Math.random() * alphabet.length))); + } + return result.join(""); +} +__name(generateRandomString, "generateRandomString"); +function timeToSeconds(time) { + const params = time.split(":").map((param) => parseInt(param.replace(/\D/g, ""))); + switch (params.length) { + case 1: + return params[0]; + case 2: + return params[0] * 60 + params[1]; + case 3: + return params[0] * 3600 + params[1] * 60 + params[2]; + default: + throw new Error("Invalid time string"); } - out += this.input.slice(chunkStart, this.pos++); - return this.finishToken(types$1.string, out); -}; -var INVALID_TEMPLATE_ESCAPE_ERROR = {}; -pp.tryReadTemplateToken = function() { - this.inTemplateElement = true; - try { - this.readTmplToken(); - } catch (err) { - if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { - this.readInvalidTemplateToken(); - } else { - throw err; +} +__name(timeToSeconds, "timeToSeconds"); +function concatMemos(...iterables) { + const memo = new Memo(); + for (const iterable of iterables) { + if (!iterable) + continue; + for (const item of iterable) { + memo.set(...item); } } - this.inTemplateElement = false; -}; -pp.invalidStringToken = function(position, message) { - if (this.inTemplateElement && this.options.ecmaVersion >= 9) { - throw INVALID_TEMPLATE_ESCAPE_ERROR; - } else { - this.raise(position, message); + return memo; +} +__name(concatMemos, "concatMemos"); +function throwIfMissing(params) { + for (const [key, value] of Object.entries(params)) { + if (!value) + throw new MissingParamError(`${key} is missing`); } -}; -pp.readTmplToken = function() { - var out = "", chunkStart = this.pos; - for (; ; ) { - if (this.pos >= this.input.length) { - this.raise(this.start, "Unterminated template"); - } - var ch = this.input.charCodeAt(this.pos); - if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { - if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { - if (ch === 36) { - this.pos += 2; - return this.finishToken(types$1.dollarBraceL); - } else { - ++this.pos; - return this.finishToken(types$1.backQuote); +} +__name(throwIfMissing, "throwIfMissing"); +function hasKeys(params, ...keys) { + for (const key of keys) { + if (!Reflect.has(params, key) || params[key] === void 0) + return false; + } + return true; +} +__name(hasKeys, "hasKeys"); +function streamToIterable(stream) { + return __asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* streamToIterable_1() { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = yield __await(reader.read()); + if (done) { + return yield __await(void 0); } + yield yield __await(value); } - out += this.input.slice(chunkStart, this.pos); - return this.finishToken(types$1.template, out); + } finally { + reader.releaseLock(); } - if (ch === 92) { - out += this.input.slice(chunkStart, this.pos); - out += this.readEscapedChar(true); - chunkStart = this.pos; - } else if (isNewLine(ch)) { - out += this.input.slice(chunkStart, this.pos); - ++this.pos; - switch (ch) { - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - out += "\n"; - break; - default: - out += String.fromCharCode(ch); - break; - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; + }, "streamToIterable_1")); +} +__name(streamToIterable, "streamToIterable"); +var debugFetch = /* @__PURE__ */ __name((input, init) => { + const url = typeof input === "string" ? new URL(input) : input instanceof URL ? input : new URL(input.url); + const headers = (init === null || init === void 0 ? void 0 : init.headers) ? new Headers(init.headers) : input instanceof Request ? input.headers : new Headers(); + const arr_headers = [...headers]; + const body_contents = (init === null || init === void 0 ? void 0 : init.body) ? typeof init.body === "string" ? headers.get("content-type") === "application/json" ? JSON.stringify(JSON.parse(init.body), null, 2) : init.body : " " : " (none)"; + const headers_serialized = arr_headers.length > 0 ? `${arr_headers.map(([key, value]) => ` ${key}: ${value}`).join("\n")}` : " (none)"; + console.log(`YouTube.js Fetch: + url: ${url.toString()} + method: ${(init === null || init === void 0 ? void 0 : init.method) || "GET"} + headers: +${headers_serialized} +' + + ' body: +${body_contents}`); + return Platform.shim.fetch(input, init); +}, "debugFetch"); +function u8ToBase64(u8) { + return btoa(String.fromCharCode.apply(null, Array.from(u8))); +} +__name(u8ToBase64, "u8ToBase64"); +function base64ToU8(base64) { + return new Uint8Array(atob(base64).split("").map((char) => char.charCodeAt(0))); +} +__name(base64ToU8, "base64ToU8"); +function isTextRun(run) { + return !("emoji" in run); +} +__name(isTextRun, "isTextRun"); +function findFunction(source, args) { + const { name, includes, regexp } = args; + const node = Jinter.parseScript(source); + const stack = [node]; + for (let i = 0; i < stack.length; i++) { + const current2 = stack[i]; + if (current2.type === "ExpressionStatement" && (current2.expression.type === "AssignmentExpression" && current2.expression.left.type === "Identifier" && current2.expression.right.type === "FunctionExpression")) { + const code = source.substring(current2.start, current2.end); + if (name && current2.expression.left.name === name || includes && code.indexOf(includes) > -1 || regexp && regexp.test(code)) { + return { + start: current2.start, + end: current2.end, + name: current2.expression.left.name, + node: current2, + result: code + }; } - chunkStart = this.pos; - } else { - ++this.pos; - } - } -}; -pp.readInvalidTemplateToken = function() { - for (; this.pos < this.input.length; this.pos++) { - switch (this.input[this.pos]) { - case "\\": - ++this.pos; - break; - case "$": - if (this.input[this.pos + 1] !== "{") { - break; - } - case "`": - return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)); } - } - this.raise(this.start, "Unterminated template"); -}; -pp.readEscapedChar = function(inTemplate) { - var ch = this.input.charCodeAt(++this.pos); - ++this.pos; - switch (ch) { - case 110: - return "\n"; - case 114: - return "\r"; - case 120: - return String.fromCharCode(this.readHexChar(2)); - case 117: - return codePointToString(this.readCodePoint()); - case 116: - return " "; - case 98: - return "\b"; - case 118: - return "\v"; - case 102: - return "\f"; - case 13: - if (this.input.charCodeAt(this.pos) === 10) { - ++this.pos; - } - case 10: - if (this.options.locations) { - this.lineStart = this.pos; - ++this.curLine; - } - return ""; - case 56: - case 57: - if (this.strict) { - this.invalidStringToken( - this.pos - 1, - "Invalid escape sequence" - ); - } - if (inTemplate) { - var codePos = this.pos - 1; - this.invalidStringToken( - codePos, - "Invalid escape sequence in template string" - ); - return null; - } - default: - if (ch >= 48 && ch <= 55) { - var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; - var octal = parseInt(octalStr, 8); - if (octal > 255) { - octalStr = octalStr.slice(0, -1); - octal = parseInt(octalStr, 8); - } - this.pos += octalStr.length - 1; - ch = this.input.charCodeAt(this.pos); - if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) { - this.invalidStringToken( - this.pos - 1 - octalStr.length, - inTemplate ? "Octal literal in template string" : "Octal literal in strict mode" - ); - } - return String.fromCharCode(octal); - } - if (isNewLine(ch)) { - return ""; - } - return String.fromCharCode(ch); - } -}; -pp.readHexChar = function(len) { - var codePos = this.pos; - var n = this.readInt(16, len); - if (n === null) { - this.invalidStringToken(codePos, "Bad character escape sequence"); - } - return n; -}; -pp.readWord1 = function() { - this.containsEsc = false; - var word = "", first = true, chunkStart = this.pos; - var astral = this.options.ecmaVersion >= 6; - while (this.pos < this.input.length) { - var ch = this.fullCharCodeAtPos(); - if (isIdentifierChar(ch, astral)) { - this.pos += ch <= 65535 ? 1 : 2; - } else if (ch === 92) { - this.containsEsc = true; - word += this.input.slice(chunkStart, this.pos); - var escStart = this.pos; - if (this.input.charCodeAt(++this.pos) !== 117) { - this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); - } - ++this.pos; - var esc = this.readCodePoint(); - if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) { - this.invalidStringToken(escStart, "Invalid Unicode escape"); + for (const key in current2) { + const child = current2[key]; + if (Array.isArray(child)) { + stack.push(...child); + } else if (typeof child === "object" && child !== null) { + stack.push(child); } - word += codePointToString(esc); - chunkStart = this.pos; - } else { - break; } - first = false; - } - return word + this.input.slice(chunkStart, this.pos); -}; -pp.readWord = function() { - var word = this.readWord1(); - var type = types$1.name; - if (this.keywords.test(word)) { - type = keywords[word]; - } - return this.finishToken(type, word); -}; -var version = "8.8.1"; -Parser2.acorn = { - Parser: Parser2, - version, - defaultOptions, - Position, - SourceLocation, - getLineInfo, - Node, - TokenType, - tokTypes: types$1, - keywordTypes: keywords, - TokContext, - tokContexts: types, - isIdentifierChar, - isIdentifierStart, - Token, - isNewLine, - lineBreak, - lineBreakG, - nonASCIIwhitespace -}; -function parse3(input, options) { - return Parser2.parse(input, options); + } +} +__name(findFunction, "findFunction"); + +// dist/src/platform/polyfills/web-crypto.js +function sha1Hash(str) { + return __awaiter(this, void 0, void 0, function* () { + const byteToHex = [ + "00", + "01", + "02", + "03", + "04", + "05", + "06", + "07", + "08", + "09", + "0a", + "0b", + "0c", + "0d", + "0e", + "0f", + "10", + "11", + "12", + "13", + "14", + "15", + "16", + "17", + "18", + "19", + "1a", + "1b", + "1c", + "1d", + "1e", + "1f", + "20", + "21", + "22", + "23", + "24", + "25", + "26", + "27", + "28", + "29", + "2a", + "2b", + "2c", + "2d", + "2e", + "2f", + "30", + "31", + "32", + "33", + "34", + "35", + "36", + "37", + "38", + "39", + "3a", + "3b", + "3c", + "3d", + "3e", + "3f", + "40", + "41", + "42", + "43", + "44", + "45", + "46", + "47", + "48", + "49", + "4a", + "4b", + "4c", + "4d", + "4e", + "4f", + "50", + "51", + "52", + "53", + "54", + "55", + "56", + "57", + "58", + "59", + "5a", + "5b", + "5c", + "5d", + "5e", + "5f", + "60", + "61", + "62", + "63", + "64", + "65", + "66", + "67", + "68", + "69", + "6a", + "6b", + "6c", + "6d", + "6e", + "6f", + "70", + "71", + "72", + "73", + "74", + "75", + "76", + "77", + "78", + "79", + "7a", + "7b", + "7c", + "7d", + "7e", + "7f", + "80", + "81", + "82", + "83", + "84", + "85", + "86", + "87", + "88", + "89", + "8a", + "8b", + "8c", + "8d", + "8e", + "8f", + "90", + "91", + "92", + "93", + "94", + "95", + "96", + "97", + "98", + "99", + "9a", + "9b", + "9c", + "9d", + "9e", + "9f", + "a0", + "a1", + "a2", + "a3", + "a4", + "a5", + "a6", + "a7", + "a8", + "a9", + "aa", + "ab", + "ac", + "ad", + "ae", + "af", + "b0", + "b1", + "b2", + "b3", + "b4", + "b5", + "b6", + "b7", + "b8", + "b9", + "ba", + "bb", + "bc", + "bd", + "be", + "bf", + "c0", + "c1", + "c2", + "c3", + "c4", + "c5", + "c6", + "c7", + "c8", + "c9", + "ca", + "cb", + "cc", + "cd", + "ce", + "cf", + "d0", + "d1", + "d2", + "d3", + "d4", + "d5", + "d6", + "d7", + "d8", + "d9", + "da", + "db", + "dc", + "dd", + "de", + "df", + "e0", + "e1", + "e2", + "e3", + "e4", + "e5", + "e6", + "e7", + "e8", + "e9", + "ea", + "eb", + "ec", + "ed", + "ee", + "ef", + "f0", + "f1", + "f2", + "f3", + "f4", + "f5", + "f6", + "f7", + "f8", + "f9", + "fa", + "fb", + "fc", + "fd", + "fe", + "ff" + ]; + function hex(arrayBuffer) { + const buff = new Uint8Array(arrayBuffer); + const hexOctets = []; + for (let i = 0; i < buff.length; ++i) + hexOctets.push(byteToHex[buff[i]]); + return hexOctets.join(""); + } + __name(hex, "hex"); + return hex(yield crypto.subtle.digest("SHA-1", new TextEncoder().encode(str))); + }); } -__name(parse3, "parse"); +__name(sha1Hash, "sha1Hash"); -// node_modules/jintr/dist/main.js -var __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -}; -var __classPrivateFieldGet5 = function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -}; -var _Jinter_ast; -var Jinter = class { - constructor() { - _Jinter_ast.set(this, []); - this.visitor = new Visitor(); - this.scope = this.visitor.scope; - this.scope.set("print", (args) => console.log(...args)); - this.defineObject("console", console); - this.defineObject("Math", Math); - this.defineObject("String", String); - this.defineObject("Array", Array); - this.defineObject("Date", Date); - } - defineObject(name, obj) { - this.visitor.on(name, (node, visitor) => { - if (node.type === "Identifier") - return obj; - if (node.type === "CallExpression" && node.callee.type === "MemberExpression") { - const prop = visitor.visitNode(node.callee.property); - const args = node.arguments.map((arg) => visitor.visitNode(arg)); - const callable = obj[prop]; - if (!callable) - return "__continue_exec"; - return callable.apply(obj, args); - } - return "__continue_exec"; - }); - } - evaluate(input) { - try { - const program = parse3(input, { ecmaVersion: 2020 }); - __classPrivateFieldSet2(this, _Jinter_ast, program.body, "f"); - } catch (e) { - throw new JinterError(e.message); +// dist/package.json +var package_default = { + name: "volumio-youtubei.js", + version: "0.3.8", + description: "Modified version of YouTube.js library for use with Volumio's YouTube Music plugin.", + type: "module", + types: "./dist/src/platform/lib.d.ts", + typesVersions: { + "*": { + agnostic: [ + "./dist/src/platform/lib.d.ts" + ], + web: [ + "./dist/src/platform/lib.d.ts" + ], + "web.bundle": [ + "./dist/src/platform/lib.d.ts" + ], + "web.bundle.min": [ + "./dist/src/platform/lib.d.ts" + ] } - this.visitor.setAST(__classPrivateFieldGet5(this, _Jinter_ast, "f")); - return this.visitor.run(); - } + }, + exports: { + ".": { + node: { + import: "./dist/src/platform/node.js", + require: "./bundle/node.cjs" + }, + deno: "./dist/src/platform/deno.js", + types: "./dist/src/platform/lib.d.ts", + browser: "./dist/src/platform/web.js", + default: "./dist/src/platform/web.js" + }, + "./agnostic": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/lib.js" + }, + "./web": { + types: "./dist/src/platform/lib.d.ts", + default: "./dist/src/platform/web.js" + }, + "./web.bundle": { + types: "./dist/src/platform/lib.d.ts", + default: "./bundle/browser.js" + }, + "./web.bundle.min": { + types: "./dist/src/platform/lib.d.ts", + default: "./bundle/browser.min.js" + } + }, + author: "Original author: LuanRT (https://github.com/LuanRT). Modified by Patrick Kan (https://github.com/patrickkfkan).", + funding: [ + "https://github.com/sponsors/LuanRT" + ], + contributors: [ + "Wykerd (https://github.com/wykerd/)", + "MasterOfBob777 (https://github.com/MasterOfBob777)", + "patrickkfkan (https://github.com/patrickkfkan)", + "akkadaska (https://github.com/akkadaska)" + ], + directories: { + test: "./test", + examples: "./examples", + dist: "./dist" + }, + scripts: { + test: "npx jest --verbose", + lint: "npx eslint ./src", + "lint:fix": "npx eslint --fix ./src", + build: "npm run build:parser-map && npm run build:proto && npm run build:esm && npm run bundle:node && npm run bundle:browser && npm run bundle:browser:prod", + "build:parser-map": "node ./scripts/build-parser-map.cjs", + "build:proto": 'npx pb-gen-ts --entry-path="src/proto" --out-dir="src/proto/generated" --ext-in-import=".js"', + "build:esm": "npx tsc", + "build:deno": `npx cpy ./src ./deno && npx cpy ./package.json ./deno && npx replace ".js';" ".ts';" ./deno -r && npx replace '.js";' '.ts";' ./deno -r && npx replace "'linkedom';" "'https://esm.sh/linkedom';" ./deno -r && npx replace "'jintr';" "'https://esm.sh/jintr';" ./deno -r && npx replace "new Jinter.default" "new Jinter" ./deno -r`, + "bundle:node": 'npx esbuild ./dist/src/platform/node.js --bundle --target=node10 --keep-names --format=cjs --platform=node --outfile=./bundle/node.cjs --external:jintr --external:undici --external:linkedom --sourcemap --banner:js="/* eslint-disable */"', + "bundle:browser": 'npx esbuild ./dist/src/platform/web.js --banner:js="/* eslint-disable */" --bundle --target=chrome58 --keep-names --format=esm --sourcemap --define:global=globalThis --conditions=module --outfile=./bundle/browser.js --platform=browser', + "bundle:browser:prod": "npm run bundle:browser -- --outfile=./bundle/browser.min.js --minify", + watch: "npx tsc --watch" + }, + repository: { + type: "git", + url: "git+https://github.com/patrickkfkan/Volumio-YouTube.js.git" + }, + license: "MIT", + dependencies: { + "event-target-polyfill": "0.0.3", + jintr: "^2.1.1", + linkedom: "^0.14.12", + "node-fetch": "^2.6.7", + tslib: "^2.5.0", + uuid: "^9.0.0", + "web-streams-polyfill": "^3.2.1" + }, + devDependencies: { + "@types/jest": "^28.1.7", + "@types/node": "^17.0.45", + "@types/node-fetch": "^2.6.11", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^5.30.6", + "@typescript-eslint/parser": "^5.30.6", + "cpy-cli": "^4.2.0", + esbuild: "^0.14.49", + eslint: "^8.19.0", + "eslint-plugin-tsdoc": "^0.2.16", + glob: "^8.0.3", + jest: "^28.1.3", + pbkit: "^0.0.59", + replace: "^1.2.2", + "ts-jest": "^28.0.8", + typescript: "^5.0.0" + }, + bugs: { + url: "https://github.com/patrickkfkan/Volumio-YouTube.js/issues" + }, + homepage: "https://github.com/patrickkfkan/Volumio-YouTube.js#readme", + keywords: [ + "yt", + "dl", + "ytdl", + "youtube", + "youtubedl", + "youtube-dl", + "youtube-downloader", + "youtube-music", + "youtube-studio", + "innertube", + "unofficial", + "downloader", + "livechat", + "studio", + "upload", + "ytmusic", + "search", + "music", + "api" + ] }; -__name(Jinter, "Jinter"); -_Jinter_ast = /* @__PURE__ */ new WeakMap(); // dist/src/core/Actions.js var _Actions_instances; @@ -20862,11 +20930,11 @@ var Actions_default = Actions; // dist/src/core/Player.js var TAG2 = "Player"; var Player = class { - constructor(signature_timestamp, sig_sc, nsig_sc, player_id) { + constructor(player_id, signature_timestamp, sig_sc, nsig_sc) { + this.player_id = player_id; + this.sts = signature_timestamp; this.nsig_sc = nsig_sc; this.sig_sc = sig_sc; - this.sts = signature_timestamp; - this.player_id = player_id; } static create(cache, fetch = Platform.shim.fetch) { return __awaiter(this, void 0, void 0, function* () { @@ -20901,7 +20969,7 @@ var Player = class { const sig_sc = this.extractSigSourceCode(player_js); const nsig_sc = this.extractNSigSourceCode(player_js); Log_default.info(TAG2, `Got signature timestamp (${sig_timestamp}) and algorithms needed to decipher signatures.`); - return yield Player.fromSource(cache, sig_timestamp, sig_sc, nsig_sc, player_id); + return yield Player.fromSource(player_id, sig_timestamp, cache, sig_sc, nsig_sc); }); } decipher(url, signature_cipher, cipher, this_response_nsig_cache) { @@ -20910,7 +20978,7 @@ var Player = class { throw new PlayerError("No valid URL to decipher"); const args = new URLSearchParams(url); const url_components = new URL(args.get("url") || url); - if (signature_cipher || cipher) { + if (this.sig_sc && (signature_cipher || cipher)) { const signature = Platform.shim.eval(this.sig_sc, { sig: args.get("s") }); @@ -20921,7 +20989,7 @@ var Player = class { sp ? url_components.searchParams.set(sp, signature) : url_components.searchParams.set("signature", signature); } const n = url_components.searchParams.get("n"); - if (n) { + if (this.nsig_sc && n) { let nsig; if (this_response_nsig_cache && this_response_nsig_cache.has(n)) { nsig = this_response_nsig_cache.get(n); @@ -20980,19 +21048,19 @@ var Player = class { const nsig_buf = buffer.slice(12 + sig_len); const sig_sc = LZW_exports.decompress(new TextDecoder().decode(sig_buf)); const nsig_sc = LZW_exports.decompress(new TextDecoder().decode(nsig_buf)); - return new Player(sig_timestamp, sig_sc, nsig_sc, player_id); + return new Player(player_id, sig_timestamp, sig_sc, nsig_sc); }); } - static fromSource(cache, sig_timestamp, sig_sc, nsig_sc, player_id) { + static fromSource(player_id, sig_timestamp, cache, sig_sc, nsig_sc) { return __awaiter(this, void 0, void 0, function* () { - const player = new Player(sig_timestamp, sig_sc, nsig_sc, player_id); + const player = new Player(player_id, sig_timestamp, sig_sc, nsig_sc); yield player.cache(cache); return player; }); } cache(cache) { return __awaiter(this, void 0, void 0, function* () { - if (!cache) + if (!cache || !this.sig_sc || !this.nsig_sc) return; const encoder = new TextEncoder(); const sig_buf = encoder.encode(LZW_exports.compress(this.sig_sc)); @@ -21020,20 +21088,16 @@ var Player = class { return `function descramble_sig(a) { a = a.split(""); let ${obj_name}={${functions}}${calls} return a.join("") } descramble_sig(sig);`; } static extractNSigSourceCode(data2) { - let sc = getStringBetweenStrings(data2, 'b=String.prototype.split.call(a,"")', '}return b.join("")}'); - if (sc) - return `function descramble_nsig(a) { let b=String.prototype.split.call(a,"")${sc}} return b.join(""); } descramble_nsig(nsig)`; - sc = getStringBetweenStrings(data2, 'b=String.prototype.split.call(a,"")', '}return Array.prototype.join.call(b,"")}'); - if (sc) - return `function descramble_nsig(a) { let b=String.prototype.split.call(a, "")${sc}} return Array.prototype.join.call(b, ""); } descramble_nsig(nsig)`; - Log_default.warn(TAG2, "Failed to extract n-token decipher algorithm"); - return "function descramble_nsig(a) { return a; } descramble_nsig(nsig)"; + const nsig_function = findFunction(data2, { includes: "enhanced_except" }); + if (nsig_function) { + return `${nsig_function.result} ${nsig_function.name}(nsig);`; + } } get url() { return new URL(`/s/player/${this.player_id}/player_ias.vflset/en_US/base.js`, Constants_exports.URLS.YT_BASE).toString(); } static get LIBRARY_VERSION() { - return 10; + return 11; } }; __name(Player, "Player"); diff --git a/bundle/browser.js.map b/bundle/browser.js.map index 1a8360b7..345c56cd 100644 --- a/bundle/browser.js.map +++ b/bundle/browser.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../node_modules/event-target-polyfill/index.js", "../node_modules/tslib/tslib.es6.mjs", "../src/parser/helpers.ts", "../src/parser/misc.ts", "../src/utils/Constants.ts", "../src/parser/classes/AudioOnlyPlayability.ts", "../src/utils/Cache.ts", "../src/utils/EventEmitterLike.ts", "../src/utils/FormatUtils.ts", "../src/utils/HTTPClient.ts", "../src/utils/Log.ts", "../src/utils/LZW.ts", "../src/parser/classes/Button.ts", "../src/parser/classes/DropdownItem.ts", "../src/parser/classes/Dropdown.ts", "../src/parser/classes/CreatePlaylistDialog.ts", "../src/parser/classes/NavigationEndpoint.ts", "../src/parser/classes/misc/Thumbnail.ts", "../src/parser/classes/misc/EmojiRun.ts", "../src/parser/classes/misc/TextRun.ts", "../src/parser/classes/misc/Text.ts", "../src/parser/classes/CardCollection.ts", "../src/parser/classes/Endscreen.ts", "../src/parser/classes/PlayerAnnotationsExpanded.ts", "../src/parser/classes/PlayerCaptionsTracklist.ts", "../src/parser/classes/PlayerLiveStoryboardSpec.ts", "../src/parser/classes/PlayerStoryboardSpec.ts", "../src/parser/classes/Message.ts", "../src/parser/classes/LiveChatParticipant.ts", "../src/parser/classes/LiveChatParticipantsList.ts", "../src/parser/classes/SortFilterSubMenu.ts", "../src/parser/classes/menus/Menu.ts", "../src/parser/classes/LiveChatHeader.ts", "../src/parser/classes/LiveChatItemList.ts", "../src/parser/classes/Alert.ts", "../src/parser/classes/menus/MusicMultiSelectMenuItem.ts", "../src/parser/classes/misc/Format.ts", "../src/parser/classes/misc/VideoDetails.ts", "../src/parser/nodes.ts", "../src/parser/classes/ChannelExternalLinkView.ts", "../src/parser/classes/AboutChannelView.ts", "../src/parser/classes/AccountChannel.ts", "../src/parser/classes/AccountItemSectionHeader.ts", "../src/parser/classes/AccountItemSection.ts", "../src/parser/classes/AccountSectionList.ts", "../src/parser/classes/actions/AppendContinuationItemsAction.ts", "../src/parser/classes/actions/OpenPopupAction.ts", "../src/parser/classes/analytics/DataModelSection.ts", "../src/parser/classes/analytics/AnalyticsMainAppKeyMetrics.ts", "../src/parser/classes/analytics/AnalyticsRoot.ts", "../src/parser/classes/analytics/AnalyticsShortsCarouselCard.ts", "../src/parser/classes/analytics/AnalyticsVideo.ts", "../src/parser/classes/analytics/AnalyticsVodCarouselCard.ts", "../src/parser/classes/analytics/CtaGoToCreatorStudio.ts", "../src/parser/classes/analytics/StatRow.ts", "../src/parser/classes/AttributionView.ts", "../src/parser/classes/AutomixPreviewVideo.ts", "../src/parser/classes/AvatarView.ts", "../src/parser/classes/BackstageImage.ts", "../src/parser/classes/ToggleButton.ts", "../src/parser/classes/comments/CreatorHeart.ts", "../src/parser/classes/comments/CommentActionButtons.ts", "../src/parser/classes/BackstagePost.ts", "../src/parser/classes/BackstagePostThread.ts", "../src/parser/classes/BrowseFeedActions.ts", "../src/parser/classes/BrowserMediaSession.ts", "../src/parser/classes/ButtonView.ts", "../src/parser/classes/ChannelHeaderLinks.ts", "../src/parser/classes/SubscriptionNotificationToggleButton.ts", "../src/parser/classes/SubscribeButton.ts", "../src/parser/classes/C4TabbedHeader.ts", "../src/parser/classes/CallToActionButton.ts", "../src/parser/classes/Card.ts", "../src/parser/classes/CarouselHeader.ts", "../src/parser/classes/CarouselItem.ts", "../src/parser/classes/InfoRow.ts", "../src/parser/classes/MetadataBadge.ts", "../src/parser/classes/CompactVideo.ts", "../src/parser/classes/CarouselLockup.ts", "../src/parser/classes/Channel.ts", "../src/parser/classes/ChannelAboutFullMetadata.ts", "../src/parser/classes/ChannelAgeGate.ts", "../src/parser/classes/ChannelFeaturedContent.ts", "../src/parser/classes/ChannelMetadata.ts", "../src/parser/classes/ChannelMobileHeader.ts", "../src/parser/classes/ChannelOptions.ts", "../src/parser/classes/ChannelSubMenu.ts", "../src/parser/classes/ChannelThumbnailWithLink.ts", "../src/parser/classes/ChannelVideoPlayer.ts", "../src/parser/classes/Chapter.ts", "../src/parser/classes/ChildVideo.ts", "../src/parser/classes/ChipCloudChip.ts", "../src/parser/classes/ChipCloud.ts", "../src/parser/classes/ClipAdState.ts", "../src/parser/classes/ClipCreationTextInput.ts", "../src/parser/classes/ClipCreationScrubber.ts", "../src/parser/classes/ClipCreation.ts", "../src/parser/classes/ClipSection.ts", "../src/parser/classes/CollaboratorInfoCardContent.ts", "../src/parser/classes/CollageHeroImage.ts", "../src/parser/classes/comments/AuthorCommentBadge.ts", "../src/parser/classes/comments/CommentReplyDialog.ts", "../src/parser/classes/comments/PdgCommentChip.ts", "../src/parser/classes/comments/SponsorCommentBadge.ts", "../src/proto/generated/runtime/wire/index.ts", "../src/proto/generated/runtime/Long.ts", "../src/proto/generated/runtime/wire/varint.ts", "../src/proto/generated/runtime/wire/serialize.ts", "../src/proto/generated/runtime/wire/zigzag.ts", "../src/proto/generated/runtime/wire/scalar.ts", "../src/proto/generated/runtime/wire/deserialize.ts", "../src/proto/generated/messages/youtube/VisitorData.ts", "../src/proto/generated/messages/youtube/(ChannelAnalytics)/Params.ts", "../src/proto/generated/messages/youtube/ChannelAnalytics.ts", "../src/proto/generated/messages/youtube/(SearchFilter)/Filters.ts", "../src/proto/generated/messages/youtube/SearchFilter.ts", "../src/proto/generated/messages/youtube/(MusicSearchFilter)/(Filters)/Type.ts", "../src/proto/generated/messages/youtube/(MusicSearchFilter)/Filters.ts", "../src/proto/generated/messages/youtube/MusicSearchFilter.ts", "../src/proto/generated/messages/youtube/(LiveMessageParams)/(Params)/Ids.ts", "../src/proto/generated/messages/youtube/(LiveMessageParams)/Params.ts", "../src/proto/generated/messages/youtube/LiveMessageParams.ts", "../src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Context.ts", "../src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/(RepliesOptions)/UnkOpts.ts", "../src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/RepliesOptions.ts", "../src/proto/generated/messages/youtube/(GetCommentsSectionParams)/(Params)/Options.ts", "../src/proto/generated/messages/youtube/(GetCommentsSectionParams)/Params.ts", "../src/proto/generated/messages/youtube/GetCommentsSectionParams.ts", "../src/proto/generated/messages/youtube/(CreateCommentParams)/Params.ts", "../src/proto/generated/messages/youtube/CreateCommentParams.ts", "../src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/(Params)/Comment.ts", "../src/proto/generated/messages/youtube/(PeformCommentActionParams)/(TranslateCommentParams)/Params.ts", "../src/proto/generated/messages/youtube/(PeformCommentActionParams)/TranslateCommentParams.ts", "../src/proto/generated/messages/youtube/PeformCommentActionParams.ts", "../src/proto/generated/messages/youtube/(NotificationPreferences)/Preference.ts", "../src/proto/generated/messages/youtube/NotificationPreferences.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/(Context)/Client.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Context.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Title.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Description.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Tags.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Category.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/License.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/(VideoThumbnail)/Thumbnail.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/VideoThumbnail.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/Privacy.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/MadeForKids.ts", "../src/proto/generated/messages/youtube/(InnertubePayload)/AgeRestricted.ts", "../src/proto/generated/messages/youtube/InnertubePayload.ts", "../src/proto/generated/messages/youtube/(Hashtag)/Params.ts", "../src/proto/generated/messages/youtube/Hashtag.ts", "../src/proto/index.ts", "../src/parser/classes/comments/Comment.ts", "../src/parser/classes/comments/EmojiPicker.ts", "../src/parser/classes/comments/CommentDialog.ts", "../src/parser/classes/comments/CommentReplies.ts", "../src/parser/classes/comments/CommentsEntryPointTeaser.ts", "../src/parser/classes/comments/CommentsEntryPointHeader.ts", "../src/parser/classes/comments/CommentsHeader.ts", "../src/parser/classes/comments/CommentSimplebox.ts", "../src/parser/classes/ContinuationItem.ts", "../src/parser/classes/comments/CommentThread.ts", "../src/parser/classes/CompactChannel.ts", "../src/parser/classes/CompactLink.ts", "../src/parser/classes/Playlist.ts", "../src/parser/classes/CompactMix.ts", "../src/parser/classes/CompactPlaylist.ts", "../src/parser/classes/CompactStation.ts", "../src/parser/classes/ConfirmDialog.ts", "../src/parser/classes/ContentMetadataView.ts", "../src/parser/classes/ContentPreviewImageView.ts", "../src/parser/classes/ConversationBar.ts", "../src/parser/classes/CopyLink.ts", "../src/parser/classes/DecoratedAvatarView.ts", "../src/parser/classes/HeatMarker.ts", "../src/parser/classes/Heatmap.ts", "../src/parser/classes/MultiMarkersPlayerBar.ts", "../src/parser/classes/DecoratedPlayerBar.ts", "../src/parser/classes/DefaultPromoPanel.ts", "../src/parser/classes/EngagementPanelTitleHeader.ts", "../src/parser/classes/MacroMarkersInfoItem.ts", "../src/parser/classes/MacroMarkersListItem.ts", "../src/parser/classes/MacroMarkersList.ts", "../src/parser/classes/ProductList.ts", "../src/parser/classes/SectionList.ts", "../src/parser/classes/ExpandableVideoDescriptionBody.ts", "../src/parser/classes/SearchRefinementCard.ts", "../src/parser/classes/GameCard.ts", "../src/parser/classes/ExpandableMetadata.ts", "../src/parser/classes/ThumbnailOverlayTimeStatus.ts", "../src/parser/classes/Video.ts", "../src/parser/classes/VideoCard.ts", "../src/parser/classes/HorizontalCardList.ts", "../src/parser/classes/Factoid.ts", "../src/parser/classes/UploadTimeFactoid.ts", "../src/parser/classes/ViewCountFactoid.ts", "../src/parser/classes/VideoDescriptionHeader.ts", "../src/parser/classes/VideoDescriptionInfocardsSection.ts", "../src/parser/classes/VideoDescriptionMusicSection.ts", "../src/parser/classes/VideoDescriptionTranscriptSection.ts", "../src/parser/classes/StructuredDescriptionPlaylistLockup.ts", "../src/parser/classes/VideoDescriptionCourseSection.ts", "../src/parser/classes/ReelShelf.ts", "../src/parser/classes/StructuredDescriptionContent.ts", "../src/parser/classes/VideoAttributeView.ts", "../src/parser/classes/EngagementPanelSectionList.ts", "../src/parser/classes/DescriptionPreviewView.ts", "../src/parser/classes/DidYouMean.ts", "../src/parser/classes/DownloadButton.ts", "../src/parser/classes/DynamicTextView.ts", "../src/parser/classes/misc/ChildElement.ts", "../src/parser/classes/Element.ts", "../src/parser/classes/EmergencyOnebox.ts", "../src/parser/classes/EmojiPickerCategory.ts", "../src/parser/classes/EmojiPickerCategoryButton.ts", "../src/parser/classes/EmojiPickerUpsellCategory.ts", "../src/parser/classes/EndscreenElement.ts", "../src/parser/classes/EndScreenPlaylist.ts", "../src/parser/classes/EndScreenVideo.ts", "../src/parser/classes/ExpandableTab.ts", "../src/parser/classes/ExpandedShelfContents.ts", "../src/parser/classes/FeedFilterChipBar.ts", "../src/parser/classes/FeedTabbedHeader.ts", "../src/parser/classes/ToggleButtonView.ts", "../src/parser/classes/FlexibleActionsView.ts", "../src/parser/classes/GameDetails.ts", "../src/parser/classes/Grid.ts", "../src/parser/classes/GridChannel.ts", "../src/parser/classes/GridHeader.ts", "../src/parser/classes/GridMix.ts", "../src/parser/classes/GridMovie.ts", "../src/parser/classes/GridPlaylist.ts", "../src/parser/classes/ShowCustomThumbnail.ts", "../src/parser/classes/ThumbnailOverlayBottomPanel.ts", "../src/parser/classes/GridShow.ts", "../src/parser/classes/GridVideo.ts", "../src/parser/classes/GuideEntry.ts", "../src/parser/classes/GuideCollapsibleEntry.ts", "../src/parser/classes/GuideCollapsibleSectionEntry.ts", "../src/parser/classes/GuideDownloadsEntry.ts", "../src/parser/classes/GuideSection.ts", "../src/parser/classes/GuideSubscriptionsSection.ts", "../src/parser/classes/HashtagHeader.ts", "../src/parser/classes/HeroPlaylistThumbnail.ts", "../src/parser/classes/HighlightsCarousel.ts", "../src/parser/classes/SearchSuggestion.ts", "../src/parser/classes/HistorySuggestion.ts", "../src/parser/classes/HorizontalList.ts", "../src/parser/classes/HorizontalMovieList.ts", "../src/parser/classes/IconLink.ts", "../src/parser/classes/ImageBannerView.ts", "../src/parser/classes/InfoPanelContent.ts", "../src/parser/classes/InfoPanelContainer.ts", "../src/parser/classes/InteractiveTabbedHeader.ts", "../src/parser/classes/ItemSectionHeader.ts", "../src/parser/classes/ItemSectionTab.ts", "../src/parser/classes/ItemSectionTabbedHeader.ts", "../src/parser/classes/ItemSection.ts", "../src/parser/classes/LikeButton.ts", "../src/parser/classes/LiveChat.ts", "../src/parser/classes/livechat/items/LiveChatBannerHeader.ts", "../src/parser/classes/livechat/items/LiveChatBanner.ts", "../src/parser/classes/livechat/AddBannerToLiveChatCommand.ts", "../src/parser/classes/livechat/AddChatItemAction.ts", "../src/parser/classes/livechat/AddLiveChatTickerItemAction.ts", "../src/parser/classes/livechat/DimChatItemAction.ts", "../src/parser/classes/livechat/items/LiveChatAutoModMessage.ts", "../src/parser/classes/livechat/items/LiveChatBannerPoll.ts", "../src/parser/classes/livechat/items/LiveChatMembershipItem.ts", "../src/parser/classes/livechat/items/LiveChatPaidMessage.ts", "../src/parser/classes/livechat/items/LiveChatPaidSticker.ts", "../src/parser/classes/livechat/items/LiveChatPlaceholderItem.ts", "../src/parser/classes/livechat/items/LiveChatProductItem.ts", "../src/parser/classes/livechat/items/LiveChatRestrictedParticipation.ts", "../src/parser/classes/livechat/items/LiveChatTextMessage.ts", "../src/parser/classes/livechat/items/LiveChatTickerPaidMessageItem.ts", "../src/parser/classes/livechat/items/LiveChatTickerPaidStickerItem.ts", "../src/parser/classes/livechat/items/LiveChatTickerSponsorItem.ts", "../src/parser/classes/livechat/items/LiveChatViewerEngagementMessage.ts", "../src/parser/classes/livechat/items/PollHeader.ts", "../src/parser/classes/livechat/LiveChatActionPanel.ts", "../src/parser/classes/livechat/MarkChatItemAsDeletedAction.ts", "../src/parser/classes/livechat/MarkChatItemsByAuthorAsDeletedAction.ts", "../src/parser/classes/livechat/RemoveBannerForLiveChatCommand.ts", "../src/parser/classes/livechat/RemoveChatItemAction.ts", "../src/parser/classes/livechat/RemoveChatItemByAuthorAction.ts", "../src/parser/classes/livechat/ReplaceChatItemAction.ts", "../src/parser/classes/livechat/ReplayChatItemAction.ts", "../src/parser/classes/livechat/ShowLiveChatActionPanelAction.ts", "../src/parser/classes/livechat/ShowLiveChatDialogAction.ts", "../src/parser/classes/livechat/ShowLiveChatTooltipCommand.ts", "../src/parser/classes/livechat/UpdateDateTextAction.ts", "../src/parser/classes/livechat/UpdateDescriptionAction.ts", "../src/parser/classes/livechat/UpdateLiveChatPollAction.ts", "../src/parser/classes/livechat/UpdateTitleAction.ts", "../src/parser/classes/livechat/UpdateToggleButtonTextAction.ts", "../src/parser/classes/livechat/UpdateViewershipAction.ts", "../src/parser/classes/LiveChatAuthorBadge.ts", "../src/parser/classes/LiveChatDialog.ts", "../src/parser/classes/LiveChatMessageInput.ts", "../src/parser/classes/menus/MenuNavigationItem.ts", "../src/parser/classes/menus/MenuServiceItem.ts", "../src/parser/classes/menus/MenuServiceItemDownload.ts", "../src/parser/classes/menus/MultiPageMenu.ts", "../src/parser/classes/menus/MultiPageMenuNotificationSection.ts", "../src/parser/classes/menus/MusicMenuItemDivider.ts", "../src/parser/classes/menus/MusicMultiSelectMenu.ts", "../src/parser/classes/menus/SimpleMenuHeader.ts", "../src/parser/classes/MerchandiseItem.ts", "../src/parser/classes/MerchandiseShelf.ts", "../src/parser/classes/MetadataRow.ts", "../src/parser/classes/MetadataRowContainer.ts", "../src/parser/classes/MetadataRowHeader.ts", "../src/parser/classes/MetadataScreen.ts", "../src/parser/classes/MicroformatData.ts", "../src/parser/classes/Mix.ts", "../src/parser/classes/Movie.ts", "../src/parser/classes/MovingThumbnail.ts", "../src/parser/classes/MusicCardShelfHeaderBasic.ts", "../src/parser/classes/MusicInlineBadge.ts", "../src/parser/classes/MusicPlayButton.ts", "../src/parser/classes/MusicItemThumbnailOverlay.ts", "../src/parser/classes/MusicThumbnail.ts", "../src/parser/classes/MusicCardShelf.ts", "../src/parser/classes/MusicCarouselShelfBasicHeader.ts", "../src/parser/classes/MusicNavigationButton.ts", "../src/parser/classes/MusicResponsiveListItemFixedColumn.ts", "../src/parser/classes/MusicResponsiveListItemFlexColumn.ts", "../src/parser/classes/MusicResponsiveListItem.ts", "../src/parser/classes/MusicTwoRowItem.ts", "../src/parser/classes/MusicCarouselShelf.ts", "../src/parser/classes/MusicDescriptionShelf.ts", "../src/parser/classes/MusicDetailHeader.ts", "../src/parser/classes/MusicDownloadStateBadge.ts", "../src/parser/classes/MusicEditablePlaylistDetailHeader.ts", "../src/parser/classes/MusicElementHeader.ts", "../src/parser/classes/MusicHeader.ts", "../src/parser/classes/MusicImmersiveHeader.ts", "../src/parser/classes/MusicLargeCardItemCarousel.ts", "../src/parser/classes/MusicPlaylistShelf.ts", "../src/parser/classes/PlaylistPanelVideo.ts", "../src/parser/classes/PlaylistPanelVideoWrapper.ts", "../src/parser/classes/PlaylistPanel.ts", "../src/parser/classes/MusicQueue.ts", "../src/parser/classes/MusicResponsiveHeader.ts", "../src/parser/classes/MusicShelf.ts", "../src/parser/classes/MusicSideAlignedItem.ts", "../src/parser/classes/MusicSortFilterButton.ts", "../src/parser/classes/MusicTastebuilderShelfThumbnail.ts", "../src/parser/classes/MusicTastebuilderShelf.ts", "../src/parser/classes/MusicVisualHeader.ts", "../src/parser/classes/Notification.ts", "../src/parser/classes/PageHeaderView.ts", "../src/parser/classes/PageHeader.ts", "../src/parser/classes/PageIntroduction.ts", "../src/parser/classes/PlayerErrorMessage.ts", "../src/parser/classes/PlayerLegacyDesktopYpcOffer.ts", "../src/parser/classes/YpcTrailer.ts", "../src/parser/classes/PlayerLegacyDesktopYpcTrailer.ts", "../src/parser/classes/PlayerMicroformat.ts", "../src/parser/classes/PlayerOverlayAutoplay.ts", "../src/parser/classes/WatchNextEndScreen.ts", "../src/parser/classes/PlayerOverlay.ts", "../src/parser/classes/PlaylistCustomThumbnail.ts", "../src/parser/classes/PlaylistHeader.ts", "../src/parser/classes/PlaylistInfoCardContent.ts", "../src/parser/classes/PlaylistMetadata.ts", "../src/parser/classes/PlaylistSidebar.ts", "../src/parser/classes/PlaylistSidebarPrimaryInfo.ts", "../src/parser/classes/PlaylistSidebarSecondaryInfo.ts", "../src/parser/classes/PlaylistVideo.ts", "../src/parser/classes/PlaylistVideoList.ts", "../src/parser/classes/PlaylistVideoThumbnail.ts", "../src/parser/classes/Poll.ts", "../src/parser/classes/Post.ts", "../src/parser/classes/PostMultiImage.ts", "../src/parser/classes/ProfileColumn.ts", "../src/parser/classes/ProfileColumnStats.ts", "../src/parser/classes/ProfileColumnStatsEntry.ts", "../src/parser/classes/ProfileColumnUserInfo.ts", "../src/parser/classes/RecognitionShelf.ts", "../src/parser/classes/ReelItem.ts", "../src/parser/classes/RelatedChipCloud.ts", "../src/parser/classes/RichGrid.ts", "../src/parser/classes/RichItem.ts", "../src/parser/classes/RichListHeader.ts", "../src/parser/classes/RichMetadata.ts", "../src/parser/classes/RichMetadataRow.ts", "../src/parser/classes/RichSection.ts", "../src/parser/classes/RichShelf.ts", "../src/parser/classes/SearchBox.ts", "../src/parser/classes/SearchFilter.ts", "../src/parser/classes/SearchFilterGroup.ts", "../src/parser/classes/SearchSubMenu.ts", "../src/parser/classes/SearchSuggestionsSection.ts", "../src/parser/classes/SecondarySearchContainer.ts", "../src/parser/classes/SegmentedLikeDislikeButton.ts", "../src/parser/classes/SettingBoolean.ts", "../src/parser/classes/SettingsCheckbox.ts", "../src/parser/classes/SettingsSwitch.ts", "../src/parser/classes/SettingsOptions.ts", "../src/parser/classes/SettingsSidebar.ts", "../src/parser/classes/SharedPost.ts", "../src/parser/classes/Shelf.ts", "../src/parser/classes/ShowingResultsFor.ts", "../src/parser/classes/SimpleCardContent.ts", "../src/parser/classes/SimpleCardTeaser.ts", "../src/parser/classes/SimpleTextSection.ts", "../src/parser/classes/SingleActionEmergencySupport.ts", "../src/parser/classes/Tab.ts", "../src/parser/classes/SingleColumnBrowseResults.ts", "../src/parser/classes/SingleColumnMusicWatchNextResults.ts", "../src/parser/classes/SingleHeroImage.ts", "../src/parser/classes/SlimOwner.ts", "../src/parser/classes/SlimVideoMetadata.ts", "../src/parser/classes/SubFeedOption.ts", "../src/parser/classes/SubFeedSelector.ts", "../src/parser/classes/Tabbed.ts", "../src/parser/classes/TabbedSearchResults.ts", "../src/parser/classes/TextHeader.ts", "../src/parser/classes/ThumbnailLandscapePortrait.ts", "../src/parser/classes/ThumbnailOverlayEndorsement.ts", "../src/parser/classes/ThumbnailOverlayHoverText.ts", "../src/parser/classes/ThumbnailOverlayInlineUnplayable.ts", "../src/parser/classes/ThumbnailOverlayLoadingPreview.ts", "../src/parser/classes/ThumbnailOverlayNowPlaying.ts", "../src/parser/classes/ThumbnailOverlayPinking.ts", "../src/parser/classes/ThumbnailOverlayPlaybackStatus.ts", "../src/parser/classes/ThumbnailOverlayResumePlayback.ts", "../src/parser/classes/ThumbnailOverlaySidePanel.ts", "../src/parser/classes/ThumbnailOverlayToggleButton.ts", "../src/parser/classes/TimedMarkerDecoration.ts", "../src/parser/classes/TitleAndButtonListHeader.ts", "../src/parser/classes/ToggleMenuServiceItem.ts", "../src/parser/classes/Tooltip.ts", "../src/parser/classes/TopicChannelDetails.ts", "../src/parser/classes/TwoColumnBrowseResults.ts", "../src/parser/classes/TwoColumnSearchResults.ts", "../src/parser/classes/TwoColumnWatchNextResults.ts", "../src/parser/classes/UniversalWatchCard.ts", "../src/parser/classes/UpsellDialog.ts", "../src/parser/classes/VerticalList.ts", "../src/parser/classes/VerticalWatchCardList.ts", "../src/parser/classes/VideoInfoCardContent.ts", "../src/parser/classes/VideoOwner.ts", "../src/parser/classes/VideoPrimaryInfo.ts", "../src/parser/classes/VideoSecondaryInfo.ts", "../src/parser/classes/WatchCardCompactVideo.ts", "../src/parser/classes/WatchCardHeroVideo.ts", "../src/parser/classes/WatchCardRichHeader.ts", "../src/parser/classes/WatchCardSectionSequence.ts", "../src/parser/classes/WatchNextTabbedResults.ts", "../src/parser/classes/ytkids/AnchoredSection.ts", "../src/parser/classes/ytkids/KidsCategoryTab.ts", "../src/parser/classes/ytkids/KidsCategoriesHeader.ts", "../src/parser/classes/ytkids/KidsHomeScreen.ts", "../src/parser/generator.ts", "../src/parser/parser.ts", "../src/parser/youtube/index.ts", "../src/parser/youtube/AccountInfo.ts", "../src/parser/youtube/Analytics.ts", "../src/core/mixins/Feed.ts", "../src/core/mixins/TabbedFeed.ts", "../src/core/mixins/FilterableFeed.ts", "../src/parser/youtube/Channel.ts", "../src/parser/youtube/Comments.ts", "../src/parser/youtube/Guide.ts", "../src/parser/youtube/History.ts", "../src/parser/youtube/HomeFeed.ts", "../src/parser/youtube/HashtagFeed.ts", "../src/parser/youtube/ItemMenu.ts", "../src/parser/youtube/Playlist.ts", "../src/parser/youtube/Library.ts", "../src/parser/youtube/SmoothedQueue.ts", "../src/parser/youtube/LiveChat.ts", "../src/parser/youtube/NotificationsMenu.ts", "../src/parser/youtube/Search.ts", "../src/parser/youtube/Settings.ts", "../src/parser/youtube/TimeWatched.ts", "../src/core/mixins/index.ts", "../src/core/mixins/MediaInfo.ts", "../src/parser/youtube/VideoInfo.ts", "../src/parser/ytmusic/index.ts", "../src/parser/ytmusic/Album.ts", "../src/parser/ytmusic/Artist.ts", "../src/parser/ytmusic/Explore.ts", "../src/parser/ytmusic/HomeFeed.ts", "../src/parser/ytmusic/Library.ts", "../src/parser/ytmusic/Playlist.ts", "../src/parser/ytmusic/Recap.ts", "../src/parser/ytmusic/Search.ts", "../src/parser/ytmusic/TrackInfo.ts", "../src/parser/ytkids/index.ts", "../src/parser/ytkids/Channel.ts", "../src/parser/ytkids/HomeFeed.ts", "../src/parser/ytkids/Search.ts", "../src/parser/ytkids/VideoInfo.ts", "../src/parser/index.ts", "../src/parser/classes/misc/Author.ts", "../src/utils/user-agents.ts", "../src/utils/Utils.ts", "../src/platform/polyfills/web-crypto.ts", "../node_modules/jintr/dist/nodes/index.js", "../node_modules/jintr/dist/nodes/BaseJSNode.js", "../node_modules/jintr/dist/nodes/ArrayExpression.js", "../node_modules/jintr/dist/utils/index.js", "../node_modules/jintr/dist/nodes/ArrowFunctionExpression.js", "../node_modules/jintr/dist/nodes/AssignmentExpression.js", "../node_modules/jintr/dist/nodes/BinaryExpression.js", "../node_modules/jintr/dist/nodes/BlockStatement.js", "../node_modules/jintr/dist/nodes/BreakStatement.js", "../node_modules/jintr/dist/nodes/CallExpression.js", "../node_modules/jintr/dist/nodes/ConditionalExpression.js", "../node_modules/jintr/dist/nodes/ContinueStatement.js", "../node_modules/jintr/dist/nodes/ExpressionStatement.js", "../node_modules/jintr/dist/nodes/ForOfStatement.js", "../node_modules/jintr/dist/nodes/ForStatement.js", "../node_modules/jintr/dist/nodes/FunctionDeclaration.js", "../node_modules/jintr/dist/nodes/FunctionExpression.js", "../node_modules/jintr/dist/nodes/Identifier.js", "../node_modules/jintr/dist/nodes/IfStatement.js", "../node_modules/jintr/dist/nodes/Literal.js", "../node_modules/jintr/dist/nodes/LogicalExpression.js", "../node_modules/jintr/dist/nodes/MemberExpression.js", "../node_modules/jintr/dist/nodes/NewExpression.js", "../node_modules/jintr/dist/nodes/ObjectExpression.js", "../node_modules/jintr/dist/nodes/Property.js", "../node_modules/jintr/dist/nodes/ReturnStatement.js", "../node_modules/jintr/dist/nodes/SequenceExpression.js", "../node_modules/jintr/dist/nodes/SwitchCase.js", "../node_modules/jintr/dist/nodes/SwitchStatement.js", "../node_modules/jintr/dist/nodes/ThisExpression.js", "../node_modules/jintr/dist/nodes/ThrowStatement.js", "../node_modules/jintr/dist/nodes/TryStatement.js", "../node_modules/jintr/dist/nodes/UnaryExpression.js", "../node_modules/jintr/dist/nodes/UpdateExpression.js", "../node_modules/jintr/dist/nodes/VariableDeclaration.js", "../node_modules/jintr/dist/nodes/WhileStatement.js", "../node_modules/jintr/dist/visitor.js", "../node_modules/acorn/dist/acorn.mjs", "../node_modules/jintr/dist/main.js", "../src/core/Actions.ts", "../src/core/Player.ts", "../src/core/OAuth.ts", "../src/core/Session.ts", "../src/core/clients/index.ts", "../src/core/endpoints/index.ts", "../src/core/endpoints/BrowseEndpoint.ts", "../src/core/endpoints/GetNotificationMenuEndpoint.ts", "../src/core/endpoints/GuideEndpoint.ts", "../src/core/endpoints/NextEndpoint.ts", "../src/core/endpoints/PlayerEndpoint.ts", "../src/core/endpoints/ResolveURLEndpoint.ts", "../src/core/endpoints/SearchEndpoint.ts", "../src/core/endpoints/account/index.ts", "../src/core/endpoints/account/AccountListEndpoint.ts", "../src/core/endpoints/browse/index.ts", "../src/core/endpoints/browse/EditPlaylistEndpoint.ts", "../src/core/endpoints/channel/index.ts", "../src/core/endpoints/channel/EditNameEndpoint.ts", "../src/core/endpoints/channel/EditDescriptionEndpoint.ts", "../src/core/endpoints/comment/index.ts", "../src/core/endpoints/comment/PerformCommentActionEndpoint.ts", "../src/core/endpoints/comment/CreateCommentEndpoint.ts", "../src/core/endpoints/like/index.ts", "../src/core/endpoints/like/LikeEndpoint.ts", "../src/core/endpoints/like/DislikeEndpoint.ts", "../src/core/endpoints/like/RemoveLikeEndpoint.ts", "../src/core/endpoints/music/index.ts", "../src/core/endpoints/music/GetSearchSuggestionsEndpoint.ts", "../src/core/endpoints/notification/index.ts", "../src/core/endpoints/notification/GetUnseenCountEndpoint.ts", "../src/core/endpoints/notification/ModifyChannelPreferenceEndpoint.ts", "../src/core/endpoints/playlist/index.ts", "../src/core/endpoints/playlist/CreateEndpoint.ts", "../src/core/endpoints/playlist/DeleteEndpoint.ts", "../src/core/endpoints/subscription/index.ts", "../src/core/endpoints/subscription/SubscribeEndpoint.ts", "../src/core/endpoints/subscription/UnsubscribeEndpoint.ts", "../src/core/endpoints/upload/index.ts", "../src/core/endpoints/upload/CreateVideoEndpoint.ts", "../src/core/clients/Kids.ts", "../src/core/clients/Music.ts", "../src/core/clients/Studio.ts", "../src/core/managers/index.ts", "../src/core/managers/AccountManager.ts", "../src/core/managers/PlaylistManager.ts", "../src/core/managers/InteractionManager.ts", "../src/Innertube.ts", "../src/types/index.ts", "../src/platform/lib.ts", "../src/platform/jsruntime/jinter.ts", "../src/platform/web.ts"], - "sourcesContent": ["const root =\n (typeof globalThis !== \"undefined\" && globalThis) ||\n (typeof self !== \"undefined\" && self) ||\n (typeof global !== \"undefined\" && global);\n\nfunction isConstructor(fn) {\n try {\n new fn();\n } catch (error) {\n return false;\n }\n return true;\n}\n\nif (typeof root.Event !== \"function\" || !isConstructor(root.Event)) {\n root.Event = (function () {\n function Event(type, options) {\n this.bubbles = !!options && !!options.bubbles;\n this.cancelable = !!options && !!options.cancelable;\n this.composed = !!options && !!options.composed;\n this.type = type;\n }\n\n return Event;\n })();\n}\n\nif (typeof root.EventTarget === \"undefined\" || !isConstructor(root.Event)) {\n root.EventTarget = (function () {\n function EventTarget() {\n this.__listeners = new Map();\n }\n\n EventTarget.prototype = Object.create(Object.prototype);\n\n EventTarget.prototype.addEventListener = function (\n type,\n listener,\n options\n ) {\n if (arguments.length < 2) {\n throw new TypeError(\n `TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only ${arguments.length} present.`\n );\n }\n const __listeners = this.__listeners;\n const actualType = type.toString();\n if (!__listeners.has(actualType)) {\n __listeners.set(actualType, new Map());\n }\n const listenersForType = __listeners.get(actualType);\n if (!listenersForType.has(listener)) {\n // Any given listener is only registered once\n listenersForType.set(listener, options);\n }\n };\n\n EventTarget.prototype.removeEventListener = function (\n type,\n listener,\n _options\n ) {\n if (arguments.length < 2) {\n throw new TypeError(\n `TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only ${arguments.length} present.`\n );\n }\n const __listeners = this.__listeners;\n const actualType = type.toString();\n if (__listeners.has(actualType)) {\n const listenersForType = __listeners.get(actualType);\n if (listenersForType.has(listener)) {\n listenersForType.delete(listener);\n }\n }\n };\n\n EventTarget.prototype.dispatchEvent = function (event) {\n if (!(event instanceof Event)) {\n throw new TypeError(\n `Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.`\n );\n }\n const type = event.type;\n const __listeners = this.__listeners;\n const listenersForType = __listeners.get(type);\n if (listenersForType) {\n for (const [listener, options] of listenersForType.entries()) {\n try {\n if (typeof listener === \"function\") {\n // Listener functions must be executed with the EventTarget as the `this` context.\n listener.call(this, event);\n } else if (listener && typeof listener.handleEvent === \"function\") {\n // Listener objects have their handleEvent method called, if they have one\n listener.handleEvent(event);\n }\n } catch (err) {\n // We need to report the error to the global error handling event,\n // but we do not want to break the loop that is executing the events.\n // Unfortunately, this is the best we can do, which isn't great, because the\n // native EventTarget will actually do this synchronously before moving to the next\n // event in the loop.\n setTimeout(() => {\n throw err;\n });\n }\n if (options && options.once) {\n // If this was registered with { once: true }, we need\n // to remove it now.\n listenersForType.delete(listener);\n }\n }\n }\n // Since there are no cancellable events on a base EventTarget,\n // this should always return true.\n return true;\n };\n\n return EventTarget;\n })();\n}\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n};\n", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "// This file is auto-generated by ./scripts/build-nodes-map.js.\r\nexport { default as ArrayExpression } from './ArrayExpression.js';\r\nexport { default as ArrowFunctionExpression } from './ArrowFunctionExpression.js';\r\nexport { default as AssignmentExpression } from './AssignmentExpression.js';\r\nexport { default as BinaryExpression } from './BinaryExpression.js';\r\nexport { default as BlockStatement } from './BlockStatement.js';\r\nexport { default as BreakStatement } from './BreakStatement.js';\r\nexport { default as CallExpression } from './CallExpression.js';\r\nexport { default as ConditionalExpression } from './ConditionalExpression.js';\r\nexport { default as ContinueStatement } from './ContinueStatement.js';\r\nexport { default as ExpressionStatement } from './ExpressionStatement.js';\r\nexport { default as ForOfStatement } from './ForOfStatement.js';\r\nexport { default as ForStatement } from './ForStatement.js';\r\nexport { default as FunctionDeclaration } from './FunctionDeclaration.js';\r\nexport { default as FunctionExpression } from './FunctionExpression.js';\r\nexport { default as Identifier } from './Identifier.js';\r\nexport { default as IfStatement } from './IfStatement.js';\r\nexport { default as Literal } from './Literal.js';\r\nexport { default as LogicalExpression } from './LogicalExpression.js';\r\nexport { default as MemberExpression } from './MemberExpression.js';\r\nexport { default as NewExpression } from './NewExpression.js';\r\nexport { default as ObjectExpression } from './ObjectExpression.js';\r\nexport { default as Property } from './Property.js';\r\nexport { default as ReturnStatement } from './ReturnStatement.js';\r\nexport { default as SequenceExpression } from './SequenceExpression.js';\r\nexport { default as SwitchCase } from './SwitchCase.js';\r\nexport { default as SwitchStatement } from './SwitchStatement.js';\r\nexport { default as ThisExpression } from './ThisExpression.js';\r\nexport { default as ThrowStatement } from './ThrowStatement.js';\r\nexport { default as TryStatement } from './TryStatement.js';\r\nexport { default as UnaryExpression } from './UnaryExpression.js';\r\nexport { default as UpdateExpression } from './UpdateExpression.js';\r\nexport { default as VariableDeclaration } from './VariableDeclaration.js';\r\nexport { default as WhileStatement } from './WhileStatement.js';\r\n", "export default class BaseJSNode {\r\n constructor(node, visitor) {\r\n this.node = node;\r\n this.visitor = visitor;\r\n }\r\n run() { }\r\n}\r\n", "import BaseNode from './BaseJSNode.js';\r\nexport default class ArrayExpression extends BaseNode {\r\n run() {\r\n return this.node.elements.map((el) => this.visitor.visitNode(el));\r\n }\r\n}\r\n", "export const namedFunction = (name, fn) => Object.defineProperty(fn, 'name', { value: name });\r\nexport class JinterError extends Error {\r\n constructor(message, info) {\r\n super(message);\r\n if (info) {\r\n this.info = info;\r\n }\r\n }\r\n}\r\n", "import { namedFunction } from '../utils/index.js';\r\nimport BaseJSNode from './BaseJSNode.js';\r\nexport default class ArrowFunctionExpression extends BaseJSNode {\r\n run() {\r\n const { params, body } = this.node;\r\n // @TODO: Handle other types of params and pass them directly to next node instead of saving them in the global scope\r\n const fn = namedFunction('anonymous function', (args) => {\r\n let index = 0;\r\n for (const param of params) {\r\n this.visitor.visitNode(param);\r\n if (param.type === 'Identifier') {\r\n this.visitor.scope.set(param.name, args[index]);\r\n }\r\n else {\r\n console.warn('Unhandled param type', param.type);\r\n }\r\n index++;\r\n }\r\n return this.visitor.visitNode(body);\r\n });\r\n return fn;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class AssignmentExpression extends BaseJSNode {\r\n run() {\r\n const operator = this.node.operator;\r\n const right_node = this.visitor.visitNode(this.node.right);\r\n switch (operator) {\r\n case '=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] = right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n this.visitor.scope.set(this.node.left.name, right_node);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '+=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] += right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) + right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '-=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] -= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) - right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '*=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] *= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) * right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '/=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] /= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) / right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '%=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] %= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) % right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '**=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] **= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) ** right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '<<=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] <<= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) << right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '>>=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] >>= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) >> right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '>>>=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] >>>= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) >>> right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n case '&=':\r\n if (this.node.left.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.left.object);\r\n const prop = this.visitor.visitNode(this.node.left.property);\r\n return obj[prop] &= right_node;\r\n }\r\n else if (this.node.left.type === 'Identifier') {\r\n const result = this.visitor.visitNode(this.node.left) & right_node;\r\n this.visitor.scope.set(this.node.left.name, result);\r\n return this.visitor.scope.get(this.node.left.name);\r\n }\r\n console.warn('Unhandled left node', this.node.left);\r\n break;\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class BinaryExpression extends BaseJSNode {\r\n run() {\r\n const operator = this.node.operator;\r\n const left_node = this.visitor.visitNode(this.node.left);\r\n const right_node = this.visitor.visitNode(this.node.right);\r\n switch (operator) {\r\n case '!=':\r\n return left_node != right_node;\r\n case '!==':\r\n return left_node !== right_node;\r\n case '%':\r\n return left_node % right_node;\r\n case '&':\r\n return left_node & right_node;\r\n case '*':\r\n return left_node * right_node;\r\n case '**':\r\n return left_node ** right_node;\r\n case '+':\r\n return left_node + right_node;\r\n case '-':\r\n return left_node - right_node;\r\n case '/':\r\n return left_node / right_node;\r\n case '<':\r\n return left_node < right_node;\r\n case '<<':\r\n return left_node << right_node;\r\n case '<=':\r\n return left_node <= right_node;\r\n case '==':\r\n return left_node == right_node;\r\n case '===':\r\n return left_node === right_node;\r\n case '>':\r\n return left_node > right_node;\r\n case '>=':\r\n return left_node >= right_node;\r\n case '>>':\r\n return left_node >> right_node;\r\n case '>>>':\r\n return left_node >>> right_node;\r\n case '^':\r\n return left_node ^ right_node;\r\n case '|':\r\n return left_node | right_node;\r\n case 'in':\r\n return left_node in right_node;\r\n case 'instanceof':\r\n return left_node instanceof right_node;\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class BlockStatement extends BaseJSNode {\r\n run() {\r\n for (const stmt of this.node.body) {\r\n const result = this.visitor.visitNode(stmt);\r\n if (stmt.type === 'ReturnStatement')\r\n return result;\r\n if (result === 'break' || result === 'continue')\r\n return result;\r\n if ((stmt.type === 'WhileStatement' ||\r\n stmt.type === 'IfStatement' ||\r\n stmt.type === 'ForStatement' ||\r\n stmt.type === 'TryStatement') &&\r\n !!result) {\r\n return result;\r\n }\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class BreakStatement extends BaseJSNode {\r\n run() {\r\n // @TODO: Parse label\r\n return 'break';\r\n }\r\n}\r\n", "var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _CallExpression_instances, _CallExpression_throwError, _CallExpression_getCalleeString;\r\nimport BaseJSNode from './BaseJSNode.js';\r\nimport { JinterError } from '../utils/index.js';\r\nexport default class CallExpression extends BaseJSNode {\r\n constructor() {\r\n super(...arguments);\r\n _CallExpression_instances.add(this);\r\n }\r\n run() {\r\n let exp_object;\r\n let exp_property;\r\n if (this.node.callee.type === 'MemberExpression') {\r\n exp_object = this.visitor.getName(this.node.callee.object);\r\n exp_property = this.visitor.getName(this.node.callee.property);\r\n }\r\n else if (this.node.callee.type === 'Identifier') {\r\n exp_property = this.node.callee.name;\r\n }\r\n // Obj.fn(...);\r\n if (exp_object && this.visitor.listeners[exp_object]) {\r\n const cb = this.visitor.listeners[exp_object](this.node, this.visitor);\r\n if (cb !== '__continue_exec') {\r\n return cb;\r\n }\r\n }\r\n // ?.fn(...);\r\n if (exp_property && exp_property !== 'toString' && this.visitor.listeners[exp_property]) {\r\n const cb = this.visitor.listeners[exp_property](this.node, this.visitor);\r\n if (cb !== '__continue_exec') {\r\n return cb;\r\n }\r\n }\r\n if (this.node.callee.type === 'MemberExpression') {\r\n if (Builtins.has(this.node, this.visitor)) {\r\n return Builtins.execute(this.node, this.visitor);\r\n }\r\n const obj = this.visitor.visitNode(this.node.callee.object);\r\n const prop = this.node.callee.computed ? this.visitor.visitNode(this.node.callee.property) : this.visitor.getName(this.node.callee.property);\r\n const args = this.node.arguments.map((arg) => this.visitor.visitNode(arg));\r\n if (!obj)\r\n __classPrivateFieldGet(this, _CallExpression_instances, \"m\", _CallExpression_throwError).call(this);\r\n if (typeof obj[prop] !== 'function')\r\n __classPrivateFieldGet(this, _CallExpression_instances, \"m\", _CallExpression_throwError).call(this);\r\n if (obj[prop].toString().includes('[native code]'))\r\n return obj[prop](...args);\r\n return obj[prop](args);\r\n }\r\n const fn = this.visitor.visitNode(this.node.callee);\r\n const args = this.node.arguments.map((arg) => this.visitor.visitNode(arg));\r\n if (typeof fn !== 'function')\r\n __classPrivateFieldGet(this, _CallExpression_instances, \"m\", _CallExpression_throwError).call(this);\r\n return fn(args);\r\n }\r\n}\r\n_CallExpression_instances = new WeakSet(), _CallExpression_throwError = function _CallExpression_throwError() {\r\n if (this.node.callee.type === 'MemberExpression' || this.node.callee.type === 'Identifier') {\r\n const callee_string = __classPrivateFieldGet(this, _CallExpression_instances, \"m\", _CallExpression_getCalleeString).call(this, this.node.callee);\r\n throw new JinterError(`${callee_string} is not a function`);\r\n }\r\n else if (this.node.callee.type === 'SequenceExpression') {\r\n const call = [];\r\n const items = [];\r\n call.push('(');\r\n this.node.callee.expressions.forEach((expr) => {\r\n if (expr.type === 'Literal') {\r\n items.push(expr.raw || '');\r\n }\r\n else if (expr.type === 'Identifier') {\r\n items.push(expr.name);\r\n }\r\n else if (expr.type === 'MemberExpression') {\r\n if (expr.computed) {\r\n items.push(`${this.visitor.getName(expr.object)}[${this.visitor.getName(expr.property) || '...'}]`);\r\n }\r\n else {\r\n items.push(`${this.visitor.getName(expr.object)}.${this.visitor.getName(expr.property)}`);\r\n }\r\n }\r\n });\r\n call.push(items.join(', '));\r\n call.push(')');\r\n throw new JinterError(`${call.join('')} is not a function`);\r\n }\r\n}, _CallExpression_getCalleeString = function _CallExpression_getCalleeString(node) {\r\n if (node.type === 'Identifier') {\r\n return node.name;\r\n }\r\n else if (node.type === 'MemberExpression') {\r\n const object_string = __classPrivateFieldGet(this, _CallExpression_instances, \"m\", _CallExpression_getCalleeString).call(this, node.object);\r\n const property_string = node.computed ? `[${this.visitor.getName(node.property) || '...'}]` : `.${this.visitor.getName(node.property)}`;\r\n return `${object_string}${property_string}`;\r\n }\r\n return '';\r\n};\r\nclass Builtins {\r\n static has(node, visitor) {\r\n var _a;\r\n if (node.callee.type === 'MemberExpression') {\r\n return !!((_a = this.builtins) === null || _a === void 0 ? void 0 : _a[visitor.getName(node.callee.property) || '']);\r\n }\r\n return false;\r\n }\r\n static execute(node, visitor) {\r\n if (node.callee.type === 'MemberExpression') {\r\n return this.builtins[visitor.getName(node.callee.property) || ''](node, visitor);\r\n }\r\n }\r\n}\r\nBuiltins.builtins = {\r\n // Override the forEach method so that the \"this\" arg is set correctly\r\n forEach: (node, visitor) => {\r\n const args = node.arguments.map((arg) => visitor.visitNode(arg));\r\n if (node.callee.type === 'MemberExpression') {\r\n const arr = visitor.visitNode(node.callee.object);\r\n // Set forEach's \u201Cthis\u201D arg\r\n if (args.length > 1) {\r\n visitor.scope.set('_this', args.slice(-1)[0]);\r\n }\r\n // Execute callback function\r\n let index = 0;\r\n for (const element of arr) {\r\n args[0]([element, index++, arr]);\r\n }\r\n }\r\n else {\r\n console.warn('Unhandled callee type:', node.callee.type);\r\n }\r\n },\r\n // Also override the toString method so that it stringifies the correct object\r\n toString: (node, visitor) => {\r\n if (node.callee.type === 'MemberExpression') {\r\n return visitor.visitNode(node.callee.object).toString();\r\n }\r\n }\r\n};\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ConditionalExpression extends BaseJSNode {\r\n run() {\r\n const { test, consequent, alternate } = this.node;\r\n const check = this.visitor.visitNode(test);\r\n if (check) {\r\n return this.visitor.visitNode(consequent);\r\n }\r\n return this.visitor.visitNode(alternate);\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ContinueStatement extends BaseJSNode {\r\n run() {\r\n return 'continue';\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ExpressionStatement extends BaseJSNode {\r\n run() {\r\n return this.visitor.visitNode(this.node.expression);\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ForOfStatement extends BaseJSNode {\r\n run() {\r\n this.visitor.visitNode(this.node.left);\r\n const right_node = this.visitor.visitNode(this.node.right);\r\n for (const el of right_node) {\r\n if (this.node.left.type === 'VariableDeclaration' && this.node.left.declarations[0].id.type === 'Identifier') {\r\n this.visitor.scope.set(this.node.left.declarations[0].id.name, el);\r\n }\r\n else if (this.node.left.type === 'VariableDeclaration' && this.node.left.declarations[0].id.type === 'ObjectPattern') {\r\n for (const propert of this.node.left.declarations[0].id.properties) {\r\n if (propert.type === 'Property' && (propert.value.type === 'Identifier' && propert.key.type === 'Identifier')) {\r\n this.visitor.scope.set(propert.value.name, el[propert.key.name]);\r\n }\r\n }\r\n }\r\n const body = this.visitor.visitNode(this.node.body);\r\n if (body === 'break') {\r\n break;\r\n }\r\n if (body === 'continue') {\r\n continue;\r\n }\r\n if (body && this.node.body.type !== 'ExpressionStatement') {\r\n return body;\r\n }\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ForStatement extends BaseJSNode {\r\n run() {\r\n if (this.node.init) {\r\n this.visitor.visitNode(this.node.init);\r\n }\r\n const test = () => {\r\n return this.node.test\r\n ? this.visitor.visitNode(this.node.test)\r\n : true;\r\n };\r\n for (;;) {\r\n const _test = test();\r\n if (!_test) {\r\n break;\r\n }\r\n const body = this.visitor.visitNode(this.node.body);\r\n if (body === 'continue') {\r\n continue;\r\n }\r\n if (body === 'break') {\r\n break;\r\n }\r\n if (this.node.update) {\r\n this.visitor.visitNode(this.node.update);\r\n }\r\n if (body && this.node.body.type !== 'ExpressionStatement') {\r\n return body;\r\n }\r\n }\r\n }\r\n}\r\n", "import { namedFunction } from '../utils/index.js';\r\nimport BaseJSNode from './BaseJSNode.js';\r\nexport default class FunctionDeclaration extends BaseJSNode {\r\n run() {\r\n const { params, body } = this.node;\r\n const id = this.visitor.visitNode(this.node.id);\r\n // @TODO: Handle other types of params and pass them directly to next node instead of saving them in the global scope\r\n const fn = namedFunction(id, (args) => {\r\n let index = 0;\r\n for (const param of params) {\r\n this.visitor.visitNode(param);\r\n if (param.type === 'Identifier') {\r\n this.visitor.scope.set(param.name, args[index]);\r\n }\r\n else {\r\n console.warn('Unhandled param type', param.type);\r\n }\r\n index++;\r\n }\r\n return this.visitor.visitNode(body);\r\n });\r\n this.visitor.scope.set(id, fn);\r\n }\r\n}\r\n", "import { namedFunction } from '../utils/index.js';\r\nimport BaseJSNode from './BaseJSNode.js';\r\nexport default class FunctionExpression extends BaseJSNode {\r\n run() {\r\n const { params, body } = this.node;\r\n const fn = namedFunction('anonymous function', (args) => {\r\n let index = 0;\r\n for (const param of params) {\r\n this.visitor.visitNode(param);\r\n if (param.type === 'Identifier') {\r\n this.visitor.scope.set(param.name, args[index]);\r\n }\r\n else {\r\n console.warn('Unhandled param type', param.type);\r\n }\r\n index++;\r\n }\r\n return this.visitor.visitNode(body);\r\n });\r\n return fn;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class Identifier extends BaseJSNode {\r\n run() {\r\n if (this.visitor.listeners[this.node.name]) {\r\n const cb = this.visitor.listeners[this.node.name](this.node, this.visitor);\r\n if (cb !== '__continue_exec') {\r\n return cb;\r\n }\r\n }\r\n if (this.visitor.scope.has(this.node.name))\r\n return this.visitor.scope.get(this.node.name);\r\n return this.node.name;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class IfStatement extends BaseJSNode {\r\n run() {\r\n const test = this.visitor.visitNode(this.node.test);\r\n if (test) {\r\n return this.visitor.visitNode(this.node.consequent);\r\n }\r\n else if (this.node.alternate) {\r\n return this.visitor.visitNode(this.node.alternate);\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class Literal extends BaseJSNode {\r\n run() {\r\n return this.node.value;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class LogicalExpression extends BaseJSNode {\r\n run() {\r\n const operator = this.node.operator;\r\n switch (operator) {\r\n case '&&': {\r\n const left_side = this.visitor.visitNode(this.node.left);\r\n if (left_side === true)\r\n return this.visitor.visitNode(this.node.right);\r\n return left_side;\r\n }\r\n case '||': {\r\n const left_side = this.visitor.visitNode(this.node.left);\r\n return left_side || this.visitor.visitNode(this.node.right);\r\n }\r\n case '??': {\r\n const left_side = this.visitor.visitNode(this.node.left);\r\n return left_side !== null && left_side !== void 0 ? left_side : this.visitor.visitNode(this.node.right);\r\n }\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class MemberExpression extends BaseJSNode {\r\n run() {\r\n const { object, property, computed } = this.node;\r\n const obj = this.visitor.visitNode(object);\r\n const prop = computed ? this.visitor.visitNode(property) : this.visitor.getName(property);\r\n if (prop !== undefined || prop !== null) {\r\n if (this.visitor.listeners[prop]) {\r\n const cb = this.visitor.listeners[prop](this.node, this.visitor);\r\n if (cb !== '__continue_exec') {\r\n return cb;\r\n }\r\n }\r\n return obj === null || obj === void 0 ? void 0 : obj[prop];\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class NewExpression extends BaseJSNode {\r\n run() {\r\n const callee = this.visitor.visitNode(this.node.callee);\r\n const args = this.node.arguments.map((arg) => this.visitor.visitNode(arg));\r\n return args.length ? new callee(args) : new callee();\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ObjectExpression extends BaseJSNode {\r\n run() {\r\n let result = {};\r\n for (const prop of this.node.properties) {\r\n if (prop.type === 'Property') {\r\n result = Object.assign(Object.assign({}, result), this.visitor.visitNode(prop));\r\n }\r\n else {\r\n throw new Error(`Unhandled property type: ${prop.type}`);\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n", "var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _Property_instances, _Property_init, _Property_get, _Property_set;\r\nimport BaseJSNode from './BaseJSNode.js';\r\nexport default class Property extends BaseJSNode {\r\n constructor() {\r\n super(...arguments);\r\n _Property_instances.add(this);\r\n }\r\n run() {\r\n switch (this.node.kind) {\r\n case 'init':\r\n return __classPrivateFieldGet(this, _Property_instances, \"m\", _Property_init).call(this);\r\n case 'get':\r\n return __classPrivateFieldGet(this, _Property_instances, \"m\", _Property_get).call(this);\r\n case 'set':\r\n return __classPrivateFieldGet(this, _Property_instances, \"m\", _Property_set).call(this);\r\n default:\r\n throw new Error(`Unhandled property kind: ${this.node.kind}`);\r\n }\r\n }\r\n}\r\n_Property_instances = new WeakSet(), _Property_init = function _Property_init() {\r\n const key = this.node.computed ? this.visitor.visitNode(this.node.key) : this.visitor.getName(this.node.key);\r\n const value = this.visitor.visitNode(this.node.value);\r\n if (key) {\r\n return { [key]: value };\r\n }\r\n}, _Property_get = function _Property_get() {\r\n throw new TypeError('Not implemented: Property.get');\r\n}, _Property_set = function _Property_set() {\r\n throw new TypeError('Not implemented: Property.set');\r\n};\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ReturnStatement extends BaseJSNode {\r\n run() {\r\n if (this.node.argument) {\r\n return this.visitor.visitNode(this.node.argument);\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class SequenceExpression extends BaseJSNode {\r\n run() {\r\n let result;\r\n for (const expression of this.node.expressions) {\r\n result = this.visitor.visitNode(expression);\r\n }\r\n return result;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class SwitchCase extends BaseJSNode {\r\n run() {\r\n for (const stmt of this.node.consequent) {\r\n const result = this.visitor.visitNode(stmt);\r\n if (stmt.type === 'ContinueStatement' || stmt.type === 'BreakStatement') {\r\n return result;\r\n }\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class SwitchStatement extends BaseJSNode {\r\n run() {\r\n const discriminant = this.visitor.visitNode(this.node.discriminant);\r\n let matched = false;\r\n let default_case = -1;\r\n let index = 0;\r\n while (true) {\r\n const _case = this.node.cases[index];\r\n if (matched) {\r\n const result = this.visitor.visitNode(_case);\r\n // If it's a break then stop here.\r\n if (result === 'break') {\r\n break;\r\n }\r\n // Switch statements do not support continue, but it can be used when inside a while/for loop.\r\n if (result === 'continue') {\r\n return result;\r\n }\r\n ++index;\r\n if (index >= this.node.cases.length) {\r\n index = 0;\r\n break;\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n matched = _case && (discriminant === this.visitor.visitNode(_case.test));\r\n // Ran through all cases and checked everything, break the loop.\r\n if (matched === undefined && index > this.node.cases.length)\r\n break;\r\n // Save the default case so we can get back to it later.\r\n if (_case && !matched && !_case.test) {\r\n default_case = index;\r\n index += 1;\r\n continue;\r\n }\r\n // Ran through all cases but no match \u2014 run default case.\r\n if (!_case && !matched && default_case !== -1) {\r\n matched = true;\r\n index = default_case;\r\n continue;\r\n }\r\n if (!matched) {\r\n ++index;\r\n }\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ThisExpression extends BaseJSNode {\r\n run() {\r\n return this.visitor.scope.get('_this');\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class ThrowStatement extends BaseJSNode {\r\n run() {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n throw arg;\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class TryStatement extends BaseJSNode {\r\n run() {\r\n try {\r\n return this.visitor.visitNode(this.node.block);\r\n }\r\n catch (e) {\r\n if (this.node.handler) {\r\n if (this.node.handler.param && this.node.handler.param.type === 'Identifier') {\r\n this.visitor.scope.set(this.node.handler.param.name, e);\r\n }\r\n return this.visitor.visitNode(this.node.handler.body);\r\n }\r\n }\r\n finally {\r\n this.visitor.visitNode(this.node.finalizer);\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class UnaryExpression extends BaseJSNode {\r\n run() {\r\n const operator = this.node.operator;\r\n switch (operator) {\r\n case '-': {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n return -arg;\r\n }\r\n case '+': {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n return +arg;\r\n }\r\n case '!': {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n return !arg;\r\n }\r\n case '~': {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n return ~arg;\r\n }\r\n case 'void': {\r\n this.visitor.visitNode(this.node.argument);\r\n return undefined;\r\n }\r\n case 'typeof': {\r\n const arg = this.visitor.visitNode(this.node.argument);\r\n return typeof arg;\r\n }\r\n case 'delete': {\r\n if (this.node.argument.type === 'MemberExpression') {\r\n const obj = this.visitor.visitNode(this.node.argument.object);\r\n const prop = this.node.argument.computed ? this.visitor.visitNode(this.node.argument.property) : this.visitor.getName(this.node.argument.property);\r\n return delete obj[prop];\r\n }\r\n else if (this.node.argument.type === 'Identifier') {\r\n return this.visitor.scope.delete(this.node.argument.name);\r\n }\r\n return true;\r\n }\r\n default:\r\n console.warn('Unhandled UnaryExpression operator', operator);\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class UpdateExpression extends BaseJSNode {\r\n run() {\r\n const operator = this.node.operator;\r\n switch (operator) {\r\n case '++':\r\n {\r\n if (this.node.argument.type === 'MemberExpression') {\r\n const target_node = this.visitor.visitNode(this.node.argument.object);\r\n return target_node[this.visitor.visitNode(this.node.argument.property)]++;\r\n }\r\n else if (this.node.argument.type === 'Identifier') {\r\n let target_node = this.visitor.visitNode(this.node.argument);\r\n this.visitor.scope.set(this.node.argument.name, target_node + 1);\r\n return this.node.prefix ? ++target_node : target_node;\r\n }\r\n }\r\n break;\r\n case '--':\r\n {\r\n if (this.node.argument.type === 'MemberExpression') {\r\n const target_node = this.visitor.visitNode(this.node.argument.object);\r\n return target_node[this.visitor.visitNode(this.node.argument.property)]--;\r\n }\r\n else if (this.node.argument.type === 'Identifier') {\r\n let target_node = this.visitor.visitNode(this.node.argument);\r\n this.visitor.scope.set(this.node.argument.name, target_node - 1);\r\n return this.node.prefix ? --target_node : target_node;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class VariableDeclaration extends BaseJSNode {\r\n run() {\r\n // TODO: Parse kind\r\n this.node.declarations.forEach((declar) => {\r\n const { id, init } = declar;\r\n const key = this.visitor.getName(id);\r\n const value = init\r\n ? this.visitor.visitNode(init)\r\n : undefined;\r\n if (key)\r\n this.visitor.scope.set(key, value);\r\n if (typeof value === 'object' && value !== null)\r\n this.visitor.scope.set('_this', value);\r\n });\r\n }\r\n}\r\n", "import BaseJSNode from './BaseJSNode.js';\r\nexport default class WhileStatement extends BaseJSNode {\r\n run() {\r\n while (this.visitor.visitNode(this.node.test)) {\r\n const body = this.visitor.visitNode(this.node.body);\r\n if (body === 'break')\r\n break;\r\n if (body === 'continue')\r\n continue;\r\n if (body)\r\n return body;\r\n }\r\n }\r\n}\r\n", "var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _Visitor_instances, _Visitor_getNode;\r\nimport * as Nodes from './nodes/index.js';\r\nexport default class Visitor {\r\n constructor() {\r\n _Visitor_instances.add(this);\r\n this.scope = new Map();\r\n this.listeners = {};\r\n this.ast = [];\r\n }\r\n setAST(ast) {\r\n this.ast = ast;\r\n }\r\n run() {\r\n let result;\r\n for (const node of this.ast) {\r\n result = this.visitNode(node);\r\n }\r\n return result;\r\n }\r\n /**\r\n * Visits a given node and executes it.\r\n */\r\n visitNode(node) {\r\n if (!node)\r\n return null;\r\n const target_node = __classPrivateFieldGet(this, _Visitor_instances, \"m\", _Visitor_getNode).call(this, node.type);\r\n if (target_node) {\r\n const instance = new target_node(node, this);\r\n return instance.run();\r\n }\r\n }\r\n /**\r\n * Gets the name of a node.\r\n * @param node - The target node.\r\n */\r\n getName(node) {\r\n if (node.type === 'Identifier')\r\n return node.name;\r\n else if (node.type === 'Literal')\r\n return node.value;\r\n }\r\n /**\r\n * Listens for node calls. Can be used to override default behavior or add new functionality.\r\n * @param node_name - The node to listen for.\r\n * @param listener - The callback function.\r\n */\r\n on(node_name, listener) {\r\n this.listeners[node_name] = listener;\r\n }\r\n}\r\n_Visitor_instances = new WeakSet(), _Visitor_getNode = function _Visitor_getNode(type) {\r\n const node = Nodes[type];\r\n if (!node) {\r\n console.warn('[JINTER]:', `JavaScript node \"${type}\" not implemented!\\nIf this is causing unexpected behavior, please report it at https://github.com/LuanRT/Jinter/issues/new`);\r\n }\r\n return node;\r\n};\r\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), 14 (2023), or `\"latest\"`\n // (the latest version the library supports). This influences\n // support for strict mode, the set of reserved words, and support\n // for 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 is\n // allowed and treated as a line comment. Enabled by default when\n // `ecmaVersion` >= 2023.\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\u2014that 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\u2014that 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 (opts.allowHashBang == null)\n { options.allowHashBang = options.ecmaVersion >= 14; }\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, isAssign ? \"Assigning to rvalue\" : \"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 this.options.ecmaVersion >= 5 &&\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 \u2014\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 += \u2026;\n// import a from '\u2026';\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 = \u2026);\n// const a = \u2026;\n// try { \u2026 } catch (a) { \u2026 }\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 cases when token context could not be inferred correctly during tokenization phase\n\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 \u2014\n// either with each other or with an init property \u2014 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 \u2014 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 \u2014 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 // 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 // `` 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 // `` 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 // `` 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 // `